| Age | Commit message (Collapse) | Author | Lines |
|
|
|
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
|
|
Spellchecking some comments
This PR attempts to clean up some minor spelling mistakes in comments
|
|
This PR attempts to clean up some minor spelling mistakes in comments
|
|
diagnostics: correct generic bounds with doubled colon
Fixes #95208
|
|
Remove `Nonterminal::NtTT`.
It's only needed for macro expansion, not as a general element in the
AST. This commit removes it, adds `NtOrTt` for the parser and macro
expansion cases, and renames the variants in `NamedMatch` to better
match the new type.
r? `@petrochenkov`
|
|
It's only needed for macro expansion, not as a general element in the
AST. This commit removes it, adds `NtOrTt` for the parser and macro
expansion cases, and renames the variants in `NamedMatch` to better
match the new type.
|
|
|
|
When encountering an inproperly terminated type parameter list, provide
a suggestion to close it after the last non-constraint type parameter
that was successfully parsed.
Fix #94058.
|
|
Fixes #95208
|
|
TaKO8Ki:replace-this-clone-with-this-create-snapshot-for-diagnostic, r=Dylan-DPC
Replace `this.clone()` with `this.create_snapshot_for_diagnostic()`
Use [`create_snapshot_for_diagnostic`](https://github.com/rust-lang/rust/blob/cd119057160cedea245aa2679add56723f3dc784/compiler/rustc_parse/src/parser/diagnostics.rs#L214-L223) I implemented in https://github.com/rust-lang/rust/pull/94731 instead of `this.clone()` to avoid duplicate errors about unclosed delims being emitted when the `Parser` is dropped.
|
|
Rollup of 5 pull requests
Successful merges:
- #95188 ([`macro-metavar-expr`] Fix generated tokens hygiene)
- #95196 (rename LocalState::Uninitialized to Unallocated)
- #95197 (Suggest constraining param for unary ops when missing trait impl)
- #95200 (Cancel a not emitted error after parsing const generic args)
- #95207 (update Termination trait docs)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
Inline some parser functions
Some crates that do a lot of complex declarative macro expansion spend a lot of time parsing (and reparsing) tokens. These commits inline some functions for some minor speed wins.
r? `@ghost`
|
|
|
|
|
|
The call site within `Parser::bump` is hot.
Also add an inline annotation to `Parser::next_tok`. It was already
being inlined by the compiler; this just makes sure that continues.
|
|
suggest removing type ascription in bad parsing position
Not sure how to test this with the non-nightly suggestion. Didn't add a new UI test because it already manifests in an existing UI test.
Fixes #95014
|
|
TaKO8Ki:fix-not-emitted-unmatched-angle-bracket-error, r=Dylan-DPC
Fix a not emitted unmatched angle bracket error
closes #95128
|
|
|
|
|
|
|
|
Fix many spelling mistakes
Signed-off-by: codehorseman <cricis@yeah.net>
|
|
r=davidtwco,oli-obk
Suggest adding `{ .. }` around a const function call with arguments
closes #91020
|
|
Make ErrorReported impossible to construct outside `rustc_errors`
There are a few places were we have to construct it, though, and a few
places that are more invasive to change. To do this, we create a
constructor with a long obvious name.
cc #69426 `@varkor` `@eddyb` `@estebank`
I actually didn't see that I was assigned to this issue until now...
|
|
Improve `unsafe` diagnostic
This fixes: https://github.com/rust-lang/rust/issues/90880
I didn't use the exact proposed messages though.
|
|
There are a few places were we have to construct it, though, and a few
places that are more invasive to change. To do this, we create a
constructor with a long obvious name.
|
|
Signed-off-by: codehorseman <cricis@yeah.net>
|
|
|
|
More robust fallback for `use` suggestion
Our old way to suggest where to add `use`s would first look for pre-existing `use`s in the relevant crate/module, and if there are *no* uses, it would fallback on trying to use another item as the basis for the suggestion.
But this was fragile, as illustrated in issue #87613
This PR instead identifies span of the first token after any inner attributes, and uses *that* as the fallback for the `use` suggestion.
Fix #87613
|
|
notriddle:notriddle/single-colon-path-not-const-generics, r=cjgillot
diagnostics: single colon within `<>` probably, not type ascription
Fixes #94812
|
|
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
|
|
Fixes #94812
|
|
TaKO8Ki:suggest-using-double-colon-for-struct-field-type, r=cjgillot
Suggest using double colon when a struct field type include single colon
#92685
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixes #94646
|
|
Change location of where clause on GATs
Closes #89122
~Blocked on lang FCP~
r? `@nikomatsakis`
|
|
|
|
TaKO8Ki:suggest-removing-semicolon-after-derive-attribute, r=cjgillot
Suggest removing a semicolon after derive attributes
closes #93942
|
|
use current token span
|
|
Follow up to #92746. Address #94510.
|