| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Allocate one less vec while parsing arrays
Probably does not matter, but imo a little bit nicer.
|
|
|
|
Improve some comments and names in parser
Just a tiny drive-by cleanup.
|
|
Emit a single error for contiguous sequences of unknown tokens
Closes #106101
On encountering a sequence of identical source characters which are unknown tokens, note the amount of subsequent characters and advance past them silently. The old behavior was to emit an error and 'help' note for every single one.
`@rustbot` label +A-diagnostics +A-parser
|
|
|
|
|
|
|
|
|
|
Const closures
cc https://github.com/rust-lang/rust/issues/106003
|
|
|
|
|
|
fmease:recover-where-clause-before-tuple-struct-body, r=estebank
Recover from where clauses placed before tuple struct bodies
Open to any suggestions regarding the phrasing of the diagnostic.
Fixes #100790.
`@rustbot` label A-diagnostics
r? diagnostics
|
|
|
|
|
|
Fix #82051.
|
|
Fix #79161.
|
|
|
|
fix comment for `TokenCursor::desugar`
the hashes of the text were forgotten.
|
|
Rollup of 9 pull requests
Successful merges:
- #104531 (Provide a better error and a suggestion for `Fn` traits with lifetime params)
- #105899 (`./x doc library --open` opens `std`)
- #106190 (Account for multiple multiline spans with empty padding)
- #106202 (Trim more paths in obligation types)
- #106234 (rustdoc: simplify settings, help, and copy button CSS by not reusing)
- #106236 (docs/test: add docs and a UI test for `E0514` and `E0519`)
- #106259 (Update Clippy)
- #106260 (Fix index out of bounds issues in rustdoc)
- #106263 (Formatter should not try to format non-Rust files)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
the hashes of the text were forgotten.
|
|
Detect diff markers in the parser
Partly address #32059.
|
|
r=compiler-errors
Rename `Rptr` to `Ref` in AST and HIR
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
|
|
Currently, given `Fn`-family traits with lifetime params like
`Fn<'a>(&'a str) -> bool`, many unhelpful errors show up. These are a
bit confusing.
This commit allows these situations to suggest simply using
higher-ranked trait bounds like `for<'a> Fn(&'a str) -> bool`.
|
|
|
|
|
|
|
|
Partly address #32059.
|
|
Properly calculate best failure in macro matching
Previously, we used spans. This was not good. Sometimes, the span of the token that failed to match may come from a position later in the file which has been transcribed into a token stream way earlier in the file. If precisely this token fails to match, we think that it was the best match because its span is so high, even though other arms might have gotten further in the token stream.
We now try to properly use the location in the token stream.
This needs a little cleanup as the `best_failure` field is getting out of hand but it should be mostly good to go. I hope I didn't violate too many abstraction boundaries..
|
|
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already
as well.
|
|
Recover `fn` keyword as `Fn` trait in bounds
`impl fn()` -> `impl Fn()`
Fixes #82515
|
|
r=compiler-errors
Always suggest as `MachineApplicable` in `recover_intersection_pat`
This resolves one FIXME in `recover_intersection_pat` by always applying `MachineApplicable` when suggesting, as `bindings_after_at` is now stable.
This also separates a test to apply `// run-rustfix`.
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
|
|
error parsing lifetime following by Sized and message + between them
Fixes #102598
|
|
Remove unused imports
|
|
|
|
Allow .. to be parsed as let initializer
.. and ..= are valid expressions, however when used in a let statement
it is not parsed.
Fixes #105634
|
|
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
clippy::complexity fixes
filter_next
needless_question_mark
bind_instead_of_map
manual_find
derivable_impls
map_identity
redundant_slicing
skip_while_next
unnecessary_unwrap
needless_bool
r? `@compiler-errors`
|
|
filter_next
needless_question_mark
bind_instead_of_map
manual_find
derivable_impls
map_identity
redundant_slicing
skip_while_next
unnecessary_unwrap
needless_bool
|
|
|
|
|
|
.. and ..= are valid expressions, however when used in a let statement
it is not parsed.
|
|
Suggest impl in the scenario of typo with fn
Fixes #105366
|
|
Properly handle postfix inc/dec in standalone and subexpr scenarios
Fixes #104867
r? `@estebank`
|
|
detect the pattern at the general site parse_impl_ty()
this will fix #102598
|
|
Previously, we used spans. This was not good. Sometimes, the span of the
token that failed to match may come from a position later in the file
which has been transcribed into a token stream way earlier in the file.
If precisely this token fails to match, we think that it was the best
match because its span is so high, even though other arms might have
gotten further in the token stream.
We now try to properly use the location in the token stream.
|
|
Remove `token::Lit` from `ast::MetaItemLit`.
Currently `ast::MetaItemLit` represents the literal kind twice. This PR removes that redundancy. Best reviewed one commit at a time.
r? `@petrochenkov`
|
|
Detect spurious ; before assoc fn body
Fixes #105226
r? ``@TaKO8Ki``
|