Target modifiers fix for bool flags without value#138483
Target modifiers fix for bool flags without value#138483bors merged 1 commit intorust-lang:masterfrom
Conversation
|
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
This comment has been minimized.
This comment has been minimized.
908d92f to
080cbc2
Compare
| | ^ | ||
| | | ||
| = help: the `-Zreg-struct-return` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely | ||
| = note: `-Zreg-struct-return unset` in this crate is incompatible with `-Zreg-struct-return=true` in dependency `enabled_reg_struct_return` |
There was a problem hiding this comment.
This doesn't seem correct (unset in the backticks?), plus the string is untranslatable. I'd suggest adding a variant to the strings that explicitly says "unset" and use that
There was a problem hiding this comment.
Added messages for cases when current crate has unset flag and when external crate has unset flag.
| { | ||
| target_modifiers.insert(tmod, value.to_string()); | ||
| if let Some(tmod) = *tmod { | ||
| let v = if let Some(v) = value { v.to_string() } else { String::new() }; |
There was a problem hiding this comment.
would value.map_or_default(ToOwned::to_owned) work here?
There was a problem hiding this comment.
Changed to map_or(...), looks like map_or_default is not yet merged for Option.
| = note: `-Zreg-struct-return=true` in this crate is incompatible with `-Zreg-struct-return=` in dependency `default_reg_struct_return` | ||
| = help: set `-Zreg-struct-return=` in this crate or `-Zreg-struct-return=true` in `default_reg_struct_return` | ||
| = note: `-Zreg-struct-return=true` in this crate is incompatible with `-Zreg-struct-return unset` in dependency `default_reg_struct_return` | ||
| = help: set `-Zreg-struct-return unset` in this crate or `-Zreg-struct-return=true` in `default_reg_struct_return` |
There was a problem hiding this comment.
this diagnostic is poor. it should be something like
| = help: set `-Zreg-struct-return unset` in this crate or `-Zreg-struct-return=true` in `default_reg_struct_return` | |
| = help: unset `-Zreg-struct-return` in this crate or set `-Zreg-struct-return=true` in `default_reg_struct_return` |
080cbc2 to
6ccaea1
Compare
|
@rustbot review |
|
@bors r+ |
|
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
Rollup of 7 pull requests Successful merges: - rust-lang#138483 (Target modifiers fix for bool flags without value) - rust-lang#138818 (Don't produce debug information for compiler-introduced-vars when desugaring assignments.) - rust-lang#138898 (Mostly parser: Eliminate code that's been dead / semi-dead since the removal of type ascription syntax) - rust-lang#138930 (Add bootstrap step diff to CI job analysis) - rust-lang#138954 (Ensure `define_opaque` attrs are accounted for in HIR hash) - rust-lang#138959 (Revert "Make MatchPairTree::place non-optional") - rust-lang#138967 (Fix typo in error message) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#138483 - azhogin:azhogin/target-modifiers-bool-fix, r=fee1-dead Target modifiers fix for bool flags without value Fixed support of boolean flags without values: `-Zbool-flag` is now consistent with `-Zbool-flag=true` in another crate. When flag is explicitly set to default value, target modifier will not be set in crate metainfo (`-Zflag=false` when `false` is a default value for the flag). Improved error notification when target modifier flag is absent in a crate ("-Zflag unset"). Example: ``` note: `-Zreg-struct-return=true` in this crate is incompatible with unset `-Zreg-struct-return` in dependency `default_reg_struct_return` ```
…modificators, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…dificators, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…modificators, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…modificators, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…modificators, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: #138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: #138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: #138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: #138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: #138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: #138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: #138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang/rust#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang/rust#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang/rust#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang/rust#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…dificators, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…dificators, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang/rust#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang/rust#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang/rust#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
…s, r=rcvalle Sanitizers target modificators Depends on bool flag fix: rust-lang/rust#138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
Fixed support of boolean flags without values:
-Zbool-flagis now consistent with-Zbool-flag=truein another crate.When flag is explicitly set to default value, target modifier will not be set in crate metainfo (
-Zflag=falsewhenfalseis a default value for the flag).Improved error notification when target modifier flag is absent in a crate ("-Zflag unset").
Example: