Skip to content
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

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

chenyukang
Copy link
Member

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.

@rustbot
Copy link
Collaborator

rustbot commented Sep 4, 2023

r? @wesleywiser

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 4, 2023
Copy link
Member

@compiler-errors compiler-errors left a 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")
Copy link
Member

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?

Suggested change
format!("the size of `{src}` is overflow")
format!("values of the type `{src}` are too big for the current architecture")

Same for dst.

@chenyukang chenyukang force-pushed the yukang-fix-115402-overflowsize branch from 559a4a0 to 00010ed Compare September 5, 2023 22:48
@chenyukang
Copy link
Member Author

@bors r=compiler-errors

@bors
Copy link
Collaborator

bors commented Sep 5, 2023

📌 Commit 00010ed has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 5, 2023
@bors
Copy link
Collaborator

bors commented Sep 6, 2023

⌛ Testing commit 00010ed with merge aeddd2d...

@bors
Copy link
Collaborator

bors commented Sep 6, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing aeddd2d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 6, 2023
@bors bors merged commit aeddd2d into rust-lang:master Sep 6, 2023
@rustbot rustbot added this to the 1.74.0 milestone Sep 6, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (aeddd2d): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This 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.

mean range count
Regressions ❌
(primary)
0.5% [0.5%, 0.5%] 1
Regressions ❌
(secondary)
2.1% [1.4%, 3.0%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [0.5%, 0.5%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 628.843s -> 628.436s (-0.06%)
Artifact size: 316.24 MiB -> 316.30 MiB (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: not implemented: SizeOverflow([u8; usize::MAX])
6 participants