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

Use ErrorGuaranteed::unchecked_claim_error_was_emitted less #104554

Merged
merged 7 commits into from
Nov 19, 2022

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Nov 17, 2022

there are only like 3 or 4 call sites left after this but it wasnt obvious to me how to remove them

@rustbot
Copy link
Collaborator

rustbot commented Nov 17, 2022

r? @TaKO8Ki

(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 Nov 17, 2022
@compiler-errors
Copy link
Member

r? @compiler-errors

@rustbot rustbot assigned compiler-errors and unassigned TaKO8Ki Nov 17, 2022
Copy link
Member

@eddyb eddyb left a comment

Choose a reason for hiding this comment

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

Thanks a lot! This is very nice, just had some nitpicking (and a potentially scary pre-existing incremental unsoundness?).

compiler/rustc_infer/src/infer/mod.rs Outdated Show resolved Hide resolved
@@ -1218,9 +1218,13 @@ impl<'tcx> InferCtxt<'tcx> {
);

if self.tcx.sess.err_count() > self.err_count_on_creation {
Copy link
Member

Choose a reason for hiding this comment

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

Oh dear, this is causally flawed... nowadays we can have multiple InferCtxts alive at the same time (for different query instances on the stack, that depend on eachother).

The delay_span_bug should never cause an issue here but... err_count_on_creation could cause incremental unsoundness due to errors produced elsewhere in the system.

At the very least this kind of thing needs far more clever logic to save/restore counts/deltas when entering/exiting InferCtxts and I'm not even sure it's worth it... (cc @jackh726 @nikomatsakis).

Copy link
Contributor

Choose a reason for hiding this comment

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

i thought we don't cache anything on disc if there are any errors during this compilation session? 🤔

compiler/rustc_infer/src/infer/mod.rs Outdated Show resolved Hide resolved
@compiler-errors
Copy link
Member

r? @eddyb 😸

@rustbot rustbot assigned eddyb and unassigned compiler-errors Nov 17, 2022
@BoxyUwU BoxyUwU force-pushed the less_unchecked_pls branch 2 times, most recently from 0b9224f to 5db72a4 Compare November 17, 2022 22:43
@@ -1,4 +1,3 @@
// compile-flags:-Ztreat-err-as-bug=5
Copy link
Member Author

Choose a reason for hiding this comment

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

I uh ???? :(

@BoxyUwU BoxyUwU force-pushed the less_unchecked_pls branch 2 times, most recently from 714fb1e to df3625f Compare November 18, 2022 11:57
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

nits, then r=me

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs Outdated Show resolved Hide resolved
compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs Outdated Show resolved Hide resolved
@lcnr
Copy link
Contributor

lcnr commented Nov 18, 2022

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 18, 2022

📌 Commit 72d1c77025b949548207dd264b6b95e3ae6ed071 has been approved by lcnr

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 Nov 18, 2022
@lcnr
Copy link
Contributor

lcnr commented Nov 18, 2022

@bors r- waiting for ci

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 18, 2022
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Nov 18, 2022

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Nov 18, 2022

📌 Commit d80a9a2f887fcdc50d46589ce10a128e8ef1c8db has been approved by lcnr

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 18, 2022
@BoxyUwU BoxyUwU force-pushed the less_unchecked_pls branch 2 times, most recently from b6ba1e0 to c712ed1 Compare November 18, 2022 13:43
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 18, 2022
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#101162 (Migrate rustc_resolve to use SessionDiagnostic, part # 1)
 - rust-lang#103386 (Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting))
 - rust-lang#103405 (Detect incorrect chaining of if and if let conditions and recover)
 - rust-lang#103594 (Fix non-associativity of `Instant` math on `aarch64-apple-darwin` targets)
 - rust-lang#104006 (Add variant_name function to `LangItem`)
 - rust-lang#104494 (Migrate GUI test to use functions)
 - rust-lang#104516 (rustdoc: clean up sidebar width CSS)
 - rust-lang#104550 (fix a typo)

Failed merges:

 - rust-lang#104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less)

r? `@ghost`
`@rustbot` modify labels: rollup
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Nov 19, 2022

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Nov 19, 2022

📌 Commit 45a09a4 has been approved by lcnr

It is now in the queue for this repository.

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Nov 19, 2022
Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less

there are only like 3 or 4 call sites left after this but it wasnt obvious to me how to remove them
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 19, 2022
Rollup of 8 pull requests

Successful merges:

 - rust-lang#104001 (Improve generating Custom entry function)
 - rust-lang#104411 (nll: correctly deal with bivariance)
 - rust-lang#104528 (Properly link `{Once,Lazy}{Cell,Lock}` in docs)
 - rust-lang#104553 (Improve accuracy of asinh and acosh)
 - rust-lang#104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less)
 - rust-lang#104566 (couple of clippy::perf fixes)
 - rust-lang#104575 (deduplicate tests)
 - rust-lang#104580 (diagnostics: only show one suggestion for method -> assoc fn)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7f35493 into rust-lang:master Nov 19, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 19, 2022
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 21, 2022
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#101162 (Migrate rustc_resolve to use SessionDiagnostic, part # 1)
 - rust-lang#103386 (Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting))
 - rust-lang#103405 (Detect incorrect chaining of if and if let conditions and recover)
 - rust-lang#103594 (Fix non-associativity of `Instant` math on `aarch64-apple-darwin` targets)
 - rust-lang#104006 (Add variant_name function to `LangItem`)
 - rust-lang#104494 (Migrate GUI test to use functions)
 - rust-lang#104516 (rustdoc: clean up sidebar width CSS)
 - rust-lang#104550 (fix a typo)

Failed merges:

 - rust-lang#104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less)

r? `@ghost`
`@rustbot` modify labels: rollup
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.

7 participants