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

Point at the call span when overflow occurs during monomorphization #73601

Merged
merged 1 commit into from
Jun 24, 2020

Conversation

Aaron1011
Copy link
Member

This improves the output for issue #72577, but there's still more work
to be done.

Currently, an overflow error during monomorphization results in an error
that points at the function we were unable to monomorphize. However, we
don't point at the call that caused the monomorphization to happen. In
the overflow occurs in a large recursive function, it may be difficult
to determine where the issue is.

This commit tracks and Span information during collection of
MonoItems, which is used when emitting an overflow error. MonoItem
itself is unchanged, so this only affects
src/librustc_mir/monomorphize/collector.rs

@rust-highfive
Copy link
Collaborator

r? @ecstatic-morse

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 22, 2020
@ecstatic-morse ecstatic-morse changed the title Point at the call spawn when overflow occurs during monomorphization Point at the call span when overflow occurs during monomorphization Jun 22, 2020
Copy link
Contributor

@ecstatic-morse ecstatic-morse 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 with nits addressed.

src/librustc_mir/monomorphize/collector.rs Outdated Show resolved Hide resolved
src/librustc_mir/monomorphize/collector.rs Outdated Show resolved Hide resolved
This improves the output for issue rust-lang#72577, but there's still more work
to be done.

Currently, an overflow error during monomorphization results in an error
that points at the function we were unable to monomorphize. However, we
don't point at the call that caused the monomorphization to happen. In
the overflow occurs in a large recursive function, it may be difficult
to determine where the issue is.

This commit tracks and `Span` information during collection of
`MonoItem`s, which is used when emitting an overflow error. `MonoItem`
itself is unchanged, so this only affects
`src/librustc_mir/monomorphize/collector.rs`
@Aaron1011 Aaron1011 force-pushed the fix/better-mono-overflow-err branch from 3441b72 to 3ed96a6 Compare June 22, 2020 18:35
@Aaron1011
Copy link
Member Author

@ecstatic-morse: Updated. I went with Spanned<MonoItem<'tcx>> everwhere, since a type alias didn't seem worth it.

@ecstatic-morse
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jun 23, 2020

📌 Commit 3ed96a6 has been approved by ecstatic-morse

@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 Jun 23, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 23, 2020
…err, r=ecstatic-morse

Point at the call span when overflow occurs during monomorphization

This improves the output for issue rust-lang#72577, but there's still more work
to be done.

Currently, an overflow error during monomorphization results in an error
that points at the function we were unable to monomorphize. However, we
don't point at the call that caused the monomorphization to happen. In
the overflow occurs in a large recursive function, it may be difficult
to determine where the issue is.

This commit tracks and `Span` information during collection of
`MonoItem`s, which is used when emitting an overflow error. `MonoItem`
itself is unchanged, so this only affects
`src/librustc_mir/monomorphize/collector.rs`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 23, 2020
…arth

Rollup of 11 pull requests

Successful merges:

 - rust-lang#72780 (Enforce doc alias check)
 - rust-lang#72876 (Mention that BTreeMap::new() doesn't allocate)
 - rust-lang#73244 (Check for assignments between non-conflicting generator saved locals)
 - rust-lang#73488 (code coverage foundation for hash and num_counters)
 - rust-lang#73523 (Fix -Z unpretty=everybody_loops)
 - rust-lang#73587 (Move remaining `NodeId` APIs from `Definitions` to `Resolver`)
 - rust-lang#73601 (Point at the call span when overflow occurs during monomorphization)
 - rust-lang#73613 (The const propagator cannot trace references.)
 - rust-lang#73614 (fix `intrinsics::needs_drop` docs)
 - rust-lang#73630 (Provide context on E0308 involving fn items)
 - rust-lang#73665 (rustc: Modernize wasm checks for atomics)

Failed merges:

r? @ghost
@bors bors merged commit 30fba22 into rust-lang:master Jun 24, 2020
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants