diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/auxiliary/issue-11508.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/issues/auxiliary/issue-11508.rs b/src/test/ui/issues/auxiliary/issue-11508.rs new file mode 100644 index 000000000..16bfc65c2 --- /dev/null +++ b/src/test/ui/issues/auxiliary/issue-11508.rs @@ -0,0 +1,10 @@ +pub struct Closed01<F>(pub F); + +pub trait Bar { fn new() -> Self; } + +impl<T: Bar> Bar for Closed01<T> { + fn new() -> Closed01<T> { Closed01(Bar::new()) } +} +impl Bar for f32 { fn new() -> f32 { 1.0 } } + +pub fn random<T: Bar>() -> T { Bar::new() } |