summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/adt-param-with-implicit-sized-bound.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/ui/suggestions/adt-param-with-implicit-sized-bound.rs
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/suggestions/adt-param-with-implicit-sized-bound.rs')
-rw-r--r--tests/ui/suggestions/adt-param-with-implicit-sized-bound.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ui/suggestions/adt-param-with-implicit-sized-bound.rs b/tests/ui/suggestions/adt-param-with-implicit-sized-bound.rs
new file mode 100644
index 000000000..ef64d799b
--- /dev/null
+++ b/tests/ui/suggestions/adt-param-with-implicit-sized-bound.rs
@@ -0,0 +1,28 @@
+trait Trait {
+ fn func1() -> Struct1<Self>; //~ ERROR E0277
+ fn func2<'a>() -> Struct2<'a, Self>; //~ ERROR E0277
+ fn func3() -> Struct3<Self>; //~ ERROR E0277
+ fn func4() -> Struct4<Self>; //~ ERROR E0277
+}
+
+struct Struct1<T>{
+ _t: std::marker::PhantomData<*const T>,
+}
+struct Struct2<'a, T>{
+ _t: &'a T,
+}
+struct Struct3<T>{
+ _t: T,
+}
+
+struct X<T>(T);
+
+struct Struct4<T>{
+ _t: X<T>,
+}
+
+struct Struct5<T: ?Sized>{
+ _t: X<T>, //~ ERROR E0277
+}
+
+fn main() {}