-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a fixed-point iteration when breaking tokens
Some tokens need to be broken in a loop until we reach 'unbreakable' tokens.
- Loading branch information
Showing
5 changed files
with
77 additions
and
23 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,16 @@ | ||
// aux-build:test-macros.rs | ||
// Regression test for issues #68489 and #70987 | ||
// Tests that we properly break tokens in `probably_equal_for_proc_macro` | ||
// See #72306 | ||
// | ||
// Note that the weird spacing in this example is critical | ||
// for testing the issue. | ||
|
||
extern crate test_macros; | ||
|
||
#[test_macros::recollect_attr] | ||
fn repro() { | ||
f :: < Vec < _ > > ( ) ; //~ ERROR cannot find | ||
let a: Option<Option<u8>>= true; //~ ERROR mismatched | ||
} | ||
fn main() {} |
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,21 @@ | ||
error[E0425]: cannot find function `f` in this scope | ||
--> $DIR/break-token-spans.rs:13:5 | ||
| | ||
LL | f :: < Vec < _ > > ( ) ; | ||
| ^ not found in this scope | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/break-token-spans.rs:14:32 | ||
| | ||
LL | let a: Option<Option<u8>>= true; | ||
| ------------------ ^^^^ expected enum `std::option::Option`, found `bool` | ||
| | | ||
| expected due to this | ||
| | ||
= note: expected enum `std::option::Option<std::option::Option<u8>>` | ||
found type `bool` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0308, E0425. | ||
For more information about an error, try `rustc --explain E0308`. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.