diff --git a/tests/ui/traits/hrtb-related-type-params-30867.rs b/tests/ui/traits/hrtb-related-type-params-30867.rs new file mode 100644 index 00000000000..ec1e3355bfb --- /dev/null +++ b/tests/ui/traits/hrtb-related-type-params-30867.rs @@ -0,0 +1,14 @@ +//@ check-pass +//! Tests that HRTB impl selection covers type parameters not directly related +//! to the trait. +//! Test for + +#![crate_type = "lib"] + +trait Unary {} +impl U> Unary for F {} +fn unary Unary<&'a T>, T>() {} + +pub fn test Fn(&'a i32) -> &'a i32>() { + unary::() +}