about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
2022-03-27Make fatal DiagnosticBuilder yield neverMichael Goulet-2/+1
2022-03-28Auto merge of #95333 - GuillaumeGomez:auto-trait-perf-issue, r=oli-obkbors-28/+22
Fix perf issue for auto trait selection Follow-up of https://github.com/rust-lang/rust/pull/95069 which fixes the perf issue introduced by it. r? `@oli-obk`
2022-03-26Do not use ParamEnv::and to cache param-env with candidateMichael Goulet-8/+8
2022-03-27Rollup merge of #93469 - compiler-errors:issue-93450, r=estebankDylan DPC-1/+1
Skip pointing out ambiguous impls in alloc/std crates too in inference errors This generalizes the logic in `annotate_source_of_ambiguity` to skip printing ambiguity errors traits in `alloc` and `std` as well, not just `core`. While this does spot-fix the issue mentioned below, it would be nicer to generalize this logic, for example to detect when the trait predicate's `self_ty` has any numerical inference variables. Is it worthwhile to scrap this solution for one like that? Fixes #93450 r? `@estebank` feel free to reassign
2022-03-27Remove SelectionContext::allow_negative_impls fieldGuillaume Gomez-26/+2
2022-03-26Fix perf issue for auto trait selectionGuillaume Gomez-2/+20
2022-03-26Auto merge of #95149 - cjgillot:once-diag, r=estebankbors-73/+56
Remove `Session::one_time_diagnostic` This is untracked mutable state, which modified the behaviour of queries. It was used for 2 things: some full-blown errors, but mostly for lint declaration notes ("the lint level is defined here" notes). It is replaced by the diagnostic deduplication infra which already exists in the diagnostic emitter. A new diagnostic level `OnceNote` is introduced specifically for lint notes, to deduplicate subdiagnostics. As a drive-by, diagnostic emission takes a `&mut` to allow dropping the `SubDiagnostic`s.
2022-03-25when checking pointee metadata, canonicalize the Sized queryMichael Goulet-1/+11
2022-03-25Auto merge of #95280 - InfRandomness:infrandomness/Dtorck_clarification, ↵bors-1/+1
r=oli-obk Swap DtorckConstraint to DropckConstraint This change was made as per suspicion that this struct was never renamed after consistent use of DropCk. This also clarifies the meaning behind the name of this structure. Fixes https://github.com/rust-lang/rust/issues/94310
2022-03-25Auto merge of #95082 - spastorino:overlap-inherent-impls, r=nikomatsakisbors-61/+66
Overlap inherent impls r? `@nikomatsakis` Closes #94526
2022-03-25Rollup merge of #95179 - b-naber:eval-in-try-unify, r=lcnrDylan DPC-80/+124
Try to evaluate in try unify and postpone resolution of constants that contain inference variables We want code like that in [`ui/const-generics/generic_const_exprs/eval-try-unify.rs`](https://github.com/rust-lang/rust/compare/master...b-naber:eval-in-try-unify?expand=1#diff-8027038201cf07a6c96abf3cbf0b0f4fdd8a64ce6292435f01c8ed995b87fe9b) to compile. To do that we need to try to evaluate constants in `try_unify_abstract_consts`, this requires us to be more careful about what constants we try to resolve, specifically we cannot try to resolve constants that still contain inference variables. r? `@lcnr`
2022-03-25Rollup merge of #94391 - light4:issue-90319, r=estebankDylan DPC-12/+25
Fix ice when error reporting recursion errors Fixes: #90319, #92148, #93955
2022-03-24Implement impl_subject_and_oblig instead of repeating the implsSantiago Pastorino-74/+26
2022-03-24Where bounds are checked on inherent implsSantiago Pastorino-2/+36
2022-03-24Swap DtorckConstraint to DropckConstraintInfRandomness-1/+1
This change was made as per suspicion that this struct was never renamed after consistent use of DropCk. This also clarifies the meaning behind the name of this structure.
2022-03-25Fix ice when error reporting recursion errorslightning1141-12/+25
Fixes: #90319, #92148, #93955
2022-03-24Normalize both trait and inherentSantiago Pastorino-16/+9
2022-03-24Extract impl_subject_and_oglibations fn and make equate receive subjectsSantiago Pastorino-43/+42
2022-03-24Auto merge of #94876 - b-naber:thir-abstract-const-changes, r=lcnrbors-13/+84
Change Thir to lazily create constants To allow `AbstractConst`s to work with the previous thir changes we made and those we want to make, i.e. to avoid problems due to `ValTree` and `ConstValue` conversions, we instead switch to a thir representation for constants that allows us to lazily create constants. r? `@oli-obk`
2022-03-24Auto merge of #91030 - estebank:trait-bounds-are-tricky-2, r=oli-obkbors-88/+145
Properly track `ImplObligations` Instead of probing for all possible `impl`s that could have caused an `ImplObligation`, keep track of its `DefId` and obligation spans for accurate error reporting. Follow to #89580. Addresses #89418.
2022-03-23Better suggestions for Fn trait selection errorsMichael Goulet-5/+121
2022-03-24Properly track `ImplObligation`sEsteban Kuber-88/+145
Instead of probing for all possible impls that could have caused an `ImplObligation`, keep track of its `DefId` and obligation spans for accurate error reporting. Follow up to #89580. Addresses #89418. Remove some unnecessary clones. Tweak output for auto trait impl obligations.
2022-03-23Rollup merge of #95069 - GuillaumeGomez:auto-traits-rustdoc, r=oli-obkMatthias Krüger-2/+2
Fix auto traits in rustdoc Fixes #90324. cc `@matthewjasper` r? `@Aaron1011`
2022-03-23Rollup merge of #94249 - compiler-errors:better-copy-errors, r=davidtwcoMatthias Krüger-2/+2
Better errors when a Copy impl on a Struct is not self-consistent As discovered in a Zulip thread with `@nnethercote` and `@Mark-Simulacrum,` it's not immediately obvious why a field on an ADT doesn't implement `Copy`. This PR attempts to give slightly more detailed information by spinning up a fulfillment context to try to dig down and discover transitive fulfillment errors that cause `is_copy_modulo_regions` to fail on a ADT field. The error message still kinda sucks, but should only show up in the case that an existing error message was totally missing... so I think it's a good compromise for now?
2022-03-23dont use a query for lit_to_constantb-naber-1/+1
2022-03-23use NonHirLiteral instead of ScalarLiteral, move pattern related code to ↵b-naber-12/+17
pat_is_poly in IsThirPolymorphic
2022-03-23move ExprKind::Repeat arm to expr_is_polyb-naber-10/+10
2022-03-23use ParamConst in ExprKind::ConstParamb-naber-2/+6
2022-03-23remove thir::Visitor::visit_constb-naber-8/+18
2022-03-23change thir to lazily create constantsb-naber-8/+60
2022-03-22better errors when a Copy impl is not coherentMichael Goulet-2/+2
2022-03-22erase region in ParamEnvAnd and make ConstUnifyCtxt privateb-naber-8/+4
2022-03-22dont canonicalize in try_unify_abstract_consts and erase regions insteadb-naber-21/+12
2022-03-22impl_header -> impl_subjectSantiago Pastorino-1/+1
2022-03-22fix previous failures and address reviewb-naber-99/+126
2022-03-21try to evaluate in try_unifyb-naber-29/+59
2022-03-21Tidy upDeadbeef-4/+8
2022-03-21Rename `~const Drop` to `~const Destruct`Deadbeef-34/+70
2022-03-20Filter OnceNote in diagnostic infra.Camille GILLOT-73/+56
2022-03-20Extract ImplSubject informationSantiago Pastorino-37/+38
2022-03-18Minor documentation type fixes h/t @pierwillSantiago Pastorino-2/+2
2022-03-18Extract obligations_satisfiable fnSantiago Pastorino-42/+44
2022-03-18Fix inherent impls on negative coherenceSantiago Pastorino-43/+67
2022-03-18Fix incorrect auto trait displayed in rustdocGuillaume Gomez-2/+2
2022-03-18Rollup merge of #95039 - spastorino:overlap-super-predicates, r=nikomatsakisMatthias Krüger-32/+58
Make negative coherence work when there's impl negative on super predicates r? `@nikomatsakis`
2022-03-17Rollup merge of #94960 - codehorseman:master, r=oli-obkDylan DPC-7/+7
Fix many spelling mistakes Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-17Update compiler/rustc_trait_selection/src/traits/coherence.rsNiko Matsakis-1/+0
2022-03-17Use let else hereSantiago Pastorino-26/+26
2022-03-17Add more commmentsSantiago Pastorino-0/+2
2022-03-17This test now worksSantiago Pastorino-0/+1