]>
Commit | Line | Data |
---|---|---|
5099ac24 FG |
1 | error: invalid `?` in type |
2 | --> $DIR/trailing-question-in-type.rs:3:16 | |
3 | | | |
4 | LL | fn foo() -> i32? { | |
5 | | ^ `?` is only allowed on expressions, not types | |
6 | | | |
7 | help: if you meant to express that the type might not contain a value, use the `Option` wrapper type | |
8 | | | |
9 | LL | fn foo() -> Option<i32> { | |
10 | | +++++++ ~ | |
11 | ||
12 | error: invalid `?` in type | |
13 | --> $DIR/trailing-question-in-type.rs:4:15 | |
14 | | | |
15 | LL | let x: i32? = Some(1); | |
16 | | ^ `?` is only allowed on expressions, not types | |
17 | | | |
18 | help: if you meant to express that the type might not contain a value, use the `Option` wrapper type | |
19 | | | |
20 | LL | let x: Option<i32> = Some(1); | |
21 | | +++++++ ~ | |
22 | ||
23 | error: aborting due to 2 previous errors | |
24 |