about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/traits/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-07-08Error on moving unsized values rather than ICE'ingmejrs-0/+4
2025-06-26Simplify IfCauseMichael Goulet-13/+5
2025-06-13Merge unboxed trait object error suggestion into regular dyn incompat errorOli Scherer-0/+2
2025-04-24Remove `weak` alias terminologyBoxy-1/+1
2025-03-12remove unnecessary variantlcnr-5/+2
2025-03-06Rollup merge of #137764 - compiler-errors:always-applicable-negative-impl, ↵Michael Goulet-2/+2
r=lcnr Ensure that negative auto impls are always applicable r? lcnr (or reassign if you dont want to review) https://github.com/rust-lang/rust/issues/68318#issuecomment-2689265030
2025-03-04Ensure that negative auto impls are always applicableMichael Goulet-2/+2
2025-03-03Tweak error code for sized checks of const/staticMichael Goulet-1/+1
2025-02-22Rollup merge of #137333 - compiler-errors:edition-2024-fresh, r=NadrierilMatthias Krüger-1/+1
Use `edition = "2024"` in the compiler (redux) Most of this is binding mode changes, which I fixed by running `x.py fix`. Also adds some miscellaneous `unsafe` blocks for new unsafe standard library functions (the setenv ones), and a missing `unsafe extern` block in some enzyme codegen code, and fixes some precise capturing lifetime changes (but only when they led to errors). cc ``@ehuss`` ``@traviscross``
2025-02-22Rollup merge of #137183 - compiler-errors:dead-regionck-code, r=lcnrMatthias Krüger-10/+0
Prune dead regionck code We never encounter `ObligationCauseCode`s that correspond to region obligations that originate from "within" a body, since we don't do HIR regionck anymore on bodies. So prune some dead code.
2025-02-22Fix binding mode problemsMichael Goulet-1/+1
2025-02-22Remove UnifyReceiver cause codeMichael Goulet-10/+0
2025-02-21don't leave assoc const unnormalized due to unconstrained paramsLukas Markeffsky-1/+4
2025-02-21Rename `InternedObligationCauseCode`.Nicholas Nethercote-15/+17
It's a misleading name, because it's not interned.
2025-02-20Move `StatementAsExpression` to where it's actually used.Nicholas Nethercote-6/+0
Also minimize some visibilities in the destination file.
2025-02-06Auto merge of #136471 - safinaskar:parallel, r=SparrowLiibors-3/+3
tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc` tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc` This is continuation of https://github.com/rust-lang/rust/pull/132282 . I'm pretty sure I did everything right. In particular, I searched all occurrences of `Lrc` in submodules and made sure that they don't need replacement. There are other possibilities, through. We can define `enum Lrc<T> { Rc(Rc<T>), Arc(Arc<T>) }`. Or we can make `Lrc` a union and on every clone we can read from special thread-local variable. Or we can add a generic parameter to `Lrc` and, yes, this parameter will be everywhere across all codebase. So, if you think we should take some alternative approach, then don't merge this PR. But if it is decided to stick with `Arc`, then, please, merge. cc "Parallel Rustc Front-end" ( https://github.com/rust-lang/rust/issues/113349 ) r? SparrowLii `@rustbot` label WG-compiler-parallel
2025-02-06Clean up trivial traversal/lift impl generator macro calls.Nicholas Nethercote-4/+0
We have four macros for generating trivial traversal (fold/visit) and lift impls. - `rustc_ir::TrivialTypeTraversalImpls` - `rustc_middle::TrivialTypeTraversalImpls` - `rustc_middle::TrivialLiftImpls` - `rustc_middle::TrivialTypeTraversalAndLiftImpls` The first two are very similar. The last one just combines the second and third one. The macros themselves are ok, but their use is a mess. This commit does the following. - Removes types that no longer need a lift and/or traversal impl from the macro calls. - Consolidates the macro calls into the smallest number of calls possible, with each one mentioning as many types as possible. - Orders the types within those macro calls alphabetically, and makes the module qualification more consistent. - Eliminates `rustc_middle::mir::type_foldable`, because the macro calls were merged and the manual `TypeFoldable` impls are better placed in `structural_impls.rs`, alongside all the other ones. This makes the code more concise. Moving forward, it also makes it more obvious where new types should be added.
2025-02-04Two minor `use` fixups.Nicholas Nethercote-2/+1
I *think* this addresses what the `FIXME` comments are asking for.
2025-02-03tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`Askar Safin-3/+3
2025-01-31Don't export the `Trivial*` macros.Nicholas Nethercote-1/+1
They're only used within the crate.
2025-01-28Properly check that array length is valid type during built-in unsizing in indexMichael Goulet-0/+3
2025-01-21remove support for the #[start] attributeRalf Jung-3/+0
2025-01-06Add derived causes for host effect predicatesMichael Goulet-17/+72
2025-01-02Remove unused fields from RepeatElementCopy obligationTaylor Cramer-4/+4
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-2/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-12-13Suggest using deref in patternsuellenberg-2/+21
Fixes #132784
2024-12-01Adjust HostEffect error spans correctly to point at argsMichael Goulet-0/+4
2024-11-23global old solver cache: use `TypingEnv`lcnr-2/+2
2024-11-23no more Reveal :(lcnr-1/+1
2024-11-08Manually register some bounds for a better spanMichael Goulet-0/+5
2024-10-27Remove ObligationCause::span() methodMichael Goulet-12/+7
2024-10-27Stop using the whole match expr span for an arm's obligation spanMichael Goulet-0/+2
2024-10-12Swap PredicateObligation to ThinVecGnomedDev-4/+5
2024-09-25Compiler: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-49/+55
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-4/+4
2024-08-08Detect `*` operator on `!Sized` expressionEsteban Küber-1/+1
``` error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/unsized-str-in-return-expr-arg-and-local.rs:15:9 | LL | let x = *""; | ^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `str` = note: all local variables must have a statically known size = help: unsized locals are gated as an unstable feature help: references are always `Sized`, even if they point to unsized data; consider not dereferencing the expression | LL - let x = *""; LL + let x = ""; | ```
2024-07-29Reformat `use` declarations.Nicholas Nethercote-9/+7
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-07Get rid of the redundant elaboration in middleMichael Goulet-1/+0
2024-06-16Uplift Reveal to rustc_type_irMichael Goulet-48/+1
2024-06-06Make middle not rely on next_trait_solverMichael Goulet-1/+1
2024-06-05Fully implement `ConstArgHasType`Boxy-0/+2
2024-05-18Uplift inspect into rustc_type_irMichael Goulet-27/+2
2024-05-11Consolidate obligation cause codes for where clausesMichael Goulet-16/+9
2024-05-10Name tweaksMichael Goulet-7/+7
2024-05-10More rename falloutMichael Goulet-18/+19
2024-05-10Rename some ObligationCauseCode variantsMichael Goulet-27/+20
2024-05-10Remove glob imports for ObligationCauseCodeMichael Goulet-11/+12
2024-04-29Remove `extern crate smallvec` from a couple of crates.Nicholas Nethercote-1/+1
2024-04-29Remove `extern crate rustc_data_structures` from numerous crates.Nicholas Nethercote-1/+1
2024-04-29Remove `extern crate rustc_macros` from `rustc_middle`.Nicholas Nethercote-0/+3