about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/messages.ftl
AgeCommit message (Collapse)AuthorLines
2025-08-07Use `tcx.short_string()` in more diagnosticsEsteban Küber-2/+0
`TyCtxt::short_string` ensures that user visible type paths aren't overwhelming on the terminal output, and properly saves the long name to disk as a side-channel. We already use these throughout the compiler and have been using them as needed when users find cases where the output is verbose. This is a proactive search of some cases to use `short_string`. We add support for shortening the path of "trait path only". Every manual use of `short_string` is a bright marker that that error should be using structured diagnostics instead (as they have proper handling of long types without the maintainer having to think abou tthem). When we don't actually print out a shortened type we don't need the "use `--verbose`" note. On E0599 show type identity to avoid expanding the receiver's generic parameters. Unify wording on `long_ty_path` everywhere.
2025-06-03Add `iter` macroOli Scherer-2/+2
This adds an `iter!` macro that can be used to create movable generators. This also adds a yield_expr feature so the `yield` keyword can be used within iter! macro bodies. This was needed because several unstable features each need `yield` expressions, so this allows us to stabilize them separately from any individual feature. Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de> Co-authored-by: Jieyou Xu <jieyouxu@outlook.com> Co-authored-by: Travis Cross <tc@traviscross.com>
2025-05-17do away with `_Self` and `TraitName` and check generic params for ↵mejrs-0/+2
rustc_on_unimplemented
2025-05-09Disarm `time` bomb (diagnostics)Jieyou Xu-2/+0
Revert "Rollup merge of #129343 - estebank:time-version, r=jieyouxu" This reverts commit 26f75a65d70773e4520634b9f6599ddf08c499e6, reversing changes made to 2572e0e8c9d5d671eccb1d5791e55c929c4720f4. Imports are modified to fix merge conflicts and remove unused ones.
2025-05-02Refactor rustc_on_unimplemented's filter parsermejrs-10/+16
2025-04-11`NonGenericOpaqueTypeParam::ty` to `arg`lcnr-2/+2
2025-04-03move `check_opaque_type_parameter_valid`lcnr-0/+7
2025-02-22Even more dead code -- we don't HIR regionck anymoreMichael Goulet-8/+0
2025-01-30Rework rustc_dump_vtableMichael Goulet-2/+0
2025-01-29Rollup merge of #133382 - mu001999-contrib:diag/fnitem, r=lcnrMatthias Krüger-0/+2
Suggest considering casting fn item as fn pointer in more cases Fixes #132648
2025-01-28Suggest considering casting fn item as fn pointer in more casesmu001999-0/+2
2025-01-21remove support for the #[start] attributeRalf Jung-3/+0
2025-01-10mir_transform: implement forced inliningDavid Wood-1/+3
Adds `#[rustc_force_inline]` which is similar to always inlining but reports an error if the inlining was not possible, and which always attempts to inline annotated items, regardless of optimisation levels. It can only be applied to free functions to guarantee that the MIR inliner will be able to resolve calls.
2024-11-09Dont suggest use<APIT>Michael Goulet-4/+4
2024-11-09Suggest turning APITs into generics in opaque overcapturesMichael Goulet-1/+5
2024-08-28Emit specific message for `time<0.3.35` inference failureEsteban Küber-0/+2
``` error[E0282]: type annotations needed for `Box<_>` --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9 | 83 | let items = format_items | ^^^^^ ... 86 | Ok(items.into()) | ---- type must be known at this point | = note: this is an inference error on crate `time` caused by a change in Rust 1.80.0; update `time` to version `>=0.3.35` ``` Partially address #127343.
2024-07-21Move all error reporting into rustc_trait_selectionMichael Goulet-0/+391
2024-03-21Make `#[diagnostic::on_unimplemented]` format string parsing more robustGeorg Semmler-0/+9
This commit fixes several issues with the format string parsing of the `#[diagnostic::on_unimplemented]` attribute that were pointed out by @ehuss. In detail it fixes: * Appearing format specifiers (display, etc). For these we generate a warning that the specifier is unsupported. Otherwise we ignore them * Positional arguments. For these we generate a warning that positional arguments are unsupported in that location and replace them with the format string equivalent (so `{}` or `{n}` where n is the index of the positional argument) * Broken format strings with enclosed }. For these we generate a warning about the broken format string and set the emitted message literally to the provided unformatted string * Unknown format specifiers. For these we generate an additional warning about the unknown specifier. Otherwise we emit the literal string as message. This essentially makes those strings behave like `format!` with the minor difference that we do not generate hard errors but only warnings. After that we continue trying to do something unsuprising (mostly either ignoring the broken parts or falling back to just giving back the literal string as provided). Fix #122391
2024-02-15make better async fn kind errorsMichael Goulet-5/+7
2023-12-04Restrict what symbols can be used in `#[diagnostic::on_unimplemented]` ↵Georg Semmler-0/+3
format strings This commit restricts what symbols can be used in a format string for any option of the `diagnostic::on_unimplemented` attribute. We previously allowed all the ad-hoc options supported by the internal `#[rustc_on_unimplemented]` attribute. For the stable attribute we only want to support generic parameter names and `{Self}` as parameters. For any other parameter an warning is emitted and the parameter is replaced by the literal parameter string, so for example `{integer}` turns into `{integer}`. This follows the general design of attributes in the `#[diagnostic]` attribute namespace, that any syntax "error" is treated as warning and subsequently ignored.
2023-11-17Add some additional warnings for duplicated diagnostic itemsGeorg Semmler-0/+4
This commit adds warnings if a user supplies several diagnostic options where we can only apply one of them. We explicitly warn about ignored options here. In addition a small test for these warnings is added.
2023-10-19Improve the warning messages for the `#[diagnostic::on_unimplemented]`Georg Semmler-0/+5
This commit improves warnings emitted for malformed on unimplemented attributes by: * Improving the span of the warnings * Adding a label message to them * Separating the messages for missing and unexpected options * Adding a help message that says which options are supported
2023-09-12`#[diagnostic::on_unimplemented]` without filtersGeorg Semmler-0/+2
This commit adds support for a `#[diagnostic::on_unimplemented]` attribute with the following options: * `message` to customize the primary error message * `note` to add a customized note message to an error message * `label` to customize the label part of the error message Co-authored-by: León Orell Valerian Liehr <me@fmease.dev> Co-authored-by: Michael Goulet <michael@errs.io>
2023-09-10Point out if a local trait has no implementationsMichael Goulet-0/+2
2023-08-30Permit recursive weak type aliasesOli Scherer-0/+1
2023-08-07Migrate a trait selection error to use diagnostic translationDeadbeef-0/+9
2023-06-28convert to fluent, make plurals workMichael Goulet-0/+10
2023-05-25Ensure Fluent messages are in alphabetical orderclubby789-7/+7
2023-05-04IAT: Introduce AliasKind::InherentLeón Orell Valerian Liehr-0/+2
2023-03-11Simplify message pathsest31-0/+22
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