Skip to content

Commit a9a6f8c

Browse files
committed
Remove the "linked_from" feature.
1 parent 13477c7 commit a9a6f8c

File tree

7 files changed

+5
-56
lines changed

7 files changed

+5
-56
lines changed

src/librustc_llvm/ffi.rs

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

src/librustc_llvm/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#![feature(concat_idents)]
2828
#![feature(libc)]
2929
#![feature(link_args)]
30-
#![feature(linked_from)]
30+
#![cfg_attr(stage0, feature(linked_from))]
3131
#![feature(staged_api)]
3232

3333
extern crate libc;

src/librustc_metadata/creader.rs

+1-22
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use rustc_back::PanicStrategy;
2222
use rustc::session::search_paths::PathKind;
2323
use rustc::middle;
2424
use rustc::middle::cstore::{CrateStore, validate_crate_name, ExternCrate};
25-
use rustc::util::nodemap::{FxHashMap, FxHashSet};
25+
use rustc::util::nodemap::FxHashSet;
2626
use rustc::middle::cstore::NativeLibrary;
2727
use rustc::hir::map::Definitions;
2828

@@ -52,7 +52,6 @@ pub struct CrateLoader<'a> {
5252
pub sess: &'a Session,
5353
cstore: &'a CStore,
5454
next_crate_num: CrateNum,
55-
foreign_item_map: FxHashMap<String, Vec<DefIndex>>,
5655
local_crate_name: Symbol,
5756
}
5857

@@ -148,7 +147,6 @@ impl<'a> CrateLoader<'a> {
148147
sess: sess,
149148
cstore: cstore,
150149
next_crate_num: cstore.next_crate_num(),
151-
foreign_item_map: FxHashMap(),
152150
local_crate_name: Symbol::intern(local_crate_name),
153151
}
154152
}
@@ -649,14 +647,6 @@ impl<'a> CrateLoader<'a> {
649647
items.extend(&lib.foreign_items);
650648
}
651649
}
652-
for (foreign_lib, list) in self.foreign_item_map.iter() {
653-
let kind_matches = libs.borrow().iter().any(|lib| {
654-
lib.name == &**foreign_lib && lib.kind == kind
655-
});
656-
if kind_matches {
657-
items.extend(list)
658-
}
659-
}
660650
items
661651
}
662652

@@ -943,17 +933,6 @@ impl<'a> CrateLoader<'a> {
943933
};
944934
register_native_lib(self.sess, self.cstore, Some(m.span), lib);
945935
}
946-
947-
// Finally, process the #[linked_from = "..."] attribute
948-
for m in i.attrs.iter().filter(|a| a.check_name("linked_from")) {
949-
let lib_name = match m.value_str() {
950-
Some(name) => name,
951-
None => continue,
952-
};
953-
let list = self.foreign_item_map.entry(lib_name.to_string())
954-
.or_insert(Vec::new());
955-
list.extend(fm.items.iter().map(|it| definitions.opt_def_index(it.id).unwrap()));
956-
}
957936
}
958937
}
959938

src/libsyntax/feature_gate.rs

-7
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ declare_features! (
132132

133133
(active, allocator, "1.0.0", Some(27389)),
134134
(active, fundamental, "1.0.0", Some(29635)),
135-
(active, linked_from, "1.3.0", Some(29629)),
136135
(active, main, "1.0.0", Some(29634)),
137136
(active, needs_allocator, "1.4.0", Some(27389)),
138137
(active, on_unimplemented, "1.0.0", Some(29628)),
@@ -636,12 +635,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
636635
is an experimental feature",
637636
cfg_fn!(fundamental))),
638637

639-
("linked_from", Normal, Gated(Stability::Unstable,
640-
"linked_from",
641-
"the `#[linked_from]` attribute \
642-
is an experimental feature",
643-
cfg_fn!(linked_from))),
644-
645638
("proc_macro_derive", Normal, Gated(Stability::Unstable,
646639
"proc_macro",
647640
"the `#[proc_macro_derive]` attribute \

src/test/compile-fail/feature-gate-linked-from.rs

-16
This file was deleted.

src/test/run-make/issue-15460/foo.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(linked_from)]
1211
#![crate_type = "dylib"]
1312

1413
#[link(name = "foo", kind = "static")]
15-
#[linked_from = "foo"]
1614
extern {
1715
pub fn foo();
1816
}

src/test/run-pass/auxiliary/issue-25185-1.rs

-3
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010

1111
// no-prefer-dynamic
1212

13-
#![feature(linked_from)]
14-
1513
#![crate_type = "rlib"]
1614

1715
#[link(name = "rust_test_helpers", kind = "static")]
18-
#[linked_from = "rust_test_helpers"]
1916
extern {
2017
pub fn rust_dbg_extern_identity_u32(u: u32) -> u32;
2118
}

0 commit comments

Comments
 (0)