Skip to content

Commit

Permalink
Rollup merge of rust-lang#91908 - matthiaskrgr:ices, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Add 2 tests

fixes rust-lang#91139
fixes rust-lang#91069
  • Loading branch information
matthiaskrgr authored Dec 14, 2021
2 parents d24b0cc + f58ef22 commit 063da9f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/test/ui/generic-associated-types/issue-81069.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 22 additions & 0 deletions src/test/ui/generic-associated-types/issue-91139.rs
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit 063da9f

Please sign in to comment.