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 counting #62055

Merged
merged 2 commits into from
Jun 25, 2019
Merged

Fix error counting #62055

merged 2 commits into from
Jun 25, 2019

Conversation

matthewjasper
Copy link
Contributor

Count duplicate errors for track_errors and other error counting checks.
Add FIXMEs to make it clear that we should be moving away from this kind of logic.

Closes #61663

@pnkfelix
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 24, 2019

📌 Commit 95a3215 has been approved by pnkfelix

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 24, 2019
@pnkfelix
Copy link
Member

nominating for beta backport since it fixes an ICE that is a stable-to-beta regression.

@pnkfelix pnkfelix added beta-nominated Nominated for backporting to the compiler in the beta channel. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 24, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 24, 2019
…=pnkfelix

Fix error counting

Count duplicate errors for `track_errors` and other error counting checks.
Add FIXMEs to make it clear that we should be moving away from this kind of logic.

Closes rust-lang#61663
Centril added a commit to Centril/rust that referenced this pull request Jun 25, 2019
…=pnkfelix

Fix error counting

Count duplicate errors for `track_errors` and other error counting checks.
Add FIXMEs to make it clear that we should be moving away from this kind of logic.

Closes rust-lang#61663
bors added a commit that referenced this pull request Jun 25, 2019
Rollup of 7 pull requests

Successful merges:

 - #61814 (Fix an ICE with uninhabited consts)
 - #61987 (rustc: produce AST instead of HIR from `hir::lowering::Resolver` methods.)
 - #62055 (Fix error counting)
 - #62078 (Remove built-in derive macros `Send` and `Sync`)
 - #62085 (Add test for issue-38591)
 - #62091 (HirIdification: almost there)
 - #62096 (Implement From<Local> for Place and PlaceBase)

Failed merges:

r? @ghost
@bors bors merged commit 95a3215 into rust-lang:master Jun 25, 2019
@Mark-Simulacrum
Copy link
Member

@rust-lang/compiler We need to get beta backports approved a little earlier this cycle as we're promoting beta->stable on Saturday. If we could get an FCP going for beta-accepted on this PR that'd be great; or if someone wants to unilaterally beta accept that works too.

@pnkfelix
Copy link
Member

I'm going to un-nominate this.

The ICEs it resolves do not seem like a critical issue to me: As far as I can tell, the only say these ICEs ever arise is after some legitimate error diagnostic has already been emitted, and we just failed to halt the compilation as soon as we should have. But the compilation should always halt, potentially via an ICE, without generating object code.

@matthewjasper does that sound correct to you? Or is there a scenario where this could somehow generate an error diagnostic, but then end up not having any ICE and end up emitting potentially erroneous object code?

@pnkfelix pnkfelix removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jun 26, 2019
@@ -4376,7 +4376,7 @@ pub fn check_bounds_are_used<'tcx>(tcx: TyCtxt<'tcx>, generics: &ty::Generics, t
} else if let ty::Error = leaf_ty.sty {
// If there is already another error, do not emit
// an error for not using a type Parameter.
assert!(tcx.sess.err_count() > 0);
assert!(tcx.sess.has_errors());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code like this should probably be using delay_span_bug uniformly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer an EmittedError type only created by emitting errors and putting that in ty::Error instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's even nicer - we might want to use that in the AST and HIR as well.

But maybe it should be something less temporarily ordered, so if there is some place where ty::Error needs to be created but it's not the same place the errors is to be reported from, we can still create a proof that "some error has happened or will happen" with delay_span_bug.

@matthewjasper matthewjasper deleted the fix-error-counting branch July 29, 2019 19:53
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. 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.

Panic with Layout mismatch when copying! from macro
6 participants