test that we do not support higher-ranked regions in opaque type inference#121386
test that we do not support higher-ranked regions in opaque type inference#121386bors merged 6 commits intorust-lang:masterfrom
Conversation
There was a problem hiding this comment.
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.
can you yeet this error if there's a {type error} in the expected found? 😁
| opaque_def_id: LocalDefId, | ||
| tcx: TyCtxt<'tcx>, | ||
| ) -> DiagnosticBuilder<'tcx> { | ||
| ) -> Result<DiagnosticBuilder<'tcx>, ErrorGuaranteed> { |
There was a problem hiding this comment.
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.
@oli-obk Oli did you forgor to update these UI test directives to use //@?
There was a problem hiding this comment.
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