| Age | Commit message (Collapse) | Author | Lines |
|
Add suggestion for moving type declaration before associated type bindings in generic arguments.
Fixes #57385.
r? @estebank
|
|
This commit combines the move lifetime and move type suggestions so that
when rustfix applies them they don't conflict with each other.
|
|
This commit extends existing suggestions to move lifetimes before types
in generic arguments to also suggest moving types behind associated type
bindings.
|
|
Rollup of 9 pull requests
Successful merges:
- #57380 (Fix Instant/Duration math precision & associativity on Windows)
- #57606 (Get rid of the fake stack frame for reading from constants)
- #57803 (Several changes to libunwind for SGX target)
- #57846 (rustdoc: fix ICE from loading proc-macro stubs)
- #57860 (Add os::fortanix_sgx::ffi module)
- #57861 (Don't export table by default in wasm)
- #57863 (Add suggestion for incorrect field syntax.)
- #57867 (Fix std::future::from_generator documentation)
- #57873 (Stabilize no_panic_pow)
Failed merges:
r? @ghost
|
|
Add suggestion for incorrect field syntax.
Fixes #57684.
This commit adds a suggestion when a `=` character is used when
specifying the value of a field in a struct constructor incorrectly
instead of a `:` character.
r? @estebank
|
|
Remove quote_*! macros
This deletes a considerable amount of test cases, some of which we may want to keep. I'm not entirely certain what the primary intent of many of them was; if we should keep them I can attempt to edit each case to continue compiling without the quote_*! macros involved.
Fixes #46849.
Fixes #12265.
Fixes #12266.
Fixes #26994.
r? @Manishearth
|
|
|
|
Add error for trailing angle brackets.
Fixes #54521.
This PR adds a error (and accompanying machine applicable
suggestion) for trailing angle brackets on function calls with a
turbofish.
r? @estebank
|
|
Use structured suggestion in stead of notes
|
|
Recover from parse errors in literal struct fields and incorrect float literals
Fix #52496.
|
|
This commit adds a suggestion when a `=` character is used when
specifying the value of a field in a struct constructor incorrectly
instead of a `:` character.
|
|
resolves #57773
|
|
|
|
This commit extends the trailing `>` detection to also work for paths
such as `Foo::<Bar>>:Baz`.
This involves making the existing check take the token that is expected
to follow the path being checked as a parameter.
Care is taken to ensure that this only happens on the construction of a
whole path segment and not a partial path segment (during recursion).
Through this enhancement, it was also observed that the ordering of
right shift token and greater than tokens was overfitted to the examples
being tested.
In practice, given a sequence of `>` characters: `>>>>>>>>>`
..then they will be split into `>>` eagerly: `>> >> >> >> >`.
..but when a `<` is prepended, then the first `>>` is split:
`<T> > >> >> >> >`
..and then when another `<` is prepended, a right shift is first again:
`Vec<<T>> >> >> >> >`
In the previous commits, a example that had two `<<` characters was
always used and therefore it was incorrectly assumed that `>>` would
always be first - but when there is a single `<`, this is not the case.
|
|
This commit pluralizes error messages when more than a single trailing
`>` character is present.
|
|
This commit adds a error (and accompanying machine applicable
suggestion) for trailing angle brackets on function calls with a
turbofish.
|
|
|
|
Add span for bad doc comment
Fixes #57382
r? @estebank
|
|
|
|
|
|
|
|
|
|
|
|
Attempt to recover from parse errors while parsing a struct's literal fields
by skipping tokens until a comma or the closing brace is found. This allows
errors in other fields to be reported.
|
|
|
|
add applicability to remaining suggestions
Fixes #50723.
I noticed that the suggestion methods on `DiagnosticBuilder` weren't actually deprecated due to #57679. This PR deprecates them properly and fixes the remaining usages.
There's also a PR for clippy at rust-lang/rust-clippy#3667.
|
|
Simplify `TokenStream` some more
These commits simplify `TokenStream`, remove `ThinTokenStream`, and avoid some clones. The end result is simpler code and a slight perf win on some benchmarks.
r? @petrochenkov
|
|
When given multiple lifetimes prior to type parameters in generic
parameters, do not ICE and print the correct suggestion.
|
|
|
|
Recover from item trailing semicolon
CC https://github.com/rust-lang/rfcs/pull/2479
r? @petrochenkov
|
|
Unaccept `extern_in_paths`
Based on completed fcp-close in https://github.com/rust-lang/rust/issues/55600, this removes `extern_in_path` (e.g. `extern::foo::bar`) from the language. The changes are primarily reversing https://github.com/rust-lang/rust/commit/32db83b16e06cb5cca72d0e6a648a8008eda0fac.
Closes https://github.com/rust-lang/rust/issues/55600
r? @petrochenkov
|
|
Modify some parser diagnostics to continue evaluating beyond the parser
Continue evaluating further errors after parser errors on:
- trailing type argument attribute
- lifetime in incorrect location
- incorrect binary literal
- missing `for` in `impl Trait for Foo`
- type argument in `where` clause
- incorrect float literal
- incorrect `..` in pattern
- associated types
- incorrect discriminator value variant error
and others. All of these were found by making `continue-parse-after-error` `true` by default to identify errors that would need few changes. There are now only a handful of errors that have any change with `continue-parse-after-error` enabled.
These changes make it so `rust` _won't_ stop evaluation after finishing parsing, enabling type checking errors to be displayed on the existing code without having to fix the parse errors.
Each commit has an individual diagnostic change with their corresponding tests.
CC #48724.
|
|
|
|
This avoids some allocations.
|
|
`TokenStream` is now almost identical to `ThinTokenStream`. This commit
removes the latter, replacing it with the former.
|
|
Make `TokenStream` less recursive.
`TokenStream` is currently recursive in *two* ways:
- the `TokenTree` variant contains a `ThinTokenStream`, which can
contain a `TokenStream`;
- the `TokenStream` variant contains a `Vec<TokenStream>`.
The latter is not necessary and causes significant complexity. This
commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`.
This reduces complexity significantly. In particular, `StreamCursor` is
eliminated, and `Cursor` becomes much simpler, consisting now of just a
`TokenStream` and an index.
The commit also removes the `Extend` impl for `TokenStream`, because it
is only used in tests. (The commit also removes those tests.)
Overall, the commit reduces the number of lines of code by almost 200.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`TokenStream` is currently recursive in *two* ways:
- the `TokenTree` variant contains a `ThinTokenStream`, which can
contain a `TokenStream`;
- the `TokenStream` variant contains a `Vec<TokenStream>`.
The latter is not necessary and causes significant complexity. This
commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`.
This reduces complexity significantly. In particular, `StreamCursor` is
eliminated, and `Cursor` becomes much simpler, consisting now of just a
`TokenStream` and an index.
The commit also removes the `Extend` impl for `TokenStream`, because it
is only used in tests. (The commit also removes those tests.)
Overall, the commit reduces the number of lines of code by almost 200.
|
|
syntax: Fix regression in diagnostics for patterns in trait method parameters
Fixes https://github.com/rust-lang/rust/issues/55036
|
|
|