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