about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
2024-06-24Suggest inline const blocks for array initializationPavel Grigorenko-33/+7
2024-06-21Rename a bunch of thingsMichael Goulet-24/+24
2024-06-20Rollup merge of #126717 - nnethercote:rustfmt-use-pre-cleanups, r=jieyouxuMatthias Krüger-0/+2
Clean up some comments near `use` declarations #125443 will reformat all `use` declarations in the repository. There are a few edge cases involving comments on `use` declarations that require care. This PR cleans up some clumsy comment cases, taking us a step closer to #125443 being able to merge. r? ``@lqd``
2024-06-20Rollup merge of #126620 - oli-obk:taint_errors, r=fee1-deadMatthias Krüger-100/+111
Actually taint InferCtxt when a fulfillment error is emitted And avoid checking the global error counter fixes #122044 fixes #123255 fixes #123276 fixes #125799
2024-06-20Add blank lines after module-level `//!` comments.Nicholas Nethercote-0/+2
Most modules have such a blank line, but some don't. Inserting the blank line makes it clearer that the `//!` comments are describing the entire module, rather than the `use` declaration(s) that immediately follows.
2024-06-19Const generic parameters aren't bounds, even if we end up erroring because ↵Oli Scherer-85/+103
of the bound that binds the parameter's type
2024-06-19Allow constraining opaque types during auto trait castingOli Scherer-1/+1
2024-06-19Allow constraining opaque types during unsizingOli Scherer-3/+3
2024-06-19Taint infcx when reporting errorsOli Scherer-15/+8
2024-06-18Auto merge of #126614 - compiler-errors:uplift-next-trait-solver, r=lcnrbors-7313/+479
Uplift next trait solver to `rustc_next_trait_solver` 🎉 There's so many FIXMEs! Sorry! Ideally this merges with the FIXMEs and we track and squash them over the near future. Also, this still doesn't build on anything other than rustc. I still need to fix `feature = "nightly"` in `rustc_type_ir`, and remove and fix all the nightly feature usage in the new trait solver (notably: let-chains). Also, sorry `@lcnr` I know you asked for me to separate the commit where we `mv rustc_trait_selection/solve/... rustc_next_trait_solver/solve/...`, but I had already done all the work by that point. Luckily, `git` understands the file moves so it should still be relatively reviewable. If this is still very difficult to review, then I can do some rebasing magic to try to separate this out. Please let me know! r? lcnr
2024-06-18Remove redundant argument from `subdiagnostic` methodOli Scherer-5/+2
2024-06-18Use a dedicated type instead of a reference for the diagnostic contextOli Scherer-2/+2
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-06-18Fix transmute goalMichael Goulet-1/+27
2024-06-18Fix impl for SolverDelegateMichael Goulet-77/+310
2024-06-18Uplift the new trait solverMichael Goulet-7260/+0
2024-06-18SolverDelegateMichael Goulet-148/+339
2024-06-18Make SearchGraph fully genericMichael Goulet-73/+49
2024-06-16Uplift OpaqueTypeKey too, use it in responseMichael Goulet-9/+3
2024-06-16Uplift ExternalConstraintDataMichael Goulet-15/+27
2024-06-16Make ExternalConstraints just carry outlivesMichael Goulet-18/+22
2024-06-16Stop using AssocKind in new solverMichael Goulet-13/+11
2024-06-16Move InferCtxtSelectExt out of eval_ctxt moduleMichael Goulet-3/+3
2024-06-16Auto merge of #126540 - jhpratt:rollup-fzzz8j3, r=jhprattbors-1/+1
Rollup of 4 pull requests Successful merges: - #125112 (Document behavior of `create_dir_all` wrt. empty path) - #126127 (Spell out other trait diagnostic) - #126309 (unify git command preperation) - #126539 (Update `Arc::try_unwrap()` docs) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-16Rollup merge of #126127 - Alexendoo:other-trait-diag, r=pnkfelixJacob Pratt-1/+1
Spell out other trait diagnostic I recently saw somebody confused about the diagnostic thinking it was suggesting to add an `as` cast. This change is longer but I think it's clearer
2024-06-16Auto merge of #126505 - compiler-errors:no-vtable, r=lcnrbors-170/+100
Only compute vtable information during codegen This PR removes vtable information from the `Object` and `TraitUpcasting` candidate sources in the trait solvers, and defers the computation of relevant information to `Instance::resolve`. This is because vtables really aren't a thing in the trait world -- they're an implementation detail in codegen. Previously it was just easiest to tangle this information together since we were already doing the work of looking at all the supertraits in the trait solver, and specifically because we use traits to represent when it's possible to call a method via a vtable (`Object` candidate) and do upcasting (`Unsize` candidate). but I am somewhat suspicious we're doing a *lot* of extra work, especially in polymorphic contexts, so let's see what perf says.
2024-06-15Rollup merge of #126525 - jieyouxu:traitsel-docs, r=compiler-errorsGuillaume Gomez-2/+2
trait_selection: remove extra words Tiny doc cleanup. Fixes https://github.com/rust-lang/rust/issues/88231.
2024-06-15Rollup merge of #126496 - compiler-errors:more-generics, r=lcnrGuillaume Gomez-143/+151
Make proof tree probing and `Candidate`/`CandidateSource` generic over interner `<TyCtxt<'tcx>>` is ugly, but will become `<I>` when things actually become generic. r? lcnr
2024-06-15Rollup merge of #126404 - compiler-errors:alias-relate-terms, r=lcnrGuillaume Gomez-1/+40
Check that alias-relate terms are WF if reporting an error in alias-relate Check that each of the left/right term is WF when deriving a best error obligation for an alias-relate goal. This will make sure that given `<i32 as NotImplemented>::Assoc = ()` will drill down into `i32: NotImplemented` since we currently treat the projection as rigid. r? lcnr
2024-06-15trait_selection: remove extra words许杰友 Jieyou Xu (Joe)-2/+2
2024-06-15Rollup merge of #126471 - oli-obk:filter_loop, r=compiler-errorsMatthias Krüger-11/+6
Use a consistent way to filter out bounds instead of splitting it into three places just a small cleanup, no logic change. Initially the code had me looking for why anything was special here, only to realize there's nothing interesting going on
2024-06-15Rollup merge of #126354 - compiler-errors:variance, r=lcnrMatthias Krüger-4/+4
Use `Variance` glob imported variants everywhere Fully commit to using the globbed variance. Could be convinced the other way, and change this PR to not use the globbed variants anywhere, but I'd rather we do one or the other. r? lcnr
2024-06-14Only compute vtable information during codegenMichael Goulet-170/+100
2024-06-14Correctly consider depth when visiting WF goalsMichael Goulet-3/+18
2024-06-14Use is_lang_item more aggressivelyMichael Goulet-78/+77
2024-06-14Add TyCtxt::is_lang_itemMichael Goulet-39/+37
2024-06-14Make proof tree probing genericMichael Goulet-38/+45
2024-06-14Make Candidate generic over internerMichael Goulet-106/+107
2024-06-14Use a consistent way to filter out bounds instead of splitting it into three ↵Oli Scherer-11/+6
places
2024-06-13Address nitsMichael Goulet-23/+30
- Remove the ValuePairs glob import - Make DummyPairs -> ValuePairs::Dummy and make it bug more - Fix WC - Make interner return `impl IntoIterator`s
2024-06-13Fix some TODOsMichael Goulet-5/+4
2024-06-13Finish uplifting all of structural_traitsMichael Goulet-187/+156
2024-06-13Rework most of structural_traits to be Interner-agnosticMichael Goulet-103/+114
2024-06-13LangItem-ify Coroutine trait in solversMichael Goulet-9/+13
2024-06-13Check that alias-relate terms are WF if reporting an error in alias-relateMichael Goulet-0/+24
2024-06-12Rollup merge of #126353 - compiler-errors:move-match, r=lcnrJubilee-2/+123
Move `MatchAgainstFreshVars` to old solver Small change I noticed when trying to uplift the relations to the new trait solver.
2024-06-12Rollup merge of #126142 - compiler-errors:trait-ref-split, r=jackh726Jubilee-99/+98
Harmonize using root or leaf obligation in trait error reporting When #121826 changed the error reporting to use root obligation and not the leafmost obligation, it didn't actually make sure that all the other diagnostics helper functions used the right obligation. Specifically, when reporting similar impl candidates we are looking for impls of the root obligation, but trying to match them against the trait ref of the leaf obligation. This does a few other miscellaneous changes. There's a lot more clean-up that could be done here, but working with this code is really grief-inducing due to how messy it has become over the years. Someone really needs to show it love. 😓 r? ``@estebank`` Fixes #126129
2024-06-12Rebase falloutMichael Goulet-7/+8
2024-06-12Stop passing traitref/traitpredicate by refMichael Goulet-30/+26
2024-06-12Stop passing both trait pred and trait refMichael Goulet-16/+18
2024-06-12Harmonize use of leaf and root obligation in trait error reportingMichael Goulet-53/+53