-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Target modifiers (special marked options) are recorded in metainfo #133138
base: master
Are you sure you want to change the base?
Conversation
r? @davidtwco rustbot has assigned @davidtwco. Use |
This comment has been minimized.
This comment has been minimized.
d99ff62
to
bd52a23
Compare
This comment has been minimized.
This comment has been minimized.
bd52a23
to
500600b
Compare
This comment has been minimized.
This comment has been minimized.
db91299
to
43e5956
Compare
This comment has been minimized.
This comment has been minimized.
43e5956
to
6793451
Compare
95f9595
to
9cd86c3
Compare
@rustbot ready |
9cd86c3
to
97a8240
Compare
This comment has been minimized.
This comment has been minimized.
97a8240
to
8603b2b
Compare
8603b2b
to
95ffdf8
Compare
This comment was marked as resolved.
This comment was marked as resolved.
90452da
to
c8d56d3
Compare
|
||
if tcx.crate_types().contains(&CrateType::ProcMacro) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we ignoring target modifier compatibility when we ourself are a proc macro rather than ignoring target modifiers just for dependencies that are proc macros?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, both dependency proc macro and main proc macro are ignored for target modifiers.
As far as I understand, proc macro crate will not ever be executed during runtime. It is executed only during compilation, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the current crate is a proc macro and has a dependency on a non-proc-macro crate, then those are linked together and the target modifiers do need to match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
c8d56d3
to
a3a4327
Compare
@bors r=davidtwco,saethlin |
@bors rollup=iffy |
…davidtwco,saethlin Target modifiers (special marked options) are recorded in metainfo Target modifiers (special marked options) are recorded in metainfo and compared to be equal in different linked crates. PR for this RFC: rust-lang/rfcs#3716 Option may be marked as `TARGET_MODIFIER`, example: `regparm: Option<u32> = (None, parse_opt_number, [TRACKED TARGET_MODIFIER]`. If an TARGET_MODIFIER-marked option has non-default value, it will be recorded in crate metainfo as a `Vec<TargetModifier>`: ``` pub struct TargetModifier { pub opt: OptionsTargetModifiers, pub value_name: String, } ``` OptionsTargetModifiers is a macro-generated enum. Option value code (for comparison) is generated using `Debug` trait. Error example: ``` error: mixing `-Zregparm` will cause an ABI mismatch in crate `incompatible_regparm` --> $DIR/incompatible_regparm.rs:10:1 | LL | #![crate_type = "lib"] | ^ | = help: the `-Zregparm` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely = note: `-Zregparm=1` in this crate is incompatible with `-Zregparm=2` in dependency `wrong_regparm` = help: set `-Zregparm=2` in this crate or `-Zregparm=1` in `wrong_regparm` = help: if you are sure this will not cause problems, use `-Cunsafe-allow-abi-mismatch=regparm` to silence this error error: aborting due to 1 previous error ``` `-Cunsafe-allow-abi-mismatch=regparm,reg-struct-return` to disable list of flags.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
I have no idea how to fix those apple build problems. May I use "only-x86" in tests to avoid this problem?
|
Yes, so long as you also comment alongside that directive that
|
…d compared to be equal in different crates
a3a4327
to
e3aa87a
Compare
@bors r=davidtwco,saethlin |
…davidtwco,saethlin Target modifiers (special marked options) are recorded in metainfo Target modifiers (special marked options) are recorded in metainfo and compared to be equal in different linked crates. PR for this RFC: rust-lang/rfcs#3716 Option may be marked as `TARGET_MODIFIER`, example: `regparm: Option<u32> = (None, parse_opt_number, [TRACKED TARGET_MODIFIER]`. If an TARGET_MODIFIER-marked option has non-default value, it will be recorded in crate metainfo as a `Vec<TargetModifier>`: ``` pub struct TargetModifier { pub opt: OptionsTargetModifiers, pub value_name: String, } ``` OptionsTargetModifiers is a macro-generated enum. Option value code (for comparison) is generated using `Debug` trait. Error example: ``` error: mixing `-Zregparm` will cause an ABI mismatch in crate `incompatible_regparm` --> $DIR/incompatible_regparm.rs:10:1 | LL | #![crate_type = "lib"] | ^ | = help: the `-Zregparm` flag modifies the ABI so Rust crates compiled with different values of this flag cannot be used together safely = note: `-Zregparm=1` in this crate is incompatible with `-Zregparm=2` in dependency `wrong_regparm` = help: set `-Zregparm=2` in this crate or `-Zregparm=1` in `wrong_regparm` = help: if you are sure this will not cause problems, use `-Cunsafe-allow-abi-mismatch=regparm` to silence this error error: aborting due to 1 previous error ``` `-Cunsafe-allow-abi-mismatch=regparm,reg-struct-return` to disable list of flags.
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
Target modifiers (special marked options) are recorded in metainfo and compared to be equal in different linked crates.
PR for this RFC: rust-lang/rfcs#3716
Option may be marked as
TARGET_MODIFIER
, example:regparm: Option<u32> = (None, parse_opt_number, [TRACKED TARGET_MODIFIER]
.If an TARGET_MODIFIER-marked option has non-default value, it will be recorded in crate metainfo as a
Vec<TargetModifier>
:OptionsTargetModifiers is a macro-generated enum.
Option value code (for comparison) is generated using
Debug
trait.Error example:
-Cunsafe-allow-abi-mismatch=regparm,reg-struct-return
to disable list of flags.