Skip to content

Commit 926ac5a

Browse files
committed
rustc_metadata: Remove some extra diagnostics for legacy plugins
They are deprecated so doing extra work for error recovery doesn't make sense
1 parent de03a12 commit 926ac5a

File tree

3 files changed

+8
-37
lines changed

3 files changed

+8
-37
lines changed

src/librustc_error_codes/error_codes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ E0770: include_str!("./error_codes/E0770.md"),
554554
// E0420, merged into 532
555555
// E0421, merged into 531
556556
// E0427, merged into 530
557-
E0456, // plugin `..` is not available for triple `..`
557+
// E0456, // plugin `..` is not available for triple `..`
558558
E0457, // plugin `..` only found in rlib format, but must be available...
559559
E0460, // found possibly newer version of crate `..`
560560
E0461, // couldn't find crate `..` with expected target triple ..

src/librustc_metadata/locator.rs

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,10 +1014,6 @@ pub fn find_plugin_registrar(
10141014
name: Symbol,
10151015
) -> Option<(PathBuf, CrateDisambiguator)> {
10161016
info!("find plugin registrar `{}`", name);
1017-
let target_triple = sess.opts.target_triple.clone();
1018-
let host_triple = TargetTriple::from_triple(config::host_triple());
1019-
let is_cross = target_triple != host_triple;
1020-
let mut target_only = false;
10211017
let mut locator = CrateLocator::new(
10221018
sess,
10231019
metadata_loader,
@@ -1032,36 +1028,11 @@ pub fn find_plugin_registrar(
10321028
None, // is_proc_macro
10331029
);
10341030

1035-
let library = locator.maybe_load_library_crate().or_else(|| {
1036-
if !is_cross {
1037-
return None;
1038-
}
1039-
// Try loading from target crates. This will abort later if we
1040-
// try to load a plugin registrar function,
1041-
target_only = true;
1042-
1043-
locator.target = &sess.target.target;
1044-
locator.triple = target_triple;
1045-
locator.filesearch = sess.target_filesearch(PathKind::Crate);
1046-
1047-
locator.maybe_load_library_crate()
1048-
});
1049-
let library = match library {
1050-
Some(l) => l,
1031+
let library = match locator.maybe_load_library_crate() {
1032+
Some(library) => library,
10511033
None => locator.report_errs(),
10521034
};
10531035

1054-
if target_only {
1055-
let message = format!(
1056-
"plugin `{}` is not available for triple `{}` (only found {})",
1057-
name,
1058-
config::host_triple(),
1059-
sess.opts.target_triple
1060-
);
1061-
struct_span_err!(sess, span, E0456, "{}", &message).emit();
1062-
return None;
1063-
}
1064-
10651036
match library.source.dylib {
10661037
Some(dylib) => Some((dylib.0, library.metadata.get_root().disambiguator())),
10671038
None => {

src/tools/tidy/src/error_codes_check.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ use std::path::Path;
88

99
// A few of those error codes can't be tested but all the others can and *should* be tested!
1010
const EXEMPTED_FROM_TEST: &[&str] = &[
11-
"E0183", "E0227", "E0279", "E0280", "E0311", "E0313", "E0314", "E0315", "E0377", "E0456",
12-
"E0461", "E0462", "E0464", "E0465", "E0472", "E0473", "E0474", "E0475", "E0476", "E0479",
13-
"E0480", "E0481", "E0482", "E0483", "E0484", "E0485", "E0486", "E0487", "E0488", "E0489",
14-
"E0514", "E0519", "E0523", "E0553", "E0554", "E0570", "E0629", "E0630", "E0640", "E0717",
15-
"E0727", "E0729",
11+
"E0183", "E0227", "E0279", "E0280", "E0311", "E0313", "E0314", "E0315", "E0377", "E0461",
12+
"E0462", "E0464", "E0465", "E0472", "E0473", "E0474", "E0475", "E0476", "E0479", "E0480",
13+
"E0481", "E0482", "E0483", "E0484", "E0485", "E0486", "E0487", "E0488", "E0489", "E0514",
14+
"E0519", "E0523", "E0553", "E0554", "E0570", "E0629", "E0630", "E0640", "E0717", "E0727",
15+
"E0729",
1616
];
1717

1818
// Some error codes don't have any tests apparently...

0 commit comments

Comments
 (0)