Skip to content
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

negate_unsigned feature gate triggered for user-defined Neg #26840

Closed
eefriedman opened this issue Jul 6, 2015 · 0 comments · Fixed by #27026
Closed

negate_unsigned feature gate triggered for user-defined Neg #26840

eefriedman opened this issue Jul 6, 2015 · 0 comments · Fixed by #27026
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@eefriedman
Copy link
Contributor

struct S;
impl std::ops::Neg for S {
    type Output = u32;
    fn neg(self) -> u32 { 0 }
}
fn main() { -S; }
<anon>:6:13: 6:15 error: unary negation of unsigned integers may be removed in the future
<anon>:6 fn main() { -S; }
                     ^~
@sfackler sfackler added A-diagnostics Area: Messages for errors, warnings, and lints A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. and removed A-diagnostics Area: Messages for errors, warnings, and lints A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. labels Jul 7, 2015
bors added a commit that referenced this issue Jul 20, 2015
This commit fixes the negate_unsigned feature gate to appropriately
account for inferred variables.

This is technically a [breaking-change], but I’d consider it a bug fix.

cc @brson for your relnotes.

Fixes #24676
Fixes #26840 
Fixes #25206
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants