-
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
std::format! auto-dereferences pointers? #17988
Comments
|
Seems a little surprising, especially as it's not documented. |
I don't think it's all that surprising. 99%+ of the time when I'm working with a &-reference, I care about the thing it's pointing to, not that thing's location in memory. |
Minor quibble: it is documented, the list of implementors for |
Oh I agree that having an auto-deref format is very useful, and that's what I would use most of the time, too. But do you think people would find it surprising as the default? Imagine the C programmer who writes
Then 99%+ of the time you aren't going to get what you care about with double indirection:
Regardless of where you fall on the preceeding, do you really want it to be recursive? Imagine all the poor students writing their first linked list in Rust... ;)
Would you expect a Rust newbie to look there, or std::fmt? Rust is going to be many people's first experience with pointers. Let's make it not suck. |
Given that this is intended behavior, I'm giving it a close. If you'd like to change it, please pursue an RFC, thanks! |
Fix incorrect symbol definitions in SCIP output The SCIP output incorrectly marks some symbols as definitions because it doesn't account for the file ID when comparing the token's range to its definition's range. This means that if a symbol is referenced in a file at the same position at which it is defined in another file, that reference will be marked as a definition. I was quite surprised by how common this is. For example, `PartialEq` is defined [here](https://github.com/rust-lang/rust/blob/1.80.1/library/core/src/cmp.rs#L273) and `uuid` references it [here](https://github.com/uuid-rs/uuid/blob/1.8.0/src/lib.rs#L329). And what do you know, they're both at offset 10083! In our large monorepo, this happens for basically every common stdlib type!
Is this a 'feature?'
This is with
rustc 0.13.0-nightly (adb44f53d 2014-10-12 00:07:15 +0000)
.The text was updated successfully, but these errors were encountered: