Rollup merge of #57650 - AB1908:master, r=petrochenkov
librustc_metadata: Pass a default value when unwrapping a span Fixes #57323. When compiling with `static-nobundle` a-la `rustc -l static-nobundle=nonexistent main.rs` we now get a neat output in the form of: ``` error[E0658]: kind="static-nobundle" is feature gated (see issue #37403) | = help: add #![feature(static_nobundle)] to the crate attributes to enable error: aborting due to previous error For more information about this error, try `rustc --explain E0658`. ``` The build and tests completed successfully on my machine. Should I be adding a new test?
This commit is contained in:
commit
d2300afd66
3 changed files with 14 additions and 1 deletions
|
|
@ -163,7 +163,7 @@ impl<'a, 'tcx> Collector<'a, 'tcx> {
|
|||
!self.tcx.features().static_nobundle {
|
||||
feature_gate::emit_feature_err(&self.tcx.sess.parse_sess,
|
||||
"static_nobundle",
|
||||
span.unwrap(),
|
||||
span.unwrap_or_else(|| syntax_pos::DUMMY_SP),
|
||||
GateIssue::Language,
|
||||
"kind=\"static-nobundle\" is feature gated");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
//~ ERROR kind="static-nobundle" is feature gated
|
||||
// Test the behavior of rustc when non-existent library is statically linked
|
||||
|
||||
// compile-flags: -l static-nobundle=nonexistent
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
error[E0658]: kind="static-nobundle" is feature gated (see issue #37403)
|
||||
|
|
||||
= help: add #![feature(static_nobundle)] to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue