summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
AgeCommit message (Collapse)AuthorLines
2023-01-20Rollup merge of #107061 - compiler-errors:new-solver-new-candidates-3, r=lcnrMichael Goulet-20/+202
Implement some more new solver candidates and fix some bugs First, fix some bugs: 1. `IndexVec::drain_enumerated(a..b)` does not give us an iterator of index keys + items enumerated from `a..b`, but from `0..(b-a)`... That caused a bug. See first commit for the fix. 2. Implement the `_: Trait` ambiguity hack. I put it in assemble, let me know if it should live elsewhere. This is important, since we otherwise consider `_: Sized` to have no solutions, and nothing passes! 3. Swap `Ambiguity` and `Unimplemented` cases for the new solver. Sorry for accidentally swapping them 😄 4. Check GATs' own predicates during projection confirmation. Then implement a few builtin traits: 5. Implement `PointerSized`. Pretty independent. 6. Implement `Fn` family of traits for fnptr, fndef, and closures. Closures are currently broken because `FulfillCtxt::relationships` is intentionally left unimplemented. See comment in the test. r? ```@lcnr```
2023-01-20Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnrbors-23/+70
Check ADT fields for copy implementations considering regions Fixes #88901 r? `@ghost`
2023-01-20Auto merge of #107106 - matthiaskrgr:rollup-g7r1ep0, r=matthiaskrgrbors-8/+26
Rollup of 6 pull requests Successful merges: - #106699 ([drop tracking] Visit break expressions ) - #106738 (Fix known-bug annotations) - #106891 (Tweak "borrow closure argument" suggestion) - #106928 (add raw identifier for keyword in suggestion) - #107065 (Clippy: Make sure to include in beta: Move `unchecked_duration_subtraction` to pedantic) - #107068 (autoderive Subdiagnostic for AddtoExternBlockSuggestion) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-20Auto merge of #107105 - matthiaskrgr:rollup-rkz9t7r, r=matthiaskrgrbors-22/+20
Rollup of 8 pull requests Successful merges: - #106783 (Recover labels written as identifiers) - #106973 (Don't treat closures from other crates as local) - #106979 (Document how to get the type of a default associated type) - #107053 (signal update string representation for haiku.) - #107058 (Recognise double-equals homoglyph) - #107067 (Custom MIR: Support storage statements) - #107076 (Added const-generic ui test case for issue #106419) - #107091 (Fix broken format strings in `infer.ftl`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-20Rollup merge of #106891 - estebank:issue-45727, r=petrochenkovMatthias Krüger-8/+26
Tweak "borrow closure argument" suggestion Fix #45727.
2023-01-20Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnrMatthias Krüger-22/+20
Don't treat closures from other crates as local fixes #104817 r? `@lcnr` Specialization can prefer an impl for an opaque type over a blanket impls that also matches. If the blanket impl only applies if an auto-trait applies, we look at the hidden type of the opaque type to see if that implements the auto trait. The hidden type can be a closure or generator, and thus we will end up seeing these types in coherence and have to handle them properly.
2023-01-20Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstriebbors-9/+9
Remove some `ref` patterns from the compiler Previous PR: https://github.com/rust-lang/rust/pull/105368 r? `@Nilstrieb`
2023-01-19Tweak "borrow closure argument" suggestionEsteban Küber-8/+26
Fix #45727.
2023-01-19trait solver: Implement Fn traits and tuple traitMichael Goulet-7/+142
2023-01-19trait solver: PointerSizedMichael Goulet-2/+39
2023-01-19swap Ambiguity and Unimplemented in new trait engineMichael Goulet-2/+4
2023-01-19Assert goal is fully normalized during assembleMichael Goulet-1/+4
2023-01-19Encode whether foreign opaques are TAITs or notMichael Goulet-1/+1
2023-01-19HACK: self ty ambiguity hackMichael Goulet-1/+11
2023-01-19Fix IndexVec::drain_enumeratedMichael Goulet-10/+5
2023-01-19Don't treat closures from other crates as localOli Scherer-22/+20
2023-01-18Rollup merge of #107030 - albertlarsan68:patch-3, r=lcnrMichael Goulet-1/+1
Correct typo https://github.com/rust-lang/rust/pull/106718#discussion_r1073508490
2023-01-18Rollup merge of #107023 - scottmcm:stop-shouting, r=NilstriebMichael Goulet-24/+24
Stop using `BREAK` & `CONTINUE` in compiler Switching them to `Break(())` and `Continue(())` instead. Entirely search-and-replace, though there's one spot where rustfmt insisted on a reformatting too. libs-api would like to remove these constants (https://github.com/rust-lang/rust/pull/102697#issuecomment-1385705202), so stop using them in compiler to make the removal PR later smaller.
2023-01-18Handle structural traits more gracefullyMichael Goulet-215/+212
2023-01-18no subtyping in the new trait solverMichael Goulet-34/+23
2023-01-18Sized, Copy/CloneMichael Goulet-3/+151
2023-01-18Auto and alias traitsMichael Goulet-21/+164
2023-01-18Assemble object bound candidatesMichael Goulet-0/+52
2023-01-18implement consider_assumptionMichael Goulet-10/+70
2023-01-18Canonicalize trait solver response inside probeMichael Goulet-24/+25
2023-01-18Correct typoAlbert Larsan-1/+1
2023-01-17Stop using `BREAK` & `CONTINUE` in compilerScott McMurray-24/+24
Switching them to `Break(())` and `Continue(())` instead. libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
2023-01-18add commentlcnr-0/+1
2023-01-18add note about indirect cycleslcnr-0/+4
2023-01-18update project to emulate a projection cachelcnr-14/+124
2023-01-18add `eq` to `InferCtxtExt`lcnr-38/+49
2023-01-18remove assembly context and impl a bit morelcnr-163/+311
2023-01-18instantiate canonical vars eagerlylcnr-485/+509
2023-01-18update cachelcnr-112/+89
2023-01-17Rollup merge of #106970 - kylematsuda:earlybinder-item-bounds, r=lcnrMatthias Krüger-6/+5
Switch to `EarlyBinder` for `item_bounds` query Part of the work to finish #105779 (also see https://github.com/rust-lang/types-team/issues/78). Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `item_bounds` query and removes `bound_item_bounds`. r? `@lcnr`
2023-01-17Rollup merge of #106834 - compiler-errors:new-solver-did-changed, r=lcnrMatthias Krüger-1/+1
new trait solver: only consider goal changed if response is not identity I think this is the right way of implementing it.. r? `@lcnr`
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-17/+17
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17new trait solver: only consider goal changed if response is not identityMichael Goulet-1/+1
2023-01-17change item_bounds query to return EarlyBinder; remove bound_item_bounds queryKyle Matsuda-6/+5
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-17/+17
2023-01-17Untouch back perf sensetive code :sweat_smile:Maybe Waffle-5/+7
2023-01-17Review suggestionsMaybe Waffle-1/+1
2023-01-17Don't call closures immediately, use `try{}` blocksMaybe Waffle-17/+15
2023-01-16Rollup merge of #106835 - compiler-errors:new-solver-gat-rebase-oops, r=lcnrMatthias Krüger-1/+1
new trait solver: rebase impl substs for gats correctly you might've caught this while working on projection code, if so then you can close this pr r? `@lcnr`
2023-01-16Auto merge of #106395 - compiler-errors:rework-predicates, r=eholkbors-46/+41
Rework some `predicates_of`/`{Generic,Instantiated}Predicates` code 1. Make `instantiate_own` return an iterator, since it's a bit more efficient and easier to work with 2. Remove `bound_{explicit,}_predicates_of` -- these `bound_` methods in particular were a bit awkward to work with since `ty::GenericPredicates` *already* acts kinda like an `EarlyBinder` with its own `instantiate_*` methods, and had only a few call sites anyways. 3. Implement `IntoIterator` for `InstantiatedPredicates`, since it's *very* commonly being `zip`'d together.
2023-01-15Remove bound_{explicit,}_item_boundsMichael Goulet-7/+6
2023-01-15Make InstantiatedPredicates impl IntoIteratorMichael Goulet-33/+27
2023-01-15instantiate_own doesn't need to return a pair of vectorsMichael Goulet-6/+8
2023-01-15Auto merge of #106742 - compiler-errors:new-solver-make-it-not-ice, r=lcnrbors-39/+98
Implement some FIXME methods in the new trait solver Implement just enough of the solver's response logic to make it not ICE. Also, fix a bug with `no_bound_vars` call failing due to canonical bound vars. r? `@lcnr`
2023-01-15Auto merge of #106171 - compiler-errors:consolidate-extract_callable_info, ↵bors-84/+138
r=estebank,lcnr Consolidate two almost duplicated fn info extraction routines Moves `extract_callable_info` up to trait selection, because it was being (almost) duplicated fully there for similar diagnostic purposes. This also generalizes the diagnostics we can give slightly (see UI test).