diff options
| -rw-r--r-- | src/librustc_llvm/ffi.rs | 8 | ||||
| -rw-r--r-- | src/librustc_llvm/lib.rs | 2 | ||||
| -rw-r--r-- | src/librustc_metadata/creader.rs | 23 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 7 | ||||
| -rw-r--r-- | src/test/compile-fail/feature-gate-linked-from.rs | 16 | ||||
| -rw-r--r-- | src/test/run-make/issue-15460/foo.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/auxiliary/issue-25185-1.rs | 3 |
7 files changed, 5 insertions, 56 deletions
diff --git a/src/librustc_llvm/ffi.rs b/src/librustc_llvm/ffi.rs index 98816826b9e..4ee157233ed 100644 --- a/src/librustc_llvm/ffi.rs +++ b/src/librustc_llvm/ffi.rs @@ -465,11 +465,9 @@ pub mod debuginfo { // generates an llvmdeps.rs file next to this one which will be // automatically updated whenever LLVM is updated to include an up-to-date // set of the libraries we need to link to LLVM for. -#[link(name = "rustllvm", kind = "static")] -#[cfg(not(cargobuild))] -extern "C" {} - -#[linked_from = "rustllvm"] // not quite true but good enough +#[cfg_attr(not(all(stage0,cargobuild)), + link(name = "rustllvm", kind = "static"))] // not quite true but good enough +#[cfg_attr(stage0, linked_from = "rustllvm")] extern "C" { // Create and destroy contexts. pub fn LLVMContextCreate() -> ContextRef; diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index 0229776c948..8ac2c4677ee 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -27,7 +27,7 @@ #![feature(concat_idents)] #![feature(libc)] #![feature(link_args)] -#![feature(linked_from)] +#![cfg_attr(stage0, feature(linked_from))] #![feature(staged_api)] extern crate libc; diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index ccbe90ebe7c..90bd65386e4 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -22,7 +22,7 @@ use rustc_back::PanicStrategy; use rustc::session::search_paths::PathKind; use rustc::middle; use rustc::middle::cstore::{CrateStore, validate_crate_name, ExternCrate}; -use rustc::util::nodemap::{FxHashMap, FxHashSet}; +use rustc::util::nodemap::FxHashSet; use rustc::middle::cstore::NativeLibrary; use rustc::hir::map::Definitions; @@ -52,7 +52,6 @@ pub struct CrateLoader<'a> { pub sess: &'a Session, cstore: &'a CStore, next_crate_num: CrateNum, - foreign_item_map: FxHashMap<String, Vec<DefIndex>>, local_crate_name: Symbol, } @@ -148,7 +147,6 @@ impl<'a> CrateLoader<'a> { sess: sess, cstore: cstore, next_crate_num: cstore.next_crate_num(), - foreign_item_map: FxHashMap(), local_crate_name: Symbol::intern(local_crate_name), } } @@ -649,14 +647,6 @@ impl<'a> CrateLoader<'a> { items.extend(&lib.foreign_items); } } - for (foreign_lib, list) in self.foreign_item_map.iter() { - let kind_matches = libs.borrow().iter().any(|lib| { - lib.name == &**foreign_lib && lib.kind == kind - }); - if kind_matches { - items.extend(list) - } - } items } @@ -943,17 +933,6 @@ impl<'a> CrateLoader<'a> { }; register_native_lib(self.sess, self.cstore, Some(m.span), lib); } - - // Finally, process the #[linked_from = "..."] attribute - for m in i.attrs.iter().filter(|a| a.check_name("linked_from")) { - let lib_name = match m.value_str() { - Some(name) => name, - None => continue, - }; - let list = self.foreign_item_map.entry(lib_name.to_string()) - .or_insert(Vec::new()); - list.extend(fm.items.iter().map(|it| definitions.opt_def_index(it.id).unwrap())); - } } } diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index aa6a29b78b0..33d99d37c2d 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -132,7 +132,6 @@ declare_features! ( (active, allocator, "1.0.0", Some(27389)), (active, fundamental, "1.0.0", Some(29635)), - (active, linked_from, "1.3.0", Some(29629)), (active, main, "1.0.0", Some(29634)), (active, needs_allocator, "1.4.0", Some(27389)), (active, on_unimplemented, "1.0.0", Some(29628)), @@ -636,12 +635,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG is an experimental feature", cfg_fn!(fundamental))), - ("linked_from", Normal, Gated(Stability::Unstable, - "linked_from", - "the `#[linked_from]` attribute \ - is an experimental feature", - cfg_fn!(linked_from))), - ("proc_macro_derive", Normal, Gated(Stability::Unstable, "proc_macro", "the `#[proc_macro_derive]` attribute \ diff --git a/src/test/compile-fail/feature-gate-linked-from.rs b/src/test/compile-fail/feature-gate-linked-from.rs deleted file mode 100644 index 8705684111e..00000000000 --- a/src/test/compile-fail/feature-gate-linked-from.rs +++ /dev/null @@ -1,16 +0,0 @@ -// 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. - -#[linked_from = "foo"] //~ ERROR experimental feature -extern { - fn foo(); -} - -fn main() {} diff --git a/src/test/run-make/issue-15460/foo.rs b/src/test/run-make/issue-15460/foo.rs index 8b96fe36824..6917fa55579 100644 --- a/src/test/run-make/issue-15460/foo.rs +++ b/src/test/run-make/issue-15460/foo.rs @@ -8,11 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(linked_from)] #![crate_type = "dylib"] #[link(name = "foo", kind = "static")] -#[linked_from = "foo"] extern { pub fn foo(); } diff --git a/src/test/run-pass/auxiliary/issue-25185-1.rs b/src/test/run-pass/auxiliary/issue-25185-1.rs index 1ec29501b76..b9da39cbbcb 100644 --- a/src/test/run-pass/auxiliary/issue-25185-1.rs +++ b/src/test/run-pass/auxiliary/issue-25185-1.rs @@ -10,12 +10,9 @@ // no-prefer-dynamic -#![feature(linked_from)] - #![crate_type = "rlib"] #[link(name = "rust_test_helpers", kind = "static")] -#[linked_from = "rust_test_helpers"] extern { pub fn rust_dbg_extern_identity_u32(u: u32) -> u32; } |
