about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-08-15 09:26:48 +0000
committerbors <bors@rust-lang.org>2015-08-15 09:26:48 +0000
commit316f5e5acfe6e69bc7ab39b0e4feed116a86a58a (patch)
treef65143ac070bfd3c79c0bbed1d418256e75b38b0 /src
parente859498d1ca45f2719542f505eb0ba8b944e5668 (diff)
parent26cca1c258a8946bfcd6d900077642d5f2be708c (diff)
downloadrust-316f5e5acfe6e69bc7ab39b0e4feed116a86a58a.tar.gz
rust-316f5e5acfe6e69bc7ab39b0e4feed116a86a58a.zip
Auto merge of #27846 - AlisdairO:diagnostics248, r=Manishearth
As title :-)
Part of #24407.

r? @Manishearth
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/diagnostics.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index c24c9e9a255..62804426df6 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -2365,6 +2365,25 @@ struct Bar<S, T> { x: Foo<S, T> }
 ```
 "##,
 
+E0248: r##"
+This error indicates an attempt to use a value where a type is expected. For
+example:
+
+```
+enum Foo {
+    Bar(u32)
+}
+
+fn do_something(x: Foo::Bar) { }
+```
+
+In this example, we're attempting to take a type of `Foo::Bar` in the
+do_something function. This is not legal: `Foo::Bar` is a value of type `Foo`,
+not a distinct static type. Likewise, it's not legal to attempt to
+`impl Foo::Bar`: instead, you must `impl Foo` and then pattern match to specify
+behaviour for specific enum variants.
+"##,
+
 E0249: r##"
 This error indicates a constant expression for the array length was found, but
 it was not an integer (signed or unsigned) expression.
@@ -2756,7 +2775,6 @@ register_diagnostics! {
     E0245, // not a trait
     E0246, // invalid recursive type
     E0247, // found module name used as a type
-    E0248, // found value 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