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 }})

oli-obk

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 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

Feb 21, 2024

lcnr

Contributor

@lcnr 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? 😁

@oli-obk

@oli-obk

lcnr

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.

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

@oli-obk

@oli-obk

@bors

📌 Commit e4622e0 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

Feb 22, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Feb 22, 2024

@matthiaskrgr

…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

cc rust-lang#96146

r? @lcnr

jieyouxu

// 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 //@

@oli-obk

@oli-obk

@bors

📌 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

Feb 22, 2024

@bors

…iaskrgr

Rollup of 8 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Feb 22, 2024

@rust-timer

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

cc rust-lang#96146

r? @lcnr

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.