| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
Most involving `Symbol::intern` on string literals.
|
|
|
|
Move a bunch of error recovery methods to `diagnostics.rs` away from
`parser.rs`.
|
|
Mention that `self` is only valid on "associated functions"
```
error: unexpected `self` argument in function
--> $DIR/self-in-function-arg.rs:1:15
|
LL | fn foo(x:i32, self: i32) -> i32 { self }
| ^^^^ not valid as function argument
|
= note: `self` is only valid as the first argument of an associated function
```
When it is a method, mention it must be first
```
error: unexpected `self` argument in function
--> $DIR/trait-fn.rs:4:20
|
LL | fn c(foo: u32, self) {}
| ^^^^ must be the first associated function argument
```
|
|
|
|
|
|
|
|
|
|
- Add detail on origin of current parser when reaching EOF and stop
saying "found <eof>" and point at the end of macro calls
- Handle empty `cfg_attr` attribute
- Reword empty `derive` attribute error
|
|
Remove `ObsoleteInPlace`
The in place syntax has been deprecated for over a year. As it is, this is accumulated cruft: the error messages are unlikely to be helpful any more and it conflicts with some useful syntax (e.g. const generics in some instances).
It may be that removing `Token::LArrow` is backwards-incompatible. We should do a crater run to check.
cc @eddyb
|
|
r=pnkfelix
Borrowck error reporting cleanup
* Don't show variables created by desugarings in borrowck errors
* Move "conflict error" reporting to it's own module, so that `error_reporting` contains only common error reporting methods.
* Remove unused `ScopeTree` parameter.
r? @pnkfelix
|
|
|
|
tweak discriminant on non-nullary enum diagnostic
Adds notes pointing at the non-nullary variants, and uses "custom
discriminant" language to be consistent with the Reference.
Fixes #61039.
r? @estebank
|
|
Adds notes pointing at the non-nullary variants, and uses "custom
discriminant" language to be consistent with the Reference.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Add match arm scopes and other scope fixes
* Add drop and lint scopes for match arms.
* Lint attributes are now respected on match arms.
* Make sure we emit a StorageDead if we diverge when initializing a temporary.
* Adjust MIR pretty printing of scopes for locals.
* Don't generate duplicate lint scopes for `let statements`.
* Add some previously missing fake borrows for matches.
closes #46525
cc @rust-lang/compiler
|
|
|
|
|
|
|
|
r=michaelwoerister
Add stream_to_parser_with_base_dir
This PR adds `stream_to_parser_with_base_dir`, which creates a parser from a token stream and a base directory.
Context: I would like to parse `cfg_if!` macro and get a list of modules defined inside it from rustfmt so that rustfmt can format those modules (cc https://github.com/rust-lang/rustfmt/issues/3253). To do so, I need to create a parser from `TokenStream` and set the directory of `Parser` to the same directory as the parent directory of a file which contains `cfg_if!` invocation. AFAIK there is no way to achieve this, and hence this PR.
Alternatively, I could change the visibility of `Parser.directory` from `crate` to `pub` so that the value can be modified after initializing a parser. I don't have a preference over either approach (or others, as long as it works).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Now they
- Tell what the new size is, when it changes
- Do not require passing an identifier
|
|
r=petrochenkov
Avoid some unnecessary interning
r? @petrochenkov
|
|
Handle more string addition cases with appropriate suggestions
|
|
A lot of these static symbols are pre-interned.
|
|
|
|
|
|
|
|
|
|
- Change wording of suggestion
- Move recovery logic to `diagnostics.rs`
- Reduce ammount of code duplication
|
|
|
|
|
|
|
|
Include expression to wait for to the span of Await
Currently the span of `await!` only includes itself:
```rust
await!(3);
// ^^^^^
```
This PR changes it so that the span holds the whole `await!` expression:
```rust
await!(3);
// ^^^^^^^^^
|
|
Move token tree related lexer state to a separate struct
Just a types-based refactoring.
We only used a bunch of fields when tokenizing into a token tree, so let's move them out of the base lexer
|
|
See https://github.com/rust-lang/rust/pull/50838/files#r283296243 for
explanation how jointness checking works with *next* pair
|
|
|