1
Fork 0

Fix feature gate checking of static-nobundle and native_link_modifiers

This commit is contained in:
12101111 2021-08-06 21:51:59 +08:00
parent 2b4196e977
commit d935a14f4c
No known key found for this signature in database
GPG key ID: 97785FADF38A97DC
8 changed files with 75 additions and 43 deletions

View file

@ -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 {