| Age | Commit message (Collapse) | Author | Lines |
|
fix lexing of comments with many \r
closes #62863
|
|
closes #62863
|
|
|
|
The idea here is to make a reusable library out of the existing
rust-lexer, by separating out pure lexing and rustc-specific concerns,
like spans, error reporting an interning.
So, rustc_lexer operates directly on `&str`, produces simple tokens
which are a pair of type-tag and a bit of original text, and does not
report errors, instead storing them as flags on the token.
|
|
Add meta-variable checks in macro definitions
This is an implementation of #61053. It is not sound (some errors are not reported) and not complete (reports may not be actual errors). This is due to the possibility to define macros in macros in indirect ways. See module documentation of `macro_check` for more details.
What remains to be done:
- [x] Migrate from an error to an allow-by-default lint.
- [x] Add more comments in particular for the handling of nested macros.
- [x] Add more tests if needed.
- [x] Try to avoid cloning too much (one idea is to use lists on the stack).
- [ ] Run crater with deny-by-default lint (measure rate of false positives).
- [ ] Remove extra commit for deny-by-default lint
- [x] Create a PR to remove the old `question_mark_macro_sep` lint #62160
|
|
|
|
This is needed for having complete error messages where reporting macro variable
errors. Here is what they would look like:
error: meta-variable repeats with different kleene operator
--> $DIR/issue-61053-different-kleene.rs:3:57
|
LL | ( $( $i:ident = $($j:ident),+ );* ) => { $( $( $i = $j; )* )* };
| - expected repetition ^^ - conflicting repetition
|
|
|
|
|
|
rustc/rustc_mir: Implement RFC 2203.
This PR implements RFC 2203, allowing constants in array repeat
expressions. Part of #49147.
r? @eddyb
|
|
fakenine:normalize_use_of_backticks_compiler_messages_p6, r=eddyb
normalize use of backticks in compiler messages for libsyntax/parse
https://github.com/rust-lang/rust/issues/60532
|
|
Cancel unemitted diagnostics during error recovery
Follow up to https://github.com/rust-lang/rust/pull/62604. Use @eddyb's preferred style and catch other case of the same problem.
r? @eddyb
|
|
Fix #62660
If the explicitly given type of a `self` parameter fails to parse correctly, we need to propagate the error rather than dropping it and causing an ICE.
Fixes #62660.
|
|
Tweak wording in feature gate errors
|
|
https://github.com/rust-lang/rust/issues/60532
|
|
|
|
Fix some remaining cases of bad formatting
Update some failing tests
|
|
Fixes https://github.com/rust-lang/rust/issues/62628
|
|
Wrap the whole attribute into a box instead
|
|
|
|
|
|
|
|
So that path and macro argument printing code can be shared
|
|
Detect `fn` with a body in an `extern` block
Fix #62109.
|
|
Do not emit type errors after parse error in last statement of block
When recovering from a parse error inside a block, do not emit type
errors generating on that block's recovered return expression.
Fix #57383.
|
|
Use snippet instead of pprinting statement
Fix #62554.
|
|
|
|
|
|
If the explicitly given type of a `self` parameter fails to parse correctly,
we need to propagate the error rather than dropping it and causing an ICE.
Fixes #62660.
|
|
|
|
|
|
Make some rustc macros more hygienic
|
|
Handle errors during error recovery gracefully
Fix #62546.
|
|
|
|
|
|
When recovering from a parse error inside a block, do not emit type
errors generating on that block's recovered return expression.
Fix #57383.
|
|
|
|
Correctly break out of recovery loop
Fix #61858.
|
|
Emit dropped unemitted errors to aid in ICE debugging
|
|
|
|
|
|
|
|
Therefore we also remove `#[unsafe_destructor_blind_to_params]`
attribute completly.
|
|
|
|
|
|
|
|
Continue refactoring macro expansion and resolution
This PR continues the work started in https://github.com/rust-lang/rust/pull/62042.
It contains a set of more or less related refactorings with the general goal of making things simpler and more orthogonal.
Along the way most of the issues uncovered in https://github.com/rust-lang/rust/pull/62086 are fixed.
The PR is better read in per-commit fashion with whitespace changes ignored.
I tried to leave some more detailed commit messages describing the motivation behind the individual changes.
Fixes https://github.com/rust-lang/rust/issues/44692
Fixes https://github.com/rust-lang/rust/issues/52363
Unblocks https://github.com/rust-lang/rust/pull/62086
r? @matthewjasper
|
|
`InvocationKind::Attr { attr: None, .. }` meaning something entirely different from a regular attribute was confusing as hell.
|
|
It's more convenient to have all this highly related stuff together on one screen (for future refactorings).
The `expand_invoc` function is compact enough now, after all the previous refactorings.
|
|
Remove a bunch of `Option`s that assumed that dummy fragment creation could fail.
The test output changed due to not performing the expansion in `fn expand_invoc` in case of the recursion limit hit.
|