diff options
Diffstat (limited to 'src/test/ui/higher-rank-trait-bounds/normalize-under-binder/norm-before-method-resolution.rs')
-rw-r--r-- | src/test/ui/higher-rank-trait-bounds/normalize-under-binder/norm-before-method-resolution.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/norm-before-method-resolution.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/norm-before-method-resolution.rs new file mode 100644 index 000000000..7693b1182 --- /dev/null +++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/norm-before-method-resolution.rs @@ -0,0 +1,23 @@ +// check-fail +// known-bug: #89196 + +// Should pass, but we normalize and check bounds before we resolve the generics +// of the function (which we know because of the return type). + +trait Trait<'a> { + type Out; +} + +impl<'a, T> Trait<'a> for T { + type Out = T; +} + +fn weird_bound<X>() -> X + where + for<'a> X: Trait<'a>, + for<'a> <X as Trait<'a>>::Out: Copy +{ todo!() } + +fn main() { + let _: () = weird_bound(); +} |