Skip to content

Commit 382365b

Browse files
committed
Add test for issue 30867
1 parent fa4f18b commit 382365b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ check-pass
2+
//! Tests that HRTB impl selection covers type parameters not directly related
3+
//! to the trait.
4+
//! Test for <https://github.com/rust-lang/rust/issues/30867>
5+
6+
#![crate_type = "lib"]
7+
8+
traitUnary<T>{}
9+
impl<T,U,F:Fn(T) -> U>Unary<T>forF{}
10+
fnunary<F:for<'a>Unary<&'aT>,T>(){}
11+
12+
pubfntest<F:for<'a>Fn(&'ai32) -> &'ai32>(){
13+
unary::<F,i32>()
14+
}

0 commit comments

Comments
 (0)