-
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
Document never type fallback in !
's docs
#124419
Conversation
rustbot has assigned @workingjubilee. Use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Some minor clarity-related nits. Overall looks good to me.
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
nice! @bors r+ rollup |
/// To prevent such errors, the compiler remembers where it inserted `absurd` calls, and | ||
/// if it can't infer their type, it sets the type to the fallback type: | ||
/// ```rust, ignore | ||
/// type Fallback = /* An arbitrarily selected type! */; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Arbitrarily selected" here sounds like "the compiler picks from some set", not "we made a choice and taught it to the compiler". I'm not sure what would be better, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's nothing stopping us from having arbitrarily complicated fallback logic, aside from a reluctance to implement anything more complex, which is why I suggested it that way.
We do pick from a set.
The set has one member. :^)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hoping to grow the set to two :p
I'm also not a fan of "arbitrary" here because we did purposefully choose the fallback type...
But I'm not sure how to phrase this properly :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever I use arbitrary I strongly mean the "the reason for why is because I said so", because often there were multiple reasonable choices we could have made, but we could only make one (one set, with any number of members).
Co-authored-by: Kevin Reid <kpreid@switchb.org> Co-authored-by: Herman Skogseth <herman.skogseth@me.com> Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
Thanks to everyone who participated in the discussions and suggested improvements to the documentation! <3 @bors r=workingjubilee |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (80451a4): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 675.937s -> 674.735s (-0.18%) |
Pulled the documentation I've written for #123939.
I want a single place where never type fallback is explained, which can be referred in all the lints and migration materials.