]> git.lizzy.rs Git - rust.git/commitdiff
Add long diagnostics for E0247
authorAlisdair Owens <awo101@zepler.net>
Fri, 4 Sep 2015 18:21:22 +0000 (19:21 +0100)
committerAlisdair Owens <awo101@zepler.net>
Fri, 4 Sep 2015 18:22:11 +0000 (19:22 +0100)
src/librustc_typeck/diagnostics.rs

index dfce7a9c31584e3b501c46737a2101dad860c38d..8a2f8b1cf4bb0d706fdadebdc2a76929865066de 100644 (file)
@@ -2475,6 +2475,24 @@ struct Bar<S, T> { x: Foo<S, T> }
 ```
 "##,
 
+//NB: not currently reachable
+E0247: r##"
+This error indicates an attempt to use a module name where a type is expected.
+For example:
+
+```
+mod MyMod {
+    mod MySubMod { }
+}
+
+fn do_something(x: MyMod::MySubMod) { }
+```
+
+In this example, we're attempting to take a parameter of type `MyMod::MySubMod`
+in the do_something function. This is not legal: `MyMod::MySubMod` is a module
+name, not a type.
+"##,
+
 E0248: r##"
 This error indicates an attempt to use a value where a type is expected. For
 example:
@@ -3291,7 +3309,6 @@ struct i8x16(i8, i8, i8, i8, i8, i8, i8, i8,
     E0242, // internal error looking up a definition
     E0245, // not a trait
 //  E0246, // invalid recursive type
-    E0247, // found module name used as a type
 //  E0319, // trait impls for defaulted traits allowed just for structs/enums
     E0320, // recursive overflow during dropck
     E0321, // extended coherence rules for defaulted traits violated