-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
test that we do not support higher-ranked regions in opaque type inference #121386
Conversation
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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? 😁
There was a problem hiding this 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> { |
There was a problem hiding this comment.
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
@bors r=lcnr |
…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`
// Regression test for #97099. | ||
// This was an ICE because `impl Sized` captures the lifetime 'a. | ||
|
||
// check-fail |
There was a problem hiding this comment.
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 //@
?
There was a problem hiding this comment.
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 //@
@bors r=lcnr |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#120598 (No need to `validate_alias_bound_self_from_param_env` in `assemble_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 on `PatKind`) - 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` to `LocalDefId`) - rust-lang#121452 (Add new maintainers to nto-qnx.md) r? `@ghost` `@rustbot` modify labels: rollup
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`
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