Derive Eq, Ord, Hash for MaybeDangling#154905
Derive Eq, Ord, Hash for MaybeDangling#154905Jules-Bertholet wants to merge 1 commit intorust-lang:mainfrom
Eq, Ord, Hash for MaybeDangling#154905Conversation
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
|
|
Then why does it implement |
|
|
|
Could we do |
Then there should be a manual |
|
Anyway, did T-lang or T-libs-api ever discuss or agree to the "not make it easy to accidentally use a dangling reference" rationale? |
|
The RFC just says:
So it seems this was left as an open question. (Edit) See also the lang FCP comment:
|
|
I've added an unresolved question to the tracking issue. |
2603969 to
6b98ad1
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
6b98ad1 to
8e55fa0
Compare
|
Is the PR description outdated? Both the fixes issue and alternative PRs are closed/merged, but presumably you still want this? r=me with that fixed up |
|
I think this is blocked on T-libs-api (or maaaybe T-lang) decision about which traits should be implemented for |
|
I don't have a strong opinion either way - it feels a bit dubious to skip the implementations when we have safe method accessors. If we had deref it would be even weirder IMO, but we don't have that at least. I think in general we don't have a good way of surfacing "safe but be careful" in the language today, and I'm not sure what that would look like either :) It seems relatively unlikely we'll get significant usage reports either way - too easy to workaround not having the impls, and hard to check if people are actually making use of the pause of not having them to reason through if what they're doing is a good idea. |
|
FWIW, I don't have a strong opinion either. My assumption was that, in the absence of strong motivation to the contrary, the precedent of |
Fixes #154890
Alternative to #154891
Tracking issue: #118166