forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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#126868 - bvanjoi:fix-126764, r=davidtwco not use offset when there is not ends with brace Fixes rust-lang#126764
- Loading branch information
Showing
3 changed files
with
56 additions
and
5 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
13 changes: 13 additions & 0 deletions
13
tests/ui/suggestions/missing-impl-trait-block-but-not-ascii.rs
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,13 @@ | ||
// issue#126764 | ||
|
||
struct S; | ||
|
||
trait T { | ||
fn f(); | ||
} | ||
impl T for S; | ||
//~^ ERROR: unknown start of token | ||
//~| ERROR: expected `{}` | ||
//~| ERROR: not all trait items implemented, missing: `f` | ||
|
||
fn main() {} |
31 changes: 31 additions & 0 deletions
31
tests/ui/suggestions/missing-impl-trait-block-but-not-ascii.stderr
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,31 @@ | ||
error: unknown start of token: \u{ff1b} | ||
--> $DIR/missing-impl-trait-block-but-not-ascii.rs:8:13 | ||
| | ||
LL | impl T for S; | ||
| ^^ | ||
| | ||
help: Unicode character ';' (Fullwidth Semicolon) looks like ';' (Semicolon), but it is not | ||
| | ||
LL | impl T for S; | ||
| ~ | ||
|
||
error: expected `{}`, found `;` | ||
--> $DIR/missing-impl-trait-block-but-not-ascii.rs:8:13 | ||
| | ||
LL | impl T for S; | ||
| ^^ | ||
| | ||
= help: try using `{}` instead | ||
|
||
error[E0046]: not all trait items implemented, missing: `f` | ||
--> $DIR/missing-impl-trait-block-but-not-ascii.rs:8:1 | ||
| | ||
LL | fn f(); | ||
| ------- `f` from trait | ||
LL | } | ||
LL | impl T for S; | ||
| ^^^^^^^^^^^^ missing `f` in implementation | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0046`. |