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

Silence some follow-up errors [3/x] #119818

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jan 10, 2024

this is one piece of the requested cleanups from #117449

Keep error types around, even in obligations.

These help silence follow-up errors, as we now figure out that some types (most notably inference variables) are equal to an error type.

But it also allows figuring out more types in the presence of errors, possibly causing more errors.

@rustbot
Copy link
Collaborator

rustbot commented Jan 10, 2024

r? @compiler-errors

(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 Jan 10, 2024
@@ -15,7 +15,7 @@ fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint>

fn lint_files() -> impl Iterator<Item = foo::MissingItem> {
//~^ ERROR: failed to resolve
unimplemented!()
std::iter::empty()
Copy link
Member

Choose a reason for hiding this comment

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

why did you change this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because it otherwise emits a "(): Iterator does not hold" error

Copy link
Member

Choose a reason for hiding this comment

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

So this PR doesn't end up silencing errors, but also introducing new errors in some cases? 🤔 I think it may be important to note that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reverted the change to show the diagnostic change

@@ -631,13 +631,6 @@ impl<'tcx> InferCtxt<'tcx> {
ct_op: |ct| ct,
});

if let ty::ClauseKind::Projection(projection) = predicate.kind().skip_binder() {
if projection.term.references_error() {
// No point on adding any obligations since there's a type error involved.
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 point me to the PR that added this originally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was #64746

@rust-log-analyzer

This comment has been minimized.

These help silence follow up errors
@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 14, 2024

📌 Commit fb44c84 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 Jan 14, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 15, 2024
…3, r=compiler-errors

Silence some follow-up errors [3/x]

this is one piece of the requested cleanups from rust-lang#117449

Keep error types around, even in obligations.

These help silence follow-up errors, as we now figure out that some types (most notably inference variables) are equal to an error type.

But it also allows figuring out more types in the presence of errors, possibly causing more errors.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 15, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#119508 (coverage: Simplify building the coverage graph with `CoverageSuccessors`)
 - rust-lang#119818 (Silence some follow-up errors [3/x])
 - rust-lang#119870 (std: Doc blocking behavior of LazyLock)
 - rust-lang#119963 (Fix `allow_internal_unstable` for `(min_)specialization`)
 - rust-lang#119968 (Remove unused/unnecessary features)
 - rust-lang#119971 (Use `zip_eq` to enforce that things being zipped have equal sizes)
 - rust-lang#119974 (Minor `trimmed_def_paths` improvements)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 15, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#119818 (Silence some follow-up errors [3/x])
 - rust-lang#119870 (std: Doc blocking behavior of LazyLock)
 - rust-lang#119897 (`OutputTypeParameterMismatch` -> `SignatureMismatch`)
 - rust-lang#119963 (Fix `allow_internal_unstable` for `(min_)specialization`)
 - rust-lang#119971 (Use `zip_eq` to enforce that things being zipped have equal sizes)
 - rust-lang#119974 (Minor `trimmed_def_paths` improvements)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 15, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#119818 (Silence some follow-up errors [3/x])
 - rust-lang#119870 (std: Doc blocking behavior of LazyLock)
 - rust-lang#119897 (`OutputTypeParameterMismatch` -> `SignatureMismatch`)
 - rust-lang#119963 (Fix `allow_internal_unstable` for `(min_)specialization`)
 - rust-lang#119971 (Use `zip_eq` to enforce that things being zipped have equal sizes)
 - rust-lang#119974 (Minor `trimmed_def_paths` improvements)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 15, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#119818 (Silence some follow-up errors [3/x])
 - rust-lang#119870 (std: Doc blocking behavior of LazyLock)
 - rust-lang#119897 (`OutputTypeParameterMismatch` -> `SignatureMismatch`)
 - rust-lang#119963 (Fix `allow_internal_unstable` for `(min_)specialization`)
 - rust-lang#119971 (Use `zip_eq` to enforce that things being zipped have equal sizes)
 - rust-lang#119974 (Minor `trimmed_def_paths` improvements)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 73256c6 into rust-lang:master Jan 15, 2024
11 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 15, 2024
Rollup merge of rust-lang#119818 - oli-obk:even_more_follow_up_errors3, r=compiler-errors

Silence some follow-up errors [3/x]

this is one piece of the requested cleanups from rust-lang#117449

Keep error types around, even in obligations.

These help silence follow-up errors, as we now figure out that some types (most notably inference variables) are equal to an error type.

But it also allows figuring out more types in the presence of errors, possibly causing more errors.
@oli-obk oli-obk deleted the even_more_follow_up_errors3 branch January 16, 2024 08:20
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.

6 participants