Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #10676 - djmcgill:origin/master, r=weihanglo
add validation for string "true"/"false" in lto profile ### What does this PR try to resolve? Adds a special-cased error message for when `lto` is set to the _string_ `"true"`/`"false"` which is surprisingly (I was surprised anyway) not allowed and the error message is ambiguous. The new error message makes it clear what values are accepted. Fixes #10572 ### How should we test and review this PR? <!-- Demonstrate how you test this change and guide reviewers through your PR. With a smooth review process, a pull request usually gets reviewed quicker. If you don't know how to write and run your tests, please read the guide: https://doc.crates.io/contrib/tests --> Uh I've not actually tested yet that's the WIP part. But put ``` [profile.dev] lto="false" ``` in your TOML and run `cargo build`, check that you get the new error message and that it makes sense and is helpful. ### Additional information It's worth noting that as per rust-lang/rust#97051 this doesn't fix the _real_ problem here IMO which is that [rust's `opt_parse_bool` cli parsing](https://github.com/rust-lang/rust/blob/491f619f564a4ff9ae4cc837e27bb919d04c31be/compiler/rustc_session/src/options.rs#L456) doesn't accept true/false which certainly seems an ad-hoc historical choice to me on first glance but also it's a much bigger change to change those semantics than this error message.
- Loading branch information