mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 13:06:28 +03:00
7ab3168371
Allow forbidden target features to be hard errors Sometimes when adding a new target features to the list of known target features, we want to completely forbid them from being used because they are ABI affecting and should be target modifiers instead. As such, we want to issue an error rather than a warning since there are no future compatibility concerns . r? @workingjubilee since you're familiar with the motivating case in rust-lang/rust#136597 If I rebase that PR on top of this locally, then we get the following error messages when trying to activate the SLS target feature (note that they are *errors* not *warnings* and we've omitted the usual note about future compatibility): ``` error: target feature `harden-sls-ijmp` cannot be enabled with `-Ctarget-feature`: use `harden-sls` compiler flag instead error: target feature `harden-sls-ret` cannot be enabled with `-Ctarget-feature`: use `harden-sls` compiler flag instead error: aborting due to 2 previous errors ```
rustc_target contains some very low-level details that are
specific to different compilation targets and so forth.
For more information about how rustc works, see the rustc dev guide.