about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits/specialize
AgeCommit message (Collapse)AuthorLines
2025-09-12Split AssocContainer::{InherentImpl,TraitImpl}Cameron Steffen-1/+1
2025-09-12Rename AssocItemContainer -> AssocContainerCameron Steffen-1/+1
2025-06-27Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-deadMatthias Krüger-1/+1
New const traits syntax This PR only affects the AST and doesn't actually change anything semantically. All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error r? ``@fee1-dead`` cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
2025-06-26Change const trait bound syntax from ~const to [const]Oli Scherer-1/+1
2025-06-25Remove some glob imports from the type systemMichael Goulet-5/+3
2025-04-30Use less rustc_type_ir in the compiler codebaseRomain Perier-1/+1
This commit does the following: - Replaces use of rustc_type_ir by rustc_middle - Removes the rustc_type_ir dependency - The DelayedSet type is exposed by rustc_middle so everything can be accessed through rustc_middle in a coherent manner.
2025-03-09Rollup merge of #136968 - oli-obk:bye-bye, r=compiler-errorsMatthias Krüger-14/+2
Turn order dependent trait objects future incompat warning into a hard error fixes #56484 r? ``@ghost`` will FCP when we have a crater result
2025-02-22Greatly simplify lifetime captures in edition 2024Michael Goulet-5/+2
2025-02-20Turn order dependent trait objects future incompat warning into a hard errorOli Scherer-14/+2
2025-02-01Rename `tcx.ensure()` to `tcx.ensure_ok()`Zalathar-3/+3
2025-01-03Do not project when there are unconstrained impl paramsMichael Goulet-0/+14
2024-12-22Make sure we note ambiguity causes on positive/negative impl conflictsMichael Goulet-9/+13
2024-12-02Fix const specializationMichael Goulet-5/+17
2024-12-02Reimplement specialization for const traitsMichael Goulet-18/+112
2024-11-22Simplify fulfill_implicationMichael Goulet-91/+100
2024-10-29TypingMode :thinking:lcnr-2/+4
2024-10-23nightly feature tracking: get rid of the per-feature bool fieldsRalf Jung-1/+1
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-3/+3
2024-09-06Auto merge of #128776 - Bryanskiy:deep-reject-ctxt, r=lcnrbors-3/+3
Use `DeepRejectCtxt` to quickly reject `ParamEnv` candidates The description is on the [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/144729-t-types/topic/.5Basking.20for.20help.5D.20.60DeepRejectCtxt.60.20for.20param.20env.20candidates) r? `@lcnr`
2024-09-02Use `DeepRejectCtxt` to quickly reject `ParamEnv` candidatesBryanskiy-3/+3
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_trait_selection`.Nicholas Nethercote-0/+3
2024-07-29Reformat `use` declarations.Nicholas Nethercote-17/+13
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-11Remove fully_normalizeMichael Goulet-18/+11
2024-07-08Move trait selection error reporting to its own top-level moduleMichael Goulet-59/+2
2024-06-07Only compute specializes query if specialization is enabled in the crate of ↵Michael Goulet-25/+17
the specialized impl
2024-05-23Remove `LintDiagnostic::msg`León Orell Valerian Liehr-13/+8
* instead simply set the primary message inside the lint decorator functions * it used to be this way before [#]101986 which introduced `msg` to prevent good path delayed bugs (which no longer exist) from firing under certain circumstances when lints were suppressed / silenced * this is no longer necessary for various reasons I presume * it shaves off complexity and makes further changes easier to implement
2024-05-13Remove `extern crate rustc_middle` from `rustc_trait_selection`.Nicholas Nethercote-0/+2
2024-05-10Lift `TraitRef` into `rustc_type_ir`Michael Goulet-0/+1
2024-04-30Give items related to issue 33140 a more meaningful nameLeón Orell Valerian Liehr-5/+5
2024-04-29Remove `extern crate rustc_macros` from numerous crates.Nicholas Nethercote-0/+1
2024-04-05Rollup merge of #122894 - compiler-errors:downgrade, r=lcnrGuillaume Gomez-4/+5
Move check for error in impl header outside of reporting Fixes #121006 r? lcnr test location kinda sucks, can move it if needed
2024-04-04Specialization can switch to `DefineOpaqueTypes::Yes` without having an effect.Oli Scherer-1/+6
The reason is that in specialization graph computation we use `DefiningAnchor::Error`, so there's no difference anyway. And in the other use cases, we * already errored in the specialization_graph computation, or * already errored in coherence, or * are comparing opaque types with inference variables already, or * there are no opaque types involved
2024-03-28fix few moreklensy-3/+3
warning: this argument is a mutable reference, but not used mutably --> compiler\rustc_trait_selection\src\traits\project.rs:511:12 | 511 | selcx: &mut SelectionContext<'a, 'tcx>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&SelectionContext<'a, 'tcx>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut warning: this argument is a mutable reference, but not used mutably --> compiler\rustc_trait_selection\src\traits\specialize\specialization_graph.rs:201:28 | 201 | fn iter_children(children: &mut Children) -> impl Iterator<Item = DefId> + '_ { | ^^^^^^^^^^^^^ help: consider changing to: `&Children` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
2024-03-22Move check for error in impl header outside of reportingMichael Goulet-4/+5
2024-03-22Update (doc) commentsLeón Orell Valerian Liehr-1/+1
Several (doc) comments were super outdated or didn't provide enough context. Some doc comments shoved everything in a single paragraph without respecting the fact that the first paragraph should be a single sentence because rustdoc treats these as item descriptions / synopses on module pages.
2024-03-07Apply `EarlyBinder` only to `TraitRef` in `ImplTraitHeader`Yoshitomo Nakanishi-2/+2
2024-02-29track overflowing goals for overfow errorslcnr-0/+10
2024-02-28Rename `DiagnosticBuilder` as `Diag`.Nicholas Nethercote-5/+5
Much better! Note that this involves renaming (and updating the value of) `DIAGNOSTIC_BUILDER` in clippy.
2024-02-19Prefer `DiagnosticBuilder` over `Diagnostic` in diagnostic modifiers.Nicholas Nethercote-3/+3
There are lots of functions that modify a diagnostic. This can be via a `&mut Diagnostic` or a `&mut DiagnosticBuilder`, because the latter type wraps the former and impls `DerefMut`. This commit converts all the `&mut Diagnostic` occurrences to `&mut DiagnosticBuilder`. This is a step towards greatly simplifying `Diagnostic`. Some of the relevant function are made generic, because they deal with both errors and warnings. No function bodies are changed, because all the modifier methods are available on both `Diagnostic` and `DiagnosticBuilder`.
2024-02-16Move trait into attr so it's greppableMichael Goulet-4/+4
2024-02-16Use extension trait deriveMichael Goulet-29/+3
2024-02-13Bump `indexmap`clubby789-1/+2
`swap` has been deprecated in favour of `swap_remove` - the behaviour is the same though.
2024-02-13Auto merge of #120919 - oli-obk:impl_polarity, r=compiler-errorsbors-5/+11
Merge `impl_polarity` and `impl_trait_ref` queries Hopefully this is perf neutral. I want to finish https://github.com/rust-lang/rust/pull/120835 and stop using the HIR in `coherent_trait`, which should then give us a perf improvement.
2024-02-12Stop calling `impl_polarity` when `impl_trait_ref` was also calledOli Scherer-5/+11
2024-02-12Dejargnonize substShoyu Vanilla-12/+12
2024-02-08Use `ensure` when the result of the query is not needed beyond its `Result`nessOli Scherer-1/+1
2024-01-29Stop using `String` for error codes.Nicholas Nethercote-2/+2
Error codes are integers, but `String` is used everywhere to represent them. Gross! This commit introduces `ErrCode`, an integral newtype for error codes, replacing `String`. It also introduces a constant for every error code, e.g. `E0123`, and removes the `error_code!` macro. The constants are imported wherever used with `use rustc_errors::codes::*`. With the old code, we have three different ways to specify an error code at a use point: ``` error_code!(E0123) // macro call struct_span_code_err!(dcx, span, E0123, "msg"); // bare ident arg to macro call \#[diag(name, code = "E0123")] // string struct Diag; ``` With the new code, they all use the `E0123` constant. ``` E0123 // constant struct_span_code_err!(dcx, span, E0123, "msg"); // constant \#[diag(name, code = E0123)] // constant struct Diag; ``` The commit also changes the structure of the error code definitions: - `rustc_error_codes` now just defines a higher-order macro listing the used error codes and nothing else. - Because that's now the only thing in the `rustc_error_codes` crate, I moved it into the `lib.rs` file and removed the `error_codes.rs` file. - `rustc_errors` uses that macro to define everything, e.g. the error code constants and the `DIAGNOSTIC_TABLES`. This is in its new `codes.rs` file.
2024-01-23Rename `TyCtxt::struct_span_lint_hir` as `TyCtxt::node_span_lint`.Nicholas Nethercote-1/+1
2024-01-23Rename `LintLevelsBuilder::struct_lint` as `LintLevelsBuilder::opt_span_lint`.Nicholas Nethercote-1/+1
2024-01-14`allow_internal_unstable(min_specialization)` on `newtype_index`clubby789-13/+19