test that we do not support higher-ranked regions in opaque type inference by oli-obk · Pull Request #121386 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation11 Commits6 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
We already do all the right checks in check_opaque_type_parameter_valid
, and we have done so since at least 2 years.
I collected the tests from #116935 and #100503 and added some more
cc #96146
r? @lcnr
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Contributor
lcnr left a comment • Loading
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some rustc improvements i thought of while looking at the tests.
please either implement them in this PR or open separate issues for them.
separately: we should document somewhere (at least in the ATPIT stabilization report, cc @traviscross ), that higher ranked opaque types mentioning higher-ranked lifetimes are not supported
LL | const FOO: Foo = Struct; |
---|
| ^^^^^^ |
error: concrete type differs from previous defining opaque type use |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you yeet this error if there's a {type error}
in the expected found? 😁
Contributor
lcnr 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 after nit
@@ -845,26 +845,27 @@ impl<'tcx> OpaqueHiddenType<'tcx> { |
---|
other: &Self, |
opaque_def_id: LocalDefId, |
tcx: TyCtxt<'tcx>, |
) -> DiagnosticBuilder<'tcx> { |
) -> Result<DiagnosticBuilder<'tcx>, ErrorGuaranteed> { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vibe: rename this method to fn build_mismatch_error
or sth? because a method called report
returing Ok(DiagnosticsBuilder)
feels off to me
📌 Commit e4622e0 has been approved by lcnr
It is now in the queue for this repository.
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
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
…r=lcnr
test that we do not support higher-ranked regions in opaque type inference
We already do all the right checks in check_opaque_type_parameter_valid
, and we have done so since at least 2 years.
I collected the tests from rust-lang#116935 and rust-lang#100503 and added some more
r? @lcnr
// Regression test for #97099. |
---|
// This was an ICE because `impl Sized` captures the lifetime 'a. |
// check-fail |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oli-obk Oli did you forgor to update these UI test directives to use //@
?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check-fail
should be the default for these tests anyways, so we could remove the directives rather than use //@
📌 Commit 1efb747 has been approved by lcnr
It is now in the queue for this repository.
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 8 pull requests
Successful merges:
- rust-lang#120598 (No need to
validate_alias_bound_self_from_param_env
inassemble_alias_bound_candidates
) - rust-lang#121386 (test that we do not support higher-ranked regions in opaque type inference)
- rust-lang#121393 (match lowering: Introduce a
TestCase
enum to replace most matching onPatKind
) - rust-lang#121401 (Fix typo in serialized.rs)
- rust-lang#121427 (Fix panic when compiling
Rocket
.) - rust-lang#121439 (Fix typo in metadata.rs doc comment)
- rust-lang#121441 (
DefId
toLocalDefId
) - rust-lang#121452 (Add new maintainers to nto-qnx.md)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#121386 - oli-obk:no_higher_ranked_opaques, r=lcnr
test that we do not support higher-ranked regions in opaque type inference
We already do all the right checks in check_opaque_type_parameter_valid
, and we have done so since at least 2 years.
I collected the tests from rust-lang#116935 and rust-lang#100503 and added some more
r? @lcnr
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.