parent
78450d2d60
commit
9b17e2d14d
2 changed files with 46 additions and 0 deletions
24
src/test/ui/associated-types/issue-91069.rs
Normal file
24
src/test/ui/associated-types/issue-91069.rs
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
// check-pass
|
||||||
|
|
||||||
|
pub trait Associate {
|
||||||
|
type Associated;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Wrap<'a> {
|
||||||
|
pub field: &'a i32,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub trait Create<T> {
|
||||||
|
fn create() -> Self;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn oh_no<'a, T>()
|
||||||
|
where
|
||||||
|
Wrap<'a>: Associate,
|
||||||
|
<Wrap<'a> as Associate>::Associated: Create<T>,
|
||||||
|
{
|
||||||
|
<Wrap<'a> as Associate>::Associated::create();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pub fn main() {}
|
22
src/test/ui/generic-associated-types/issue-91139.rs
Normal file
22
src/test/ui/generic-associated-types/issue-91139.rs
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
// check-pass
|
||||||
|
|
||||||
|
#![feature(generic_associated_types)]
|
||||||
|
|
||||||
|
trait Foo<T> {
|
||||||
|
type Type<'a>
|
||||||
|
where
|
||||||
|
T: 'a;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T> Foo<T> for () {
|
||||||
|
type Type<'a>
|
||||||
|
where
|
||||||
|
T: 'a,
|
||||||
|
= ();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn foo<T>() {
|
||||||
|
let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue