-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Implement #[deriving(Show)] #12066
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
Merged
Merged
Implement #[deriving(Show)] #12066
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is amazing, really. Thanks! |
(Addressed comments; can squash and rebase post-review.) |
looks great! r=me with squashings |
Poly and String have polymorphic `impl`s and so require different method names.
bors
added a commit
that referenced
this pull request
Feb 8, 2014
- Convert the formatting traits to `&self` rather than `_: &Self` - Rejig `syntax::ext::{format,deriving}` a little in preparation - Implement `#[deriving(Show)]`
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Jan 11, 2024
Don't look for safety comments in doc tests Fixes rust-lang#12048. What happened in the linked issue is that the lint checks for lines that start with `//` and have `SAFETY:` somewhere in it above the function item. This works for regular comments, but when the `//` is the start of a doc comment (e.g. `/// // SAFETY: ...`) and it's part of a doc test (i.e. within \`\`\`), we probably shouldn't lint that, since the user most likely meant to refer to a different node than the one currently being checked. For example in the linked issue, the safety comment refers to `unsafe { *five_pointer }`, but the lint believes it's part of the function item. We also can't really easily test whether the `// SAFETY:` comment within a doc comment is necessary or not, since I think that would require creating a new compiler session to re-parse the contents of the doc comment. We already do this for one of the doc markdown lints, to look for a main function in doc tests, but I don't know how to feel about doing that in more places, so probably best to just ignore them? changelog: [`unnecessary_safety_comment`]: don't look for safety comments in doc tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
&self
rather than_: &Self
syntax::ext::{format,deriving}
a little in preparation#[deriving(Show)]