-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Effective breakage to jiff
due to ambiguous_negative_literals
#128287
Comments
jiff
due to ambiguous_negative_literals
jiff
due to ambiguous_negative_literals
This lint indeed assumes the operations are ordering-sensitive. Like |
The partially-uplifted Clippy
|
If it's decided that it's not worth linting on these cases, I would propose using the Something like As for my rational of being opt-out instead of opt-in, I think it will avoid discrepancy in the coverage as (the wast majority) of users won't know to annotate the functions that are sensitive to negative literals, which is the point of the lint, bring awareness to this surprising aspect of Rust. |
We discussed this in our lang triage call today. @Urgau: If you would, we'd like this lint changed to |
… r=compiler-errors Temporarily switch `ambiguous_negative_literals` lint to allow This PR temporarily switch the `ambiguous_negative_literals` lint to `allow-by-default`, as asked by T-lang in rust-lang#128287 (comment).
… r=compiler-errors Temporarily switch `ambiguous_negative_literals` lint to allow This PR temporarily switch the `ambiguous_negative_literals` lint to `allow-by-default`, as asked by T-lang in rust-lang#128287 (comment).
Rollup merge of rust-lang#128449 - Urgau:tmp-allow-negative-lit-lint, r=compiler-errors Temporarily switch `ambiguous_negative_literals` lint to allow This PR temporarily switch the `ambiguous_negative_literals` lint to `allow-by-default`, as asked by T-lang in rust-lang#128287 (comment).
As asked the lint was changed to |
In favor of a global one. But also, while these aren't technically needed any more[1,2], we leave them be for now while things settle. [1]: rust-lang/rust#128449 [2]: rust-lang/rust#128287
@BurntSushi: What do you think of the proposal that @Urgau makes here, as it applies to I'd also be interested to hear your thoughts on the question of whether something like this should be opt-in or opt-out. |
@traviscross I love @Urgau's idea. Will it be possible to use that annotation on older Rust compilers where it will just be ignored? Otherwise it would be hard for me to use it until my MSRV matches the Rust release where the annotation becomes available. (Or do a build script with conditional compilation.) In terms of opt-in or opt-out, I agree that opt-out makes the most sense. Otherwise I think this lint would probably not be nearly as effective. |
Using an attribute from the diagnostic namespace -- even an unknown one -- will bump your MSRV to 1.78, when the diagnostic namespace was stabilized. Before that you'll get resolver errors that afaict you cannot suppress. |
@compiler-errors I think that should be fine. Probably by the time everything lands on stable, I'll soon thereafter be able to bump my MSRV to 1.78. Worst case, I'll bite the bullet and do version sniffing in |
Yep, and 1.78 should be the MSRV for all future tricks of this same sort. |
We should discuss this bit of evidence that came in after the FCP completed on:
@BurntSushi said:
cc @BurntSushi @rust-lang/lang
@rustbot labels +T-lang +I-lang-nominated
The text was updated successfully, but these errors were encountered: