11error: expected `;`, found keyword `const`
2- --> $DIR/const-recover-semi-issue-151149.rs:16 :3
2+ --> $DIR/const-recover-semi-issue-151149.rs:19 :3
33 |
44LL | &1
55 | ^ help: add `;` here
@@ -8,17 +8,17 @@ LL | const fn foo() -> &'static u8 {
88 | ----- unexpected token
99
1010error: expected `;`, found `}`
11- --> $DIR/const-recover-semi-issue-151149.rs:19 :38
11+ --> $DIR/const-recover-semi-issue-151149.rs:22 :38
1212 |
1313LL | const C: u8 = u8::const_default()
14- | ______________________________________ ^
14+ | _____- ^
1515LL | | &C
1616 | |______- to finish parsing this const, expected this to be followed by a `;`
1717LL | }
1818 | - unexpected token
1919 |
2020note: the const was parsed as having a bit-and binary expression
21- --> $DIR/const-recover-semi-issue-151149.rs:19 :19
21+ --> $DIR/const-recover-semi-issue-151149.rs:22 :19
2222 |
2323LL | const C: u8 = u8::const_default()
2424 | ------------------- parsed as the left-hand expression
@@ -32,61 +32,20 @@ LL | const C: u8 = u8::const_default();
3232 | +
3333
3434error: expected `;`, found `}`
35- --> $DIR/const-recover-semi-issue-151149.rs:25 :9
35+ --> $DIR/const-recover-semi-issue-151149.rs:28 :9
3636 |
3737LL | + 2
3838 | ^ help: add `;` here
3939LL | }
4040 | - unexpected token
4141
4242error: expected `;`, found `}`
43- --> $DIR/const-recover-semi-issue-151149.rs:30 :13
43+ --> $DIR/const-recover-semi-issue-151149.rs:33 :13
4444 |
4545LL | + val()
4646 | ^ help: add `;` here
4747LL | }
4848 | - unexpected token
4949
50- error: expected `;`, found `}`
51- --> $DIR/const-recover-semi-issue-151149.rs:34:14
52- |
53- LL | let r = 1
54- | ______________^
55- LL | | &r
56- | |______- to finish parsing this `let` binding, expected this to be followed by a `;`
57- LL | }
58- | - unexpected token
59- |
60- note: the `let` binding was parsed as having a bit-and binary expression
61- --> $DIR/const-recover-semi-issue-151149.rs:34:13
62- |
63- LL | let r = 1
64- | - parsed as the left-hand expression
65- LL | &r
66- | -- parsed as the right-hand expression
67- | |
68- | this was parsed as a bit-and
69- help: you may have meant to write a `;` to terminate the `let` binding earlier
70- |
71- LL | let r = 1;
72- | +
73-
74- error[E0308]: mismatched types
75- --> $DIR/const-recover-semi-issue-151149.rs:23:19
76- |
77- LL | const fn bar() -> u8 {
78- | --- ^^ expected `u8`, found `()`
79- | |
80- | implicitly returns `()` as its body has no tail or `return` expression
81-
82- error[E0308]: mismatched types
83- --> $DIR/const-recover-semi-issue-151149.rs:28:19
84- |
85- LL | const fn baz() -> u8 {
86- | --- ^^ expected `u8`, found `()`
87- | |
88- | implicitly returns `()` as its body has no tail or `return` expression
89-
90- error: aborting due to 7 previous errors
50+ error: aborting due to 4 previous errors
9151
92- For more information about this error, try `rustc --explain E0308`.
0 commit comments