Skip to content

Commit d7afefc

Browse files
committed
Rollup merge of rust-lang#28234 - AlisdairO:diagnostics247, r=Manishearth
As title :-) Part of rust-lang#24407. r? @Manishearth
2 parents 6ed1c59 + 8175dce commit d7afefc

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/librustc_typeck/diagnostics.rs

+18-1
Original file line numberDiff line numberDiff line change
@@ -2475,6 +2475,24 @@ struct Bar<S, T> { x: Foo<S, T> }
24752475
```
24762476
"##,
24772477

2478+
//NB: not currently reachable
2479+
E0247: r##"
2480+
This error indicates an attempt to use a module name where a type is expected.
2481+
For example:
2482+
2483+
```
2484+
mod MyMod {
2485+
mod MySubMod { }
2486+
}
2487+
2488+
fn do_something(x: MyMod::MySubMod) { }
2489+
```
2490+
2491+
In this example, we're attempting to take a parameter of type `MyMod::MySubMod`
2492+
in the do_something function. This is not legal: `MyMod::MySubMod` is a module
2493+
name, not a type.
2494+
"##,
2495+
24782496
E0248: r##"
24792497
This error indicates an attempt to use a value where a type is expected. For
24802498
example:
@@ -3291,7 +3309,6 @@ register_diagnostics! {
32913309
E0242, // internal error looking up a definition
32923310
E0245, // not a trait
32933311
// E0246, // invalid recursive type
3294-
E0247, // found module name used as a type
32953312
// E0319, // trait impls for defaulted traits allowed just for structs/enums
32963313
E0320, // recursive overflow during dropck
32973314
E0321, // extended coherence rules for defaulted traits violated

0 commit comments

Comments
 (0)