From 382365bfe3f136fe97273e58532d799a82b373ea Mon Sep 17 00:00:00 2001 From: clubby789 Date: Mon, 7 Oct 2024 11:36:58 +0000 Subject: [PATCH] Add test for issue 30867 --- tests/ui/traits/hrtb-related-type-params-30867.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/ui/traits/hrtb-related-type-params-30867.rs 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 0000000000000..ec1e3355bfba7 --- /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::() +}