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

make type_flags(ReError) & HAS_ERROR #122749

Merged
merged 2 commits into from
Mar 21, 2024
Merged

Conversation

aliemjay
Copy link
Member

Self-explanatory. TypeVisitableExt::references_error(ReError) incorrectly returned false.

@rustbot
Copy link
Collaborator

rustbot commented Mar 19, 2024

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Mar 19, 2024
Comment on lines -381 to -440
if let Err(guar) = arg.error_reported() {
return Err(guar);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

This is removed to avoid an ICE in tests/ui/type-alias-impl-trait/under-binder.rs. I'll rewrite it anyway in #116891.

@rust-log-analyzer

This comment has been minimized.

@@ -9,6 +9,19 @@ help: indicate the anonymous lifetime
LL | impl Trait for Ref<'_> {}
| ++++

error: aborting due to 1 previous error
error[E0277]: the trait bound `Ref<'_>: Trait` is not satisfied
Copy link
Member

Choose a reason for hiding this comment

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

Do you know why this error occurs?

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.

Would like some explanations for why these error messages start appearing, but I agree that this is the right approach in general. I don't think they necessarily should be fixed, but am curious nonetheless.

@@ -10,6 +10,14 @@ note: lifetime declared here
LL | pub type Foo = impl for<'a> Trait<'a, Assoc = impl Test<'a>>;
| ^^

error: aborting due to 1 previous error
error: unconstrained opaque type
Copy link
Member

Choose a reason for hiding this comment

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

And this one too, do you know why it occurs?

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'll look into it.

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't register opaques that reference errors: https://github.com/rust-lang/rust/blame/a128516cf9de352ae1f9d430ed730363c7ca3c0c/compiler/rustc_infer/src/infer/opaque_types/mod.rs#L97.

I changed it in a later commit to register hidden types unconditionally.

@aliemjay aliemjay changed the title make type_flags(ReError) | HAS_ERROR make type_flags(ReError) & HAS_ERROR Mar 20, 2024
@compiler-errors
Copy link
Member

Cool, I like this consistency fix

@bors r+ rollup (only affects error code)

@bors
Copy link
Contributor

bors commented Mar 20, 2024

📌 Commit 0dc006b 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 Mar 20, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 20, 2024
…rors

make `type_flags(ReError) & HAS_ERROR`

Self-explanatory. `TypeVisitableExt::references_error(ReError)` incorrectly returned `false`.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 20, 2024
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#122545 (Ignore paths from expansion in `unused_qualifications`)
 - rust-lang#122644 (pattern analysis: add a custom test harness)
 - rust-lang#122696 (Add bare metal riscv32 target.)
 - rust-lang#122729 (Relax SeqCst ordering in standard library.)
 - rust-lang#122740 (use more accurate terminology)
 - rust-lang#122749 (make `type_flags(ReError) & HAS_ERROR`)
 - rust-lang#122764 (coverage: Remove incorrect assertions from counter allocation)
 - rust-lang#122765 (Add `usize::MAX` arg tests for Vec)
 - rust-lang#122776 (Rename `hir::Let` into `hir::LetExpr`)
 - rust-lang#122786 (compiletest: Introduce `remove_and_create_dir_all()` helper)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 21, 2024
Rollup of 8 pull requests

Successful merges:

 - rust-lang#122545 (Ignore paths from expansion in `unused_qualifications`)
 - rust-lang#122729 (Relax SeqCst ordering in standard library.)
 - rust-lang#122740 (use more accurate terminology)
 - rust-lang#122749 (make `type_flags(ReError) & HAS_ERROR`)
 - rust-lang#122764 (coverage: Remove incorrect assertions from counter allocation)
 - rust-lang#122765 (Add `usize::MAX` arg tests for Vec)
 - rust-lang#122776 (Rename `hir::Let` into `hir::LetExpr`)
 - rust-lang#122786 (compiletest: Introduce `remove_and_create_dir_all()` helper)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4e792df into rust-lang:master Mar 21, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Mar 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 21, 2024
Rollup merge of rust-lang#122749 - aliemjay:region-err, r=compiler-errors

make `type_flags(ReError) & HAS_ERROR`

Self-explanatory. `TypeVisitableExt::references_error(ReError)` incorrectly returned `false`.
@matthiaskrgr
Copy link
Member

neat, seems to have fixed
#121006
#121807
#122098
#122549
🎉

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 22, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 22, 2024
…iaskrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#121881 (std::net: adding acceptfilter feature for netbsd/freebsd.)
 - rust-lang#122817 (Doc Guarantee: BTree(Set|Map):  `IntoIter` Iterate in Sorted by key Order)
 - rust-lang#122826 (Add tests for shortcomings of associated type bounds)
 - rust-lang#122829 (Implement `FusedIterator` for `gen` block)
 - rust-lang#122831 (make failure logs less verbose)
 - rust-lang#122837 (add test for rust-lang#122549)
 - rust-lang#122838 (Avoid noop rewrite of issues.txt)
 - rust-lang#122841 (add 2 more tests for issues fixed by rust-lang#122749)
 - rust-lang#122843 (Add a never type option to make diverging blocks `()`)
 - rust-lang#122844 (add test for ice "cannot relate region: LUB(ReErased, ReError)")
 - rust-lang#122845 (Clippy subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 22, 2024
Rollup merge of rust-lang#122841 - matthiaskrgr:moretests, r=wesleywiser

add 2 more tests for issues fixed by rust-lang#122749

 Fixes rust-lang#121807
 Fixes rust-lang#122098
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