summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits
AgeCommit message (Collapse)AuthorLines
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-19Encode whether foreign opaques are TAITs or notMichael Goulet-1/+1
2023-01-19Don't treat closures from other crates as localOli Scherer-22/+20
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-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 #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-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-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 #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).
2023-01-15Rollup merge of #106863 - anden3:compiler-double-spaces, r=NilstriebMatthias Krüger-1/+1
Remove various double spaces in compiler source comments. Was asked to do it by `@Nilstrieb`
2023-01-14Auto merge of #106866 - matthiaskrgr:rollup-r063s44, r=matthiaskrgrbors-3/+5
Rollup of 8 pull requests Successful merges: - #105526 (libcore: make result of iter::from_generator Clone) - #106563 (Fix `unused_braces` on generic const expr macro call) - #106661 (Stop probing for statx unless necessary) - #106820 (Deprioritize fulfillment errors that come from expansions.) - #106828 (rustdoc: remove `docblock` class from notable trait popover) - #106849 (Allocate one less vec while parsing arrays) - #106855 (rustdoc: few small cleanups) - #106860 (Remove various double spaces in the libraries.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-14Rollup merge of #106820 - m-ou-se:macro-type-error-thing, r=estebankMatthias Krüger-3/+5
Deprioritize fulfillment errors that come from expansions. Fixes (part of?) #69455
2023-01-14Auto merge of #106696 - kylematsuda:early-binder, r=lcnrbors-19/+23
Switch to `EarlyBinder` for `const_param_default` and `impl_trait_ref` queries Part of the work to close #105779 and implement https://github.com/rust-lang/types-team/issues/78. Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This PR adds `EarlyBinder` to the return type of `const_param_default` and `impl_trait_ref`, and removes their `bound_X` variants. r? `@lcnr`
2023-01-14Removed various double spaces in compiler source comments.André Vennberg-1/+1
2023-01-14Deprioritize fulfillment errors that come from expansions.Mara Bos-3/+5
2023-01-14Add note when `FnPtr` vs. `FnDef` impl traitkadmin-16/+38
I encountered an instance where an `FnPtr` implemented a trait, but I was passing an `FnDef`. To the end user, there is really no way to differentiate each of them, but it is necessary to cast to the generic function in order to compile. It is thus useful to suggest `as` in the help note, (even if the Fn output implements the trait).
2023-01-14fix various subst_identity vs skip_binderKyle Matsuda-10/+11
2023-01-14change impl_trait_ref query to return EarlyBinder; remove ↵Kyle Matsuda-20/+20
bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata
2023-01-14change usages of impl_trait_ref to bound_impl_trait_refKyle Matsuda-15/+18
2023-01-13Delay normalization bugs instead of reporting themMichael Goulet-8/+4
2023-01-13Suggest lifetime bound in illegal Copy implMichael Goulet-14/+30
2023-01-13copy self type is implied wfMichael Goulet-1/+14
2023-01-13Check ADT fields for copy implementations considering regionsMichael Goulet-14/+36
2023-01-13Rebase conflictsMichael Goulet-7/+7
2023-01-13Consolidate two almost duplicated fn info extraction routinesMichael Goulet-84/+138
2023-01-13Rollup merge of #106754 - compiler-errors:ty-infer-method-is-confusing, r=lcnrYuki Okushi-2/+5
Rename `Ty::is_ty_infer` -> `Ty::is_ty_or_numeric_infer` Makes sure people are aware that they may have a type variable *or* an int/float variable. r? `@oli-obk` https://github.com/rust-lang/rust/pull/106322#issuecomment-1376913539 but I could instead implement your solution, let me know. (This will conflict with #106322 for now, ignore that :smile:)
2023-01-13Auto merge of #106004 - fee1-dead-contrib:const-closures, r=oli-obkbors-16/+20
Const closures cc https://github.com/rust-lang/rust/issues/106003
2023-01-12is_ty_infer -> is_ty_or_numeric_inferMichael Goulet-2/+5
2023-01-12Rollup merge of #106322 - compiler-errors:CollectAllMismatches-infer-vars, ↵nils-5/+8
r=oli-obk Handle inference variables in `CollectAllMismatches` correctly 1. Fix #106240 2. Treat int/float type variables correctly (see `src/test/ui/iterators/invalid-iterator-chain-with-int-infer.rs`), so we can point out things like "`Iterator::Item` changed to `{integer}` here"
2023-01-12Auto merge of #106760 - compiler-errors:rollup-0bogyco, r=compiler-errorsbors-55/+118
Rollup of 8 pull requests Successful merges: - #103236 (doc: rewrite doc for signed int::{carrying_add,borrowing_sub}) - #103800 (Stabilize `::{core,std}::pin::pin!`) - #106097 (Migrate mir_build diagnostics 2 of 3) - #106170 (Move autoderef to `rustc_hir_analysis`) - #106323 (Stabilize f16c_target_feature) - #106360 (Tweak E0277 `&`-removal suggestions) - #106524 (Label `struct/enum constructor` instead of `fn item`, mention that it should be called on type mismatch) - #106739 (Remove `<dyn AstConv<'tcx>>::fun(c, ...)` calls in favour of `c.astconv().fun(...)`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-11Rollup merge of #106360 - estebank:remove-borrow-suggestion, r=compiler-errorsMichael Goulet-34/+94
Tweak E0277 `&`-removal suggestions Fix #64068, fix #84837.
2023-01-11Rollup merge of #106170 - compiler-errors:autoderef-to-analysis, r=lcnrMichael Goulet-21/+24
Move autoderef to `rustc_hir_analysis` Not sure if this is a change we actually want, but autoderef really is only (functionally) used by `rustc_hir_analysis` and `rustc_hir_typeck`, so it probably should live there. Instead, implement a separate autoderef helper in `TypeErrCtxt` for the one use-case that goes against the ordering of the crate graph..
2023-01-12Rollup merge of #106748 - clubby789:on-unimplemented-fmt-verify, ↵Matthias Krüger-29/+32
r=compiler-errors Clean up `OnUnimplementedFormatString::verify` Lift the always-allowed symbols to a static array and replace a `match iter().find(...)` with `iter().any(...)`
2023-01-12Rollup merge of #106596 - estebank:verbose-e0271, r=compiler-errorsMatthias Krüger-7/+46
Hide more of long types in E0271 Fix #40186.
2023-01-12Rollup merge of #106309 - compiler-errors:prefer-non-err-candidates, r=oli-obkMatthias Krüger-1/+5
Prefer non-`[type error]` candidates during selection Fixes #102130 Fixes #106351 r? types note: Alternatively we could filter out error where-clauses during param-env construction? But we still need to filter out impls with errors during `match_impl`, I think.
2023-01-12fix fmt and blessDeadbeef-6/+2
2023-01-12attempt to make a minimal example workDeadbeef-16/+24
2023-01-11Clean up `OnUnimplementedFormatString::verify`clubby789-29/+32