Remove the "linked_from" feature.

This commit is contained in:
Vadim Chugunov 2016-12-01 15:21:59 -08:00
parent 13477c77bf
commit a9a6f8c8ed
7 changed files with 5 additions and 56 deletions

View file

@ -465,11 +465,9 @@ pub mod debuginfo {
// generates an llvmdeps.rs file next to this one which will be // generates an llvmdeps.rs file next to this one which will be
// automatically updated whenever LLVM is updated to include an up-to-date // automatically updated whenever LLVM is updated to include an up-to-date
// set of the libraries we need to link to LLVM for. // set of the libraries we need to link to LLVM for.
#[link(name = "rustllvm", kind = "static")] #[cfg_attr(not(all(stage0,cargobuild)),
#[cfg(not(cargobuild))] link(name = "rustllvm", kind = "static"))] // not quite true but good enough
extern "C" {} #[cfg_attr(stage0, linked_from = "rustllvm")]
#[linked_from = "rustllvm"] // not quite true but good enough
extern "C" { extern "C" {
// Create and destroy contexts. // Create and destroy contexts.
pub fn LLVMContextCreate() -> ContextRef; pub fn LLVMContextCreate() -> ContextRef;

View file

@ -27,7 +27,7 @@
#![feature(concat_idents)] #![feature(concat_idents)]
#![feature(libc)] #![feature(libc)]
#![feature(link_args)] #![feature(link_args)]
#![feature(linked_from)] #![cfg_attr(stage0, feature(linked_from))]
#![feature(staged_api)] #![feature(staged_api)]
extern crate libc; extern crate libc;

View file

@ -22,7 +22,7 @@ use rustc_back::PanicStrategy;
use rustc::session::search_paths::PathKind; use rustc::session::search_paths::PathKind;
use rustc::middle; use rustc::middle;
use rustc::middle::cstore::{CrateStore, validate_crate_name, ExternCrate}; 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::middle::cstore::NativeLibrary;
use rustc::hir::map::Definitions; use rustc::hir::map::Definitions;
@ -52,7 +52,6 @@ pub struct CrateLoader<'a> {
pub sess: &'a Session, pub sess: &'a Session,
cstore: &'a CStore, cstore: &'a CStore,
next_crate_num: CrateNum, next_crate_num: CrateNum,
foreign_item_map: FxHashMap<String, Vec<DefIndex>>,
local_crate_name: Symbol, local_crate_name: Symbol,
} }
@ -148,7 +147,6 @@ impl<'a> CrateLoader<'a> {
sess: sess, sess: sess,
cstore: cstore, cstore: cstore,
next_crate_num: cstore.next_crate_num(), next_crate_num: cstore.next_crate_num(),
foreign_item_map: FxHashMap(),
local_crate_name: Symbol::intern(local_crate_name), local_crate_name: Symbol::intern(local_crate_name),
} }
} }
@ -649,14 +647,6 @@ impl<'a> CrateLoader<'a> {
items.extend(&lib.foreign_items); 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 items
} }
@ -943,17 +933,6 @@ impl<'a> CrateLoader<'a> {
}; };
register_native_lib(self.sess, self.cstore, Some(m.span), lib); 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()));
}
} }
} }

View file

@ -132,7 +132,6 @@ declare_features! (
(active, allocator, "1.0.0", Some(27389)), (active, allocator, "1.0.0", Some(27389)),
(active, fundamental, "1.0.0", Some(29635)), (active, fundamental, "1.0.0", Some(29635)),
(active, linked_from, "1.3.0", Some(29629)),
(active, main, "1.0.0", Some(29634)), (active, main, "1.0.0", Some(29634)),
(active, needs_allocator, "1.4.0", Some(27389)), (active, needs_allocator, "1.4.0", Some(27389)),
(active, on_unimplemented, "1.0.0", Some(29628)), (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", is an experimental feature",
cfg_fn!(fundamental))), 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_derive", Normal, Gated(Stability::Unstable,
"proc_macro", "proc_macro",
"the `#[proc_macro_derive]` attribute \ "the `#[proc_macro_derive]` attribute \

View file

@ -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() {}

View file

@ -8,11 +8,9 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(linked_from)]
#![crate_type = "dylib"] #![crate_type = "dylib"]
#[link(name = "foo", kind = "static")] #[link(name = "foo", kind = "static")]
#[linked_from = "foo"]
extern { extern {
pub fn foo(); pub fn foo();
} }

View file

@ -10,12 +10,9 @@
// no-prefer-dynamic // no-prefer-dynamic
#![feature(linked_from)]
#![crate_type = "rlib"] #![crate_type = "rlib"]
#[link(name = "rust_test_helpers", kind = "static")] #[link(name = "rust_test_helpers", kind = "static")]
#[linked_from = "rust_test_helpers"]
extern { extern {
pub fn rust_dbg_extern_identity_u32(u: u32) -> u32; pub fn rust_dbg_extern_identity_u32(u: u32) -> u32;
} }