Don't allow both the +bundle and +whole-archive modifiers for rlibs

This commit is contained in:
Wesley Wiser 2021-08-20 16:25:39 -04:00 committed by Michael Woerister
parent 522f9757f6
commit 846c372f86
5 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,12 @@
// compile-flags: -Zunstable-options --crate-type rlib
// build-fail
// error-pattern: the linking modifiers `+bundle` and `+whole-archive` are not compatible with each other when generating rlibs
#![feature(native_link_modifiers)]
#![feature(native_link_modifiers_bundle)]
#![feature(native_link_modifiers_whole_archive)]
#[link(name = "mylib", kind = "static", modifiers = "+bundle,+whole-archive")]
extern "C" { }
fn main() { }

View file

@ -0,0 +1,6 @@
error: the linking modifiers `+bundle` and `+whole-archive` are not compatible with each other when generating rlibs
error: could not find native static library `mylib`, perhaps an -L flag is missing?
error: aborting due to 2 previous errors

View file

@ -0,0 +1,7 @@
// Mixing +bundle and +whole-archive is not allowed
// compile-flags: -l static:+bundle,+whole-archive=mylib -Zunstable-options --crate-type rlib
// build-fail
// error-pattern: the linking modifiers `+bundle` and `+whole-archive` are not compatible with each other when generating rlibs
fn main() { }

View file

@ -0,0 +1,6 @@
error: the linking modifiers `+bundle` and `+whole-archive` are not compatible with each other when generating rlibs
error: could not find native static library `mylib`, perhaps an -L flag is missing?
error: aborting due to 2 previous errors