Add test for issue 30867
This commit is contained in:
parent
fa4f18be55
commit
382365bfe3
14
tests/ui/traits/hrtb-related-type-params-30867.rs
Normal file
14
tests/ui/traits/hrtb-related-type-params-30867.rs
Normal file
@ -0,0 +1,14 @@
|
||||
//@ check-pass
|
||||
//! Tests that HRTB impl selection covers type parameters not directly related
|
||||
//! to the trait.
|
||||
//! Test for <https://github.com/rust-lang/rust/issues/30867>
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
trait Unary<T> {}
|
||||
impl<T, U, F: Fn(T) -> U> Unary<T> for F {}
|
||||
fn unary<F: for<'a> Unary<&'a T>, T>() {}
|
||||
|
||||
pub fn test<F: for<'a> Fn(&'a i32) -> &'a i32>() {
|
||||
unary::<F, i32>()
|
||||
}
|
Loading…
Reference in New Issue
Block a user