We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cff6c0e commit 6f6550fCopy full SHA for 6f6550f
tests/ui/fn/implied-bounds-impl-header-projections.rs
@@ -0,0 +1,31 @@
1
+// check-pass
2
+// known-bug: #100051
3
+
4
+// Should fail. Implied bounds from projections in impl headers can create
5
+// improper lifetimes. Variant of issue #98543 which was fixed by #99217.
6
7
+trait Trait {
8
+ type Type;
9
+}
10
11
+impl<T> Trait for T {
12
+ type Type = ();
13
14
15
+trait Extend<'a, 'b> {
16
+ fn extend(self, s: &'a str) -> &'b str;
17
18
19
+impl<'a, 'b> Extend<'a, 'b> for <&'b &'a () as Trait>::Type
20
+where
21
+ for<'what, 'ever> &'what &'ever (): Trait,
22
+{
23
+ fn extend(self, s: &'a str) -> &'b str {
24
+ s
25
+ }
26
27
28
+fn main() {
29
+ let y = <() as Extend<'_, '_>>::extend((), &String::from("Hello World"));
30
+ println!("{}", y);
31
0 commit comments