diff options
Diffstat (limited to 'src/test/ui/self/self_type_keyword-2.rs')
-rw-r--r-- | src/test/ui/self/self_type_keyword-2.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/self/self_type_keyword-2.rs b/src/test/ui/self/self_type_keyword-2.rs new file mode 100644 index 000000000..cfb87f518 --- /dev/null +++ b/src/test/ui/self/self_type_keyword-2.rs @@ -0,0 +1,13 @@ +use self::Self as Foo; //~ ERROR unresolved import `self::Self` + +pub fn main() { + let Self = 5; + //~^ ERROR cannot find unit struct, unit variant or constant `Self` in this scope + + match 15 { + Self => (), + //~^ ERROR cannot find unit struct, unit variant or constant `Self` in this scope + Foo { x: Self } => (), + //~^ ERROR cannot find unit struct, unit variant or constant `Self` in this scope + } +} |