about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/messages.ftl
AgeCommit message (Collapse)AuthorLines
2025-08-25change non-defining use error messagelcnr-4/+0
2025-07-18Rollup merge of #142693 - fmease:unbound-bettering, r=compiler-errorsMatthias Krüger-5/+0
More robustly deal with relaxed bounds and improve their diagnostics Scaffolding for https://github.com/rust-lang/rust/issues/135229 (CC https://github.com/rust-lang/rust/pull/135331) Fixes https://github.com/rust-lang/rust/issues/136944 (6th commit). Fixes https://github.com/rust-lang/rust/issues/142718 (8th commit).
2025-07-18Rollup merge of #143699 - compiler-errors:async-drop-fund, r=oli-obkMatthias Krüger-1/+1
Make `AsyncDrop` check that it's being implemented on a local ADT Fixes https://github.com/rust-lang/rust/issues/143691
2025-07-18HIR ty lowering: Validate `PointeeSized` boundsLeón Orell Valerian Liehr-2/+0
2025-07-18Don't reject *multiple* relaxed bounds, reject *duplicate* ones.León Orell Valerian Liehr-3/+0
Having multiple relaxed bounds like `?Sized + ?Iterator` is actually *fine*. We actually want to reject *duplicate* relaxed bounds like `?Sized + ?Sized` because these most certainly represent a user error. Note that this doesn't mean that we accept more code because a bound like `?Iterator` is still invalid as it's not relaxing a *default* trait and the only way to define / use more default bounds is under the experimental and internal feature `more_maybe_bounds` plus `lang_items` plus unstable flag `-Zexperimental-default-bounds` (historical context: for the longest time, bounds like `?Iterator` were actually allowed and lead to a hard warning). Ultimately, this simply *reframes* the diagnostic. The scope of `more_maybe_bounds` / `-Zexperimental-default-bounds` remains unchanged as well.
2025-07-17parse `const trait Trait`Deadbeef-6/+6
2025-07-09Make AsyncDrop check that it's being implemented on a local ADTMichael Goulet-1/+1
2025-06-27hir_analysis: prohibit `dyn PointeeSized`David Wood-0/+3
2025-06-25compiler: Trim the misleading C of C-cmse from errorsJubilee Young-2/+2
2025-06-24Error on invalid signatures for interrupt ABIsFolkert de Vries-1/+1
2025-06-18AsyncDrop trait without sync Drop generates an errorAndrew Zhogin-0/+3
2025-06-14Rollup merge of #142464 - RalfJung:variadic-fn-abi-error, r=workingjubileeMatthias Krüger-1/+1
variadic functions: remove list of supported ABIs from error I think this list is problematic for multiple reasons: - It is bound to go out-of-date as it is in a very different place from where we actually define which functions support varagrs (`fn supports_varargs`). - Many of the ABIs we list only work on some targets; it makes no sense to mention "aapcs" as a possible ABI when building for x86_64. (This led to a lot of confusion in https://github.com/rust-lang/rust/issues/110505 where the author thought they should use "cdecl" and then were promptly told that "cdecl" is not a legal ABI on their target.) - Typically, when the programmer wrote `extern "foobar"`, it is because they need the "foobar" ABI. It is of little use to tell them that there are other ABIs with which varargs would work. Cc ``@workingjubilee``
2025-06-13variadic functions: remove list of supported ABIs from errorRalf Jung-1/+1
2025-06-12add `extern "custom"` functionsFolkert de Vries-0/+4
2025-06-07intrinsics: use const generic to set atomic orderingRalf Jung-4/+0
2025-05-22Rollup merge of #140218 - fmease:hirtylo-clean-up-path-low, r=compiler-errorsMatthias Krüger-1/+1
HIR ty lowering: Clean up & refactor the lowering of type-relative paths While rebasing #126651 I realized that HIR ty lowering could benefit from some *spring cleaning* now that it's been extended to handle RTN and mGCA paths. More seriously, similar to my merged PR #118668 which unified the handling of all *associated item constraints* (assoc ty, const (ACE) & fn (RTN)), this PR (commit https://github.com/rust-lang/rust/pull/140218/commits/695fcf517d8864b4812225643ef8cfc036ba9f61) partially[^1] deduplicates the resolution code for all *type-relative paths* (assoc ty, const (mGCA) & fn (RTN)). **Why**? DRY'ing that part of the code means PR #126651 will automatically support RTN paths like `Ty::AssocTy::assoc_fn(..)` and it also implies shared diagnostic code and thus better diagnostics for RTN. --- The other commits represent cleanups, renamings, moves. More notably, I've renamed path lowering methods to be a lot more descriptive, so ones lowering `QPath(Resolved)` paths now have `_resolved_` in their name and ones lowering `QPath(TypeRelative)` paths now have `_type_relative_` in their name. This should make it stupidly obvious what their purpose is. --- Best reviewed commit by commit. The changes are close to trivial but the diff might make it look hairier. r? compiler-errors [^1]: Sadly, I couldn't unify as much compared to the other PR without introducing unnecessary `unreachable!()`s or rendering the code otherwise illegible with flags and micro helper traits.
2025-05-12Fix typosomahs-1/+1
2025-05-06Eliminate unnecessary parameterLeón Orell Valerian Liehr-1/+1
2025-04-27Move inline_asm to typeck, properly handle aliasesMichael Goulet-3/+0
2025-04-10Rename some `name` variables as `ident`.Nicholas Nethercote-4/+4
It bugs me when variables of type `Ident` are called `name`. It leads to silly things like `name.name`. `Ident` variables should be called `ident`, and `name` should be used for variables of type `Symbol`. This commit improves things by by doing `s/name/ident/` on a bunch of `Ident` variables. Not all of them, but a decent chunk.
2025-04-03compiler: report error when trait object type param reference selfxtex-0/+3
Fixes #139082. Emits an error when `Self` is found in the projection bounds of a trait object. In type aliases, `Self` has no meaning, so `type A = &'static dyn B` where `trait B = Fn() -> Self` will expands to `type A = &'static Fn() -> Self` which is illegal, causing the region solver to bail out when hitting the uninferred Self. Bug: #139082 Signed-off-by: xtex <xtexchooser@duck.com>
2025-03-11Implement `#[define_opaque]` attribute for functions.Oli Scherer-6/+3
2025-03-06Rollup merge of #137808 - jswrenn:droppy-unsafe-fields, r=nnethercoteMichael Goulet-7/+0
Do not require that unsafe fields lack drop glue Instead, we adopt the position that introducing an `unsafe` field itself carries a safety invariant: that if you assign an invariant to that field weaker than what the field's destructor requires, you must ensure that field is in a droppable state in your destructor. See: - https://github.com/rust-lang/rfcs/pull/3458#discussion_r1971676100 - https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/unsafe.20fields.20RFC/near/502113897 Tracking Issue: #132922
2025-03-06Rollup merge of #137565 - compiler-errors:macro-ex, r=estebankMichael Goulet-0/+2
Try to point of macro expansion from resolver and method errors if it involves macro var In the case that a macro caller passes an identifier into a macro generating a path or method expression, point out that identifier in the context of the *macro* so it's a bit more clear how the macro is involved in causing the error. r? ``````````@estebank`````````` or reassign
2025-03-06Remove the `Option` part of range ends in the HIROli Scherer-3/+0
2025-03-03Fix associated type errors tooMichael Goulet-0/+2
2025-02-28Do not require that unsafe fields lack drop glueJack Wrenn-7/+0
Instead, we adopt the position that introducing an `unsafe` field itself carries a safety invariant: that if you assign an invariant to that field weaker than what the field's destructor requires, you must ensure that field is in a droppable state in your destructor. See: - https://github.com/rust-lang/rfcs/pull/3458#discussion_r1971676100 - https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/unsafe.20fields.20RFC/near/502113897
2025-02-25Don't require method impls for methods with `Self:Sized` bounds for impls ↵Oli Scherer-0/+2
for unsized types
2025-02-24Simplify trait error message for CoercePointee validationMichael Goulet-0/+3
2025-02-24Consolidate and rework CoercePointee and DispatchFromDyn errorsMichael Goulet-8/+5
2025-02-18Make E0599 a structured errorEsteban Küber-0/+2
2025-02-13Implement lint for definition site item shadowing tooMichael Goulet-0/+6
2025-02-12Auto merge of #136918 - GuillaumeGomez:rollup-f6h21gg, r=GuillaumeGomezbors-4/+4
Rollup of 8 pull requests Successful merges: - #134981 ( Explain that in paths generics can't be set on both the enum and the variant) - #136698 (Replace i686-unknown-redox target with i586-unknown-redox) - #136767 (improve host/cross target checking) - #136829 ([rustdoc] Move line numbers into the `<code>` directly) - #136875 (Rustc dev guide subtree update) - #136900 (compiler: replace `ExternAbi::name` calls with formatters) - #136913 (Put kobzol back on review rotation) - #136915 (documentation fix: `f16` and `f128` are not double-precision) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-11compiler: replace ExternAbi::name calls with formattersJubilee Young-4/+4
Most of these just format the ABI string, so... just format ExternAbi? This makes it more consistent and less jank when we can do it.
2025-02-11Revert "Stabilize `extended_varargs_abi_support`"Jubilee Young-1/+1
This reverts commit 685f189b4307435b83d625fea397ef36dff4e955.
2025-02-09move repr(transparent) checks to coherenceDing Xiang Fei-0/+2
2025-02-09rename the trait to validity and place a feature gate afrontDing Xiang Fei-0/+2
2025-02-09introduce CoercePointeeWellformed for coherence checks at typeck stageDing Xiang Fei-0/+6
2025-02-03Use a different hir type for patterns in pattern types than we use in match ↵Oli Scherer-3/+0
patterns
2025-02-02Maintain a list of types permitted per patternOli Scherer-1/+3
2025-01-24Properly report error when object type param default references selfMichael Goulet-1/+7
2025-01-21remove support for the #[start] attributeRalf Jung-15/+0
2025-01-08Don't allow transmuting ZSTs in dispatch_from_dyn implMichael Goulet-1/+1
2024-12-14Arbitrary self types v2: Weak, NonNull hintsAdrian Taylor-0/+6
Various types can be used as method receivers, such as Rc<>, Box<> and Arc<>. The arbitrary self types v2 work allows further types to be made method receivers by implementing the Receiver trait. With that in mind, it may come as a surprise to people when certain common types do not implement Receiver and thus cannot be used as a method receiver. The RFC for arbitrary self types v2 therefore proposes emitting specific lint hints for these cases: * NonNull * Weak * Raw pointers The code already emits a hint for this third case, in that it advises folks that the `arbitrary_self_types_pointers` feature may meet their need. This PR adds diagnostic hints for the Weak and NonNull cases.
2024-12-13Arbitrary self types v2: adjust diagnostic.Adrian Taylor-0/+6
The recently landed PR to adjust arbitrary self types was a bit overenthusiastic, advising folks to use the new Receiver trait even before it's been stabilized. Revert to the older wording of the lint in such cases.
2024-12-11Arbitrary self types v2: use Receiver traitAdrian Taylor-2/+2
In this new version of Arbitrary Self Types, we no longer use the Deref trait exclusively when working out which self types are valid. Instead, we follow a chain of Receiver traits. This enables methods to be called on smart pointer types which fundamentally cannot support Deref (for instance because they are wrappers for pointers that don't follow Rust's aliasing rules). This includes: * Changes to tests appropriately * New tests for: * The basics of the feature * Ensuring lifetime elision works properly * Generic Receivers * A copy of the method subst test enhanced with Receiver This is really the heart of the 'arbitrary self types v2' feature, and is the most critical commit in the current PR. Subsequent commits are focused on: * Detecting "shadowing" problems, where a smart pointer type can hide methods in the pointee. * Diagnostics and cleanup. Naming: in this commit, the "Autoderef" type is modified so that it no longer solely focuses on the "Deref" trait, but can now consider the "Receiver" trait instead. Should it be renamed, to something like "TraitFollower"? This was considered, but rejected, because * even in the Receiver case, it still considers built-in derefs * the name Autoderef is short and snappy.
2024-12-10Tweak wording of non-const traits used as const boundsEsteban Küber-6/+8
Use verbose suggestions and add additional labels/notes. Add more test cases for stable/nightly and feature enabled/disabled.
2024-12-02Fix const specializationMichael Goulet-2/+0
2024-11-30Rollup merge of #116161 - Soveu:varargs2, r=cjgillot许杰友 Jieyou Xu (Joe)-1/+1
Stabilize `extended_varargs_abi_support` I think that is everything? If there is any documentation regarding `extern` and/or varargs to correct, let me know, some quick greps suggest that there might be none. Tracking issue: https://github.com/rust-lang/rust/issues/100189
2024-11-27Stabilize `extended_varargs_abi_support`Soveu-1/+1