about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits
AgeCommit message (Collapse)AuthorLines
2020-11-02Address some code reviewsYuki Okushi-94/+85
2020-11-02Separate complex multispan into some notesYuki Okushi-29/+114
2020-10-30Remove implicit `Continue` typeLeSeulArtichaut-8/+8
2020-10-30Use `ControlFlow::is{break,continue}`LeSeulArtichaut-3/+4
2020-10-30TypeVisitor: use `ControlFlow` in rustc_{infer,lint,trait_selection}LeSeulArtichaut-60/+67
2020-10-29Rollup merge of #78422 - estebank:fix-78372, r=pnkfelixJonas Schievink-7/+13
Do not ICE on invalid input Fix #78372.
2020-10-28Rollup merge of #78365 - lcnr:const-eval-obj-safety, r=oli-obkDylan DPC-47/+99
check object safety of generic constants As `Self` can only be effectively used in constants with `const_evaluatable_checked` this should not matter outside of it. Implements the first item of #72219 > Object safety interactions with constants r? @oli-obk for now cc @nikomatsakis
2020-10-27Add unsized_fn_params featureSantiago Pastorino-2/+2
2020-10-26Do not ICE on invalid inputEsteban Küber-7/+13
2020-10-26debug log `AbstractConst::new`Bastian Kauschke-0/+1
2020-10-26Rollup merge of #78214 - estebank:match-semicolon, r=oli-obkDylan DPC-5/+5
Tweak match arm semicolon removal suggestion to account for futures * Tweak and extend "use `.await`" suggestions * Suggest removal of semicolon on prior match arm * Account for `impl Future` when suggesting semicolon removal * Silence some errors when encountering `await foo()?` as can't be certain what the intent was *Thanks to https://twitter.com/a_hoverbear/status/1318960787105353728 for pointing this out!*
2020-10-25check for object safety violations in constantsBastian Kauschke-47/+98
2020-10-24Rollup merge of #78272 - lcnr:abstract-const-unused-node, r=oli-obkJonas Schievink-21/+64
const_evaluatable_checked: deal with unused nodes + div r? @oli-obk
2020-10-23review commentsEsteban Küber-14/+10
2020-10-23Do not ICE with TraitPredicates containing [type error]Esteban Küber-6/+13
Fix #77919.
2020-10-23Tweak "use `.await`" suggestionEsteban Küber-5/+5
2020-10-23reviewBastian Kauschke-32/+36
2020-10-23const_eval_checked: deal with unused nodes + divBastian Kauschke-12/+51
2020-10-22Normalize when finding trait object candidatesMatthew Jasper-65/+66
2020-10-21Fix ICE from projection cycleMatthew Jasper-20/+9
Cycles in normalization can cause evaluations to change from Unknown to Err. This means that some selection that were applicable no longer are. To avoid this: * Selection candidates that are known to be applicable are prefered over candidates that are not. * We don't ICE if a candidate is no longer applicable.
2020-10-21Rollup merge of #78002 - estebank:issue-77598, r=oli-obkYuki Okushi-48/+63
Tweak "object unsafe" errors CC #77598.
2020-10-20Rollup merge of #78076 - est31:orphan_mod, r=Mark-SimulacrumGuillaume Gomez-0/+0
Move orphan module-name/mod.rs files into module-name.rs files
2020-10-20review commentsEsteban Küber-45/+46
2020-10-20Tweak "object unsafe" errorsEsteban Küber-28/+42
Fix #77598.
2020-10-20Rollup merge of #78111 - SNCPlay42:not-always-self, r=lcnrYuki Okushi-15/+15
Trait predicate ambiguities are not always in `Self` When reporting ambiguities in trait predicates, the compiler incorrectly assumed the ambiguity was always in the type the trait should be implemented on, and never the generic parameters of the trait. This caused silly suggestions for predicates like `<KnownType as Trait<_>>`, such as giving explicit types to completely unrelated variables that happened to be of type `KnownType`. This also reverts #73027, which worked around this issue in some cases and does not appear to be necessary any more. fixes #77982 fixes #78055
2020-10-19don't assume trait ambiguity happens in `Self`SNCPlay42-15/+15
2020-10-19Auto merge of #77908 - bugadani:obl-forest, r=nnethercotebors-6/+4
Try to make ObligationForest more efficient This PR tries to decrease the number of allocations in ObligationForest, as well as moves some cold path code to an uninlined function.
2020-10-18Move orphan module-name/mod.rs files into module-name.rs filesest31-0/+0
2020-10-18Auto merge of #77306 - lcnr:inline-ok, r=eddybbors-4/+7
normalize substs while inlining fixes #68347 or more precisely, this fixes the same ICE in rust analyser as veloren is pinned to a specific nightly and had an error with the current one. I didn't look into creating an MVCE here as that seems fairly annoying, will spend a few minutes doing so rn. (failed) r? `@eddyb` cc `@bjorn3`
2020-10-16Review commentsJack Huey-13/+12
2020-10-16map_bound_ref -> rebindJack Huey-37/+32
2020-10-16Use map_bound(_ref) instead of Binder::bind when possibleJack Huey-40/+60
2020-10-15Turn Outcome into an opaque type to remove some runtime checksDániel Buga-6/+4
2020-10-15Auto merge of #77873 - sexxi-goose:use_tuple_inference_for_closures, ↵bors-9/+49
r=nikomatsakis Replace tuple of infer vars for upvar_tys with single infer var This commit allows us to decide the number of captures required after completing capture ananysis, which is required as part of implementing RFC-2229. closes https://github.com/rust-lang/project-rfc-2229/issues/4 r? `@nikomatsakis`
2020-10-14Remove unused code from remaining compiler cratesest31-4/+0
2020-10-13Replace absolute paths with relative onesest31-6/+7
Modern compilers allow reaching external crates like std or core via relative paths in modules outside of lib.rs and main.rs.
2020-10-12Auto merge of #77792 - matthewjasper:instrument-trait-selection, r=oli-obkbors-290/+166
Use tracing spans in rustc_trait_selection Spans are very helpful when debugging this code. It's also hot enough to make a good benchmark. r? `@oli-obk`
2020-10-13Rollup merge of #77550 - lcnr:ty-dep-path-ct-cleanup, r=ecstatic-morseYuki Okushi-12/+2
add shims for WithOptConstParam query calls r? @ecstatic-morse @eddyb
2020-10-11Use tracing spans in rustc_trait_selectionMatthew Jasper-290/+166
2020-10-11traits diagnostics: Don't print closure/generator upvar_tys tupleAman Arora-1/+23
Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
2020-10-11Always return tupled_upvar_tys for Closure/Generator consituent tysAman Arora-20/+4
Depending on if upvar_tys inferred or not, we were returning either an inference variable which later resolves to a tuple or else the upvar tys themselves Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
2020-10-11Replace tuple of infer vars for upvar_tys with single infer varRoxane-9/+43
This commit allows us to decide the number of captures required after completing capture ananysis, which is required as part of implementing RFC-2229. Co-authored-by: Aman Arora <me@aman-arora.com> Co-authored-by: Jenny Wills <wills.jenniferg@gmail.com>
2020-10-09Add find_map_relevant_implDániel Buga-9/+3
2020-10-07normalize substs during inliningBastian Kauschke-3/+6
2020-10-07normalize in codegen_fulfill_obligationsBastian Kauschke-4/+4
2020-10-06Fix tests from rebaseMatthew Jasper-17/+18
2020-10-06Fix rebaseMatthew Jasper-4/+4
2020-10-06Deduplicate item bounds after normalizationMatthew Jasper-17/+40
2020-10-06Don't require lifetime super-bounds on traits apply to trait objects of that ↵Matthew Jasper-14/+17
trait
2020-10-06Normalize super trait bounds when confirming object candidatesMatthew Jasper-9/+20