1
Fork 0

Rollup merge of #104137 - StackDoubleFlow:err-lsc-unsupported, r=bjorn3

Issue error when -C link-self-contained option is used on unsupported platforms

The documentation was also updated to reflect this.

I'm assuming the supported platforms are the same as initially written in [RELEASES.md](https://github.com/rust-lang/rust/blob/master/RELEASES.md#compiler-17).

Fixes #103576
This commit is contained in:
Matthias Krüger 2022-11-16 15:39:45 +01:00 committed by GitHub
commit fbcd751ea1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 7 deletions

View file

@ -1588,6 +1588,9 @@ fn detect_self_contained_mingw(sess: &Session) -> bool {
/// We only provide such support for a very limited number of targets.
fn self_contained(sess: &Session, crate_type: CrateType) -> bool {
if let Some(self_contained) = sess.opts.cg.link_self_contained {
if sess.target.link_self_contained == LinkSelfContainedDefault::False {
sess.emit_err(errors::UnsupportedLinkSelfContained);
}
return self_contained;
}

View file

@ -530,3 +530,7 @@ pub enum AppleSdkRootError<'a> {
pub struct ReadFileError {
pub message: std::io::Error,
}
#[derive(Diagnostic)]
#[diag(codegen_ssa_unsupported_link_self_contained)]
pub struct UnsupportedLinkSelfContained;