forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#96379 - PrestonFrom:issue_96335, r=compiler…
…-errors delay bug when adjusting `NeverToAny` twice during diagnostic code Addresses Issue 96335 (rust-lang#96335) by using `delay_span_bug` instead of an assert and returning an error type from `check_expr_meets_expectation_or_error`. Fixes rust-lang#96335
- Loading branch information
Showing
3 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
fn main() { | ||
0.....{loop{}1}; | ||
//~^ ERROR unexpected token | ||
//~| ERROR mismatched types | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
error: unexpected token: `...` | ||
--> $DIR/issue-96335.rs:2:6 | ||
| | ||
LL | 0.....{loop{}1}; | ||
| ^^^ | ||
| | ||
help: use `..` for an exclusive range | ||
| | ||
LL | 0....{loop{}1}; | ||
| ~~ | ||
help: or `..=` for an inclusive range | ||
| | ||
LL | 0..=..{loop{}1}; | ||
| ~~~ | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/issue-96335.rs:2:9 | ||
| | ||
LL | 0.....{loop{}1}; | ||
| ----^^^^^^^^^^^ | ||
| | | | ||
| | expected integer, found struct `RangeTo` | ||
| arguments to this function are incorrect | ||
| | ||
= note: expected type `{integer}` | ||
found struct `RangeTo<{integer}>` | ||
note: associated function defined here | ||
--> $SRC_DIR/core/src/ops/range.rs:LL:COL | ||
| | ||
LL | pub const fn new(start: Idx, end: Idx) -> Self { | ||
| ^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |