-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Fix error report for size overflow from transmute #115529
Fix error report for size overflow from transmute #115529
Conversation
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
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.
r=me after fixing wording
@@ -2920,6 +2920,12 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> { | |||
rustc_transmute::Reason::DstIsTooBig => { | |||
format!("The size of `{src}` is smaller than the size of `{dst}`") | |||
} | |||
rustc_transmute::Reason::SrcSizeOverflow => { | |||
format!("the size of `{src}` is overflow") |
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.
Can you make this more like LayoutError::SizeOverflow
?
format!("the size of `{src}` is overflow") | |
format!("values of the type `{src}` are too big for the current architecture") |
Same for dst.
559a4a0
to
00010ed
Compare
@bors r=compiler-errors |
☀️ Test successful - checks-actions |
Finished benchmarking commit (aeddd2d): 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: 628.843s -> 628.436s (-0.06%) |
Fixes #115402
The span in the error reporting always points to the
dst
, this is an old issue, I may open another PR to fix it.