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

rustc: Improve errors on private static methods #13647

Merged
merged 1 commit into from
Apr 21, 2014

Conversation

alexcrichton
Copy link
Member

This gives a better NOTE error message when a privacy error is encountered with
a static method. Previously no note was emitted (due to lack of support), but
now a note is emitted indicating that the struct/enum itself is private.

Closes #13641

This gives a better NOTE error message when a privacy error is encountered with
a static method. Previously no note was emitted (due to lack of support), but
now a note is emitted indicating that the struct/enum itself is private.

Closes rust-lang#13641
bors added a commit that referenced this pull request Apr 20, 2014
This gives a better NOTE error message when a privacy error is encountered with
a static method. Previously no note was emitted (due to lack of support), but
now a note is emitted indicating that the struct/enum itself is private.

Closes #13641
@bors bors closed this Apr 21, 2014
@bors bors merged commit c33cedf into rust-lang:master Apr 21, 2014
@alexcrichton alexcrichton deleted the issue-13641 branch April 21, 2014 16:40
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 9, 2023
…ykril

fix: tuple to named struct inside macros

seems to fix rust-lang#13634
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 14, 2024
The `identity_op` lint was suggesting code fixes that resulted in
incorrect or broken code, due to missing parenthesis in the fix that
changed the semantics of the code.

For a binary expression, `left op right`, if the `left` was redundant,
it would check if the right side needed parenthesis, but if the `right`
was redundant, it would just assume that the left side did not need
parenthesis.

This can result in rustfix generating broken code and failing, or
generating code that has different behavior than before the fix. e.g.
`-(x + y + 0)` would turn into `-x + y`, changing the behavior, and
`1u64 + (x + y + 0i32) as u64` where `x: i32` and `y: i32` would turn
into `1u64 + x + y as u64`, creating an error where `x` cannot be added
to the other values, as it was never cast to `u64`.

This commit fixes both of these problems by always checking the
non-redundant child of a binary expression for needed parenthesis.

fixes rust-lang#13470

changelog: [`identity_op`]: Fix suggested code that is broken or has
changed behavior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

privacy: error messages could do better at telling me why something is private
3 participants