Encode foreign function argument names

Fix #21917
This commit is contained in:
Tom Jakubowski 2015-02-06 02:43:45 -08:00
parent df1cfde253
commit e43c478035
4 changed files with 42 additions and 1 deletions

View File

@ -1466,7 +1466,7 @@ fn encode_info_for_foreign_item(ecx: &EncodeContext,
encode_def_id(rbml_w, local_def(nitem.id));
encode_visibility(rbml_w, nitem.vis);
match nitem.node {
ast::ForeignItemFn(..) => {
ast::ForeignItemFn(ref fndecl, _) => {
encode_family(rbml_w, FN_FAMILY);
encode_bounds_and_type(rbml_w, ecx,
&lookup_item_type(ecx.tcx,local_def(nitem.id)));
@ -1478,6 +1478,7 @@ fn encode_info_for_foreign_item(ecx: &EncodeContext,
let stab = stability::lookup(ecx.tcx, ast_util::local_def(nitem.id));
encode_stability(rbml_w, stab);
encode_symbol(ecx, rbml_w, nitem.id);
encode_method_argument_names(rbml_w, &*fndecl);
}
ast::ForeignItemStatic(_, mutbl) => {
if mutbl {

View File

@ -0,0 +1,8 @@
-include ../tools.mk
all: lib.rs
$(HOST_RPATH_ENV) $(RUSTC) lib.rs
$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc lib.rs
$(HOST_RPATH_ENV) $(RUSTDOC) -L $(TMPDIR) -w html -o $(TMPDIR)/doc user.rs
$(HTMLDOCCK) $(TMPDIR)/doc lib.rs
$(HTMLDOCCK) $(TMPDIR)/doc user.rs

View File

@ -0,0 +1,16 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_type="lib"]
extern "C" {
// @has lib/fn.foreigner.html //pre 'pub unsafe fn foreigner(cold_as_ice: u32)'
pub fn foreigner(cold_as_ice: u32);
}

View File

@ -0,0 +1,16 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![crate_type="lib"]
extern crate lib;
// @has user/fn.foreigner.html //pre 'pub unsafe fn foreigner(cold_as_ice: u32)'
pub use lib::foreigner;