Fix feature gate checking of static-nobundle and native_link_modifiers
This commit is contained in:
@@ -77,6 +77,15 @@ impl ItemLikeVisitor<'tcx> for Collector<'tcx> {
|
||||
modifier `-bundle` with library kind `static`",
|
||||
)
|
||||
.emit();
|
||||
if !self.tcx.features().static_nobundle {
|
||||
feature_err(
|
||||
&self.tcx.sess.parse_sess,
|
||||
sym::static_nobundle,
|
||||
item.span(),
|
||||
"kind=\"static-nobundle\" is unstable",
|
||||
)
|
||||
.emit();
|
||||
}
|
||||
NativeLibKind::Static { bundle: Some(false), whole_archive: None }
|
||||
}
|
||||
"dylib" => NativeLibKind::Dylib { as_needed: None },
|
||||
@@ -252,17 +261,6 @@ impl Collector<'tcx> {
|
||||
)
|
||||
.emit();
|
||||
}
|
||||
if matches!(lib.kind, NativeLibKind::Static { bundle: Some(false), .. })
|
||||
&& !self.tcx.features().static_nobundle
|
||||
{
|
||||
feature_err(
|
||||
&self.tcx.sess.parse_sess,
|
||||
sym::static_nobundle,
|
||||
span.unwrap_or(rustc_span::DUMMY_SP),
|
||||
"kind=\"static-nobundle\" is unstable",
|
||||
)
|
||||
.emit();
|
||||
}
|
||||
// this just unwraps lib.name; we already established that it isn't empty above.
|
||||
if let (NativeLibKind::RawDylib, Some(lib_name)) = (lib.kind, lib.name) {
|
||||
let span = match span {
|
||||
|
||||
Reference in New Issue
Block a user