forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#124166 - oli-obk:define_opaque_types11, r=com…
…piler-errors Let inherent associated types constrain opaque types during projection r? `@compiler-errors` The same test ICEs on master: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=f4ff62663a5a3a0e16d00953ee7414d5
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
18 changes: 18 additions & 0 deletions
18
tests/ui/associated-inherent-types/constrain_opaque_types_during_projection.rs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//@ check-pass | ||
|
||
#![feature(inherent_associated_types, type_alias_impl_trait)] | ||
#![allow(incomplete_features)] | ||
|
||
struct Foo<T>(T); | ||
|
||
impl Foo<i32> { | ||
type Assoc = u32; | ||
} | ||
|
||
type Tait = impl Sized; | ||
|
||
fn bar(_: Tait) { | ||
let x: Foo<Tait>::Assoc = 42; | ||
} | ||
|
||
fn main() {} |