File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
tests/ui/type-alias-enum-variants Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change
1
+ //! Test that type arguments are properly rejected on modules.
2
+ //!
3
+ //! Related PR: https://github.com/rust-lang/rust/pull/56225 (RFC 2338 implementation)
4
+
1
5
mod Mod {
2
6
pub struct FakeVariant < T > ( pub T ) ;
3
7
}
4
8
5
9
fn main ( ) {
10
+ // This should work fine - normal generic struct constructor
6
11
Mod :: FakeVariant :: < i32 > ( 0 ) ;
12
+
13
+ // This should error - type arguments not allowed on modules
7
14
Mod :: < i32 > :: FakeVariant ( 0 ) ;
8
15
//~^ ERROR type arguments are not allowed on module `Mod` [E0109]
9
16
}
Original file line number Diff line number Diff line change 1
1
error[E0109]: type arguments are not allowed on module `Mod`
2
- --> $DIR/mod-subitem-as-enum-variant .rs:7 :11
2
+ --> $DIR/module-type-args-error .rs:14 :11
3
3
|
4
4
LL | Mod::<i32>::FakeVariant(0);
5
5
| --- ^^^ type argument not allowed
You can’t perform that action at this time.
0 commit comments