| Age | Commit message (Collapse) | Author | Lines |
|
These seem to have no useful effect... they don't seem useful from a
code inspection point of view, and they affect anything in the test
suite.
|
|
rustc_ast: Harmonize delimiter naming with `proc_macro::Delimiter`
Compiler cannot reuse `proc_macro::Delimiter` directly due to extra impls, but can at least use the same naming.
After this PR the only difference between these two enums is that `proc_macro::Delimiter::None` is turned into `token::Delimiter::Invisible`.
It's my mistake that the invisible delimiter is called `None` on stable, during the stabilization I audited the naming and wrote the docs, but missed the fact that the `None` naming gives a wrong and confusing impression about what this thing is.
cc https://github.com/rust-lang/rust/pull/96421
r? ``@nnethercote``
|
|
Migrate ambiguous plus diagnostic to the new derive macro
r? ````@davidtwco```` ````@jyn514````
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Point at all the unnecessary trailing `#`.
Better handle interaction with outer attributes when `;` is missing.
Fix #95030.
|
|
This commit updates the signatures of all diagnostic functions to accept
types that can be converted into a `DiagnosticMessage`. This enables
existing diagnostic calls to continue to work as before and Fluent
identifiers to be provided. The `SessionDiagnostic` derive just
generates normal diagnostic calls, so these APIs had to be modified to
accept Fluent identifiers.
In addition, loading of the "fallback" Fluent bundle, which contains the
built-in English messages, has been implemented.
Each diagnostic now has "arguments" which correspond to variables in the
Fluent messages (necessary to render a Fluent message) but no API for
adding arguments has been added yet. Therefore, diagnostics (that do not
require interpolation) can be converted to use Fluent identifiers and
will be output as before.
|
|
`MultiSpan` contains labels, which are more complicated with the
introduction of diagnostic translation and will use types from
`rustc_errors` - however, `rustc_errors` depends on `rustc_span` so
`rustc_span` cannot use types like `DiagnosticMessage` without
dependency cycles. Introduce a new `rustc_error_messages` crate that can
contain `DiagnosticMessage` and `MultiSpan`.
Signed-off-by: David Wood <david.wood@huawei.com>
|
|
Suggest `i += 1` when we see `i++` or `++i`
Closes #83502 (for `i++` and `++i`; `--i` should be covered by #82987, and `i--`
is tricky to handle).
This is a continuation of #83536.
r? `@estebank`
|
|
|
|
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.
|
|
I changed the test functions to be `pub` rather than called from a
`main` function too, for easier future modification of tests.
|
|
Fixes #95208
|
|
`run-rustfix` applies all suggestions regardless of their Applicability.
There's a flag, `rustfix-only-machine-applicable`, that does what it
says, but then the produced `.fixed` file would have invalid code from
the suggestions that weren't applied. So, I moved the cases of postfix
increment, in which case multiple suggestions are given, to the
`-notfixed` test, which does not run rustfix.
I also changed the Applicability to Unspecified since MaybeIncorrect
requires that the code be valid, even if it's incorrect.
|
|
This records that the suggestions are mutually-exclusive (i.e., only one
should be applied).
|
|
|
|
|
|
|
|
|
|
This solves the TODO.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r=davidtwco,oli-obk
Suggest adding `{ .. }` around a const function call with arguments
closes #91020
|
|
|
|
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
|
|
Fixes #94812
|
|
|
|
|
|
|
|
|
|
Follow up to #92746. Address #94510.
|
|
|
|
4 - Make more use of `let_chains`
Continuation of #94376.
cc #53667
|
|
* Recover from invalid `'label: ` before block.
* Make suggestion to enclose statements in a block multipart.
* Point at `match`, `while`, `loop` and `unsafe` keywords when failing
to parse their expression.
* Do not suggest `{ ; }`.
* Do not suggest `|` when very unlikely to be what was wanted (in `let`
statements).
|
|
Continuation of #94376.
cc #53667
|
|
|
|
|
|
|
|
|
|
useless_format
map_flatten
useless_conversion
needless_bool
filter_next
clone_on_copy
needless_option_as_deref
|
|
|
|
|