about summary refs log tree commit diff
path: root/compiler/rustc_expand/messages.ftl
AgeCommit message (Collapse)AuthorLines
2025-09-14Move more early buffered lints to dyn lint diagnostics (4/N)León Orell Valerian Liehr-0/+11
2025-09-14Move more early buffered lints to dyn lint diagnostics (2/N)León Orell Valerian Liehr-0/+4
2025-09-14Move more early buffered lints to dyn lint diagnostics (1/N)León Orell Valerian Liehr-3/+11
2025-08-14mbe: Parse macro `derive` rulesJosh Triplett-1/+1
This handles various kinds of errors, but does not allow applying the derive yet. This adds the feature gate `macro_derive`.
2025-08-08mbe: Parse macro attribute rulesJosh Triplett-0/+3
This handles various kinds of errors, but does not allow applying the attributes yet. This adds the feature gate `macro_attr`.
2025-07-26Remove now un-used codeJonathan Brouwer-27/+0
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-09mbe: Refactor the diagnostic for unrecognized metavariable expressionsTrevor Gross-0/+5
Change to a structural diagnostic, update the valid list, and move the valid list to a note.
2025-07-09mbe: Refactor diagnostics for invalid metavar expression syntaxTrevor Gross-0/+21
Give a more user-friendly diagnostic about the following: * Trailing tokens within braces, e.g. `${foo() extra}` * Missing parentheses, e.g. `${foo}` * Incorrect number of arguments, with a hint about correct usage.
2025-07-01Rollup merge of #143245 - tgross35:metavariable-expr-organization, ↵Matthias Krüger-3/+3
r=petrochenkov mbe: Add tests and restructure metavariable expressions Add tests that show better diagnostics, and factor `concat` handling to a separate function. Each commit message has further details. This performs the nonfunctional perparation for further changes such as https://github.com/rust-lang/rust/pull/142950 and https://github.com/rust-lang/rust/pull/142975 .
2025-06-30mbe: Shorten `MetaVarExpr` -> `Mve` in structural diagnosticsTrevor Gross-3/+3
More diagnostic structs related to metavariable expressions will be introduced. Introduce the abbreviation "mve" which is reasonably unambiguous (`rg Mve` and `rg '(\b|_|-)mve(\b|_|-)'` return no results outside of a Thumb target feature) and use it for these diagnostic types. A new module is also created.
2025-06-24Don't include current rustc version string in feature removed helpJieyou Xu-1/+1
The version string is difficult to properly normalize out, and removing it isn't a huge deal (the user can query version info easily through `rustc --version` or `cargo --version`). The normalization options were all non-ideal: - Per-test version string normalization is nasty to maintain, and we need to maintain `n` copies of it. - Centralized compiletest normalization (with a directive opt-out) is also not ideal, because `cfg(version(..))` tests can't have those accidentally normalized out (and you'd have to remember to opt-out).
2025-06-12Make `missing_fragment_specifier` an unconditional errorTrevor Gross-1/+1
This was attempted in [1] then reverted in [2] because of fallout. Recently, this was made an edition-dependent error in [3]. Make missing fragment specifiers an unconditional error again. [1]: https://github.com/rust-lang/rust/pull/75516 [2]: https://github.com/rust-lang/rust/pull/80210 [3]: https://github.com/rust-lang/rust/pull/128006
2025-06-09Note the version and PR of removed features when using itxizheyin-0/+1
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2024-10-28Tweak `expand_incomplete_parse` warning.Nicholas Nethercote-1/+1
By using `token_descr`, as is done for many other errors, we can get slightly better descriptions in error messages, e.g. "macro expansion ignores token `let` and any following" becomes "macro expansion ignores keyword `let` and any tokens following". This will be more important once invisible delimiters start being mentioned in error messages -- without this commit, that leads to error messages such as "error at ``" because invisible delimiters are pretty printed as an empty string.
2024-10-23"innermost", "outermost", "leftmost", and "rightmost" don't need hyphensJosh Triplett-1/+1
These are all standard dictionary words and don't require hyphenation.
2024-10-05Make deprecated_cfg_attr_crate_type_name a hard errorest31-0/+6
2024-08-10rustc_expand: make a message translatablePavel Grigorenko-0/+3
2024-07-27Make `missing_fragment_specifier` an error in edition 2024Trevor Gross-0/+5
`missing_fragment_specifier` has been a future compatibility warning since 2017. Uplifting it to an unconditional hard error was attempted in 2020, but eventually reverted due to fallout. Make it an error only in edition >= 2024, leaving the lint for older editions. This change will make it easier to support more macro syntax that relies on usage of `$`. Fixes <https://github.com/rust-lang/rust/issues/40107>
2024-06-22delegation: Do not crash on qpaths without a traitVadim Petrochenkov-0/+3
2024-06-14delegation: Implement glob delegationVadim Petrochenkov-2/+5
2024-06-11Rollup merge of #125913 - fmease:early-lints-spruce-up-some-diags, r=Nadrieril许杰友 Jieyou Xu (Joe)-1/+1
Spruce up the diagnostics of some early lints Implement the various "*(note to myself) in a follow-up PR we should turn parts of this message into a subdiagnostic (help msg or even struct sugg)*" drive-by comments I left in #124417 during my review. For context, before #124417, only a few early lints touched/decorated/customized their diagnostic because the former API made it a bit awkward. Likely because of that, things that should've been subdiagnostics were just crammed into the primary message. This PR rectifies this.
2024-06-03Spruce up the diagnostics of some early lintsLeón Orell Valerian Liehr-1/+1
2024-05-28Convert `proc_macro_back_compat` lint to an unconditional error.Nicholas Nethercote-0/+3
We still check for the `rental`/`allsorts-rental` crates. But now if they are detected we just emit a fatal error, instead of emitting a warning and providing alternative behaviour. The original "hack" implementing alternative behaviour was added in #73345. The lint was added in #83127. The tracking issue is #83125. The direct motivation for the change is that providing the alternative behaviour is interfering with #125174 and follow-on work.
2024-05-17Rollup merge of #123694 - Xiretza:expand-diagnostics, r=compiler-errorsMatthias Krüger-0/+5
expand: fix minor diagnostics bug The error mentions `///`, when it's actually `//!`: ``` error[E0658]: attributes on expressions are experimental --> test.rs:4:9 | 4 | //! wah | ^^^^^^^ | = note: see issue https://github.com/rust-lang/rust/issues/15701 <https://github.com/rust-lang/rust/issues/15701> for more information = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = help: `///` is for documentation comments. For a plain comment, use `//`. ```
2024-05-15delegation: Implement list delegationVadim Petrochenkov-0/+3
```rust reuse prefix::{a, b, c} ```
2024-04-26Move some functions from `rustc_expand` to `rustc_builtin_macros`.Nicholas Nethercote-9/+0
These functions are only used in `rustc_builtin_macros`, so it makes sense for them to live there. This allows them to be changed from `pub` to `pub(crate)`.
2024-04-22rustc_expand: make diagnostic translatableXiretza-0/+5
2024-03-20make "expected paren or brace" error translatableTshepang Mbambo-0/+3
2024-02-21Rollup merge of #121288 - tshepang:make-expand-translatable, r=michaelwoeristerDylan DPC-0/+8
make rustc_expand translatable these are the last of the easy ones
2024-02-20make "proc-macro derive panicked" translatableTshepang Mbambo-0/+4
2024-02-19make "custom attribute panicked" translatableTshepang Mbambo-0/+4
2024-02-16make "invalid fragment specifier" translatableTshepang Mbambo-0/+5
2024-01-17Improved collapse_debuginfo attribute, added command-line flag (no|external|yes)Andrew Zhogin-0/+3
2023-12-10Remove edition umbrella features.Eric Huss-3/+0
2023-12-03Detect attempts to expand a macro to a match arm againNadrieril-0/+2
Because a macro invocation can expand to a never pattern, we can't rule out a `arm!(),` arm at parse time. Instead we detect that case at expansion time, if the macro tries to output a pattern followed by `=>`.
2023-10-21Mention the syntax for `use` on `mod foo;` if `foo` doesn't existEsteban Küber-0/+1
Newcomers might get confused that `mod` is the only way of defining scopes, and that it can be used as if it were `use`. Fix #69492.
2023-05-25Ensure Fluent messages are in alphabetical orderclubby789-89/+89
2023-04-25Fix static string lintsclubby789-0/+4
2023-04-10Fix typos in compilerDaniPopes-1/+1
2023-03-11Simplify message pathsest31-0/+138
This makes it easier to open the messages file while developing on features. The commit was the result of automatted changes: for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done