about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
AgeCommit message (Collapse)AuthorLines
2022-07-12arena > Rc for query resultslcnr-6/+7
2022-07-12Rollup merge of #99038 - jackh726:earlybinder-cleanup, r=lcnrDylan DPC-2/+2
Some more `EarlyBinder` cleanups First commit has a couple unrelated cleanups, but otherwise each commit is self-explanatory r? rust-lang/types
2022-07-12Move abstract const to rustc_middle::tykadmin-642/+16
2022-07-11move else block into the `Local` structDing Xiang Fei-1/+1
2022-07-11lower let-else in MIR insteadDing Xiang Fei-2/+2
2022-07-11Rollup merge of #99075 - danobi:dup_type_hint_sugg, r=petrochenkovMatthias Krüger-0/+3
Fix duplicated type annotation suggestion Before, there was more or less duplicated suggestions to add type hints. Fix by clearing more generic suggestions when a more specific suggestion is possible. This fixes #93506 .
2022-07-11cg_fulfill_obligation: expect erased regionslcnr-2/+0
2022-07-11Rollup merge of #99091 - compiler-errors:private-types-should-stay-private, ↵Dylan DPC-2/+22
r=lcnr Do not mention private types from other crates as impl candidates Fixes #99080
2022-07-11Rollup merge of #98907 - compiler-errors:plz-no-float, r=oli-obkDylan DPC-2/+20
Deny float const params even when `adt_const_params` is enabled Supersedes #98825 Fixes #98813 r? ``@oli-obk``
2022-07-11Use Visibility::is_accessible_from to make suggestion more specificMichael Goulet-5/+7
2022-07-11Do not mention private Self types from other cratesMichael Goulet-2/+20
2022-07-11Deny floats even when adt_const_params is enabledMichael Goulet-2/+20
2022-07-11Rollup merge of #99095 - rhysd:issue-99092, r=compiler-errorsMatthias Krüger-12/+12
Remove duplicate notes from error on inter-crate ambiguous impl of traits Fixes #99092
2022-07-10Don't pass InferCtxt to WfPredicatesJack Huey-23/+29
2022-07-10Don't try to resolve inference variables in WF computation, just registerJack Huey-35/+17
2022-07-10Rollup merge of #99103 - TaKO8Ki:avoid-&str-to-string-conversions, r=oli-obkMatthias Krüger-1/+1
Avoid some `&str` to `String` conversions This patch removes some `&str` to `String` conversions.
2022-07-10Remove duplicate notes from error on inter-crate ambiguous impl of traits ↵rhysd-12/+12
(fix #99092)
2022-07-10avoid some `&str` to `String` conversionsTakayuki Maeda-1/+1
2022-07-09don't allow ZST in ScalarIntRalf Jung-0/+4
There are several indications that we should not ZST as a ScalarInt: - We had two ways to have ZST valtrees, either an empty `Branch` or a `Leaf` with a ZST in it. `ValTree::zst()` used the former, but the latter could possibly arise as well. - Likewise, the interpreter had `Immediate::Uninit` and `Immediate::Scalar(Scalar::ZST)`. - LLVM codegen already had to special-case ZST ScalarInt. So instead add new ZST variants to those types that did not have other variants which could be used for this purpose.
2022-07-08Fix duplicated type annotation suggestionDaniel Xu-0/+3
Before, there was more or less duplicated suggestions to add type hints. Fix by clearing more generic suggestions when a more specific suggestion is possible. This fixes #93506 .
2022-07-08Auto merge of #98816 - estebank:implicit-sized, r=oli-obkbors-6/+6
Track implicit `Sized` obligations in type params When we evaluate `ty::GenericPredicates` we introduce the implicit `Sized` predicate of type params, but we do so with only the `Predicate` its `Span` as context, we don't have an `Obligation` or `ObligationCauseCode` we could influence. To try and carry this information through, we add a new field to `ty::GenericPredicates` that tracks both which predicates come from a type param and whether that param has any bounds already (to use in suggestions). We also suggest adding a `?Sized` bound if appropriate on E0599. Address part of #98539.
2022-07-08Auto merge of #98614 - oli-obk:take_unsound_opaque_types, r=wesleywiserbors-0/+5
don't succeed `evaluate_obligation` query if new opaque types were registered fixes #98608 fixes #98604 The root cause of all this is that in type flag computation we entirely ignore nongeneric things like struct fields and the signature of function items. So if a flag had to be set for a struct if it is set for a field, that will only happen if the field is generic, as only the generic parameters are checked. I now believe we cannot use type flags to handle opaque types. They seem like the wrong tool for this. Instead, this PR replaces the previous logic by adding a new variant of `EvaluatedToOk`: `EvaluatedToOkModuloOpaqueTypes`, which says that there were some opaque types that got hidden types bound, but that binding may not have been legal (because we don't know if the opaque type was in its defining scope or not).
2022-07-08Rollup merge of #98794 - compiler-errors:conflicting-param-env, ↵Dylan DPC-13/+71
r=michaelwoerister Highlight conflicting param-env candidates This could probably be further improved by noting _why_ equivalent param-env candidates (modulo regions) leads to ambiguity. Fixes #98786
2022-07-08Rollup merge of #98654 - nnethercote:pest-2.1.3-opt, r=pnkfelixDylan DPC-17/+10
An optimization for `pest-2.1.3` An easy win I found while looking at a profile of `pest-2.1.3`. It's also a small code cleanup. r? `@pnkfelix`
2022-07-08Highlight conflicting param-env candidatesMichael Goulet-13/+71
2022-07-07Use map_boundJack Huey-2/+2
2022-07-07Move code from rustc_trait_selection/opaque_types to better placesJack Huey-547/+60
2022-07-07Track `WellFormed` obligations with an appropriate cause, instead of ↵Esteban Küber-6/+6
`MiscObligation`
2022-07-06Rollup merge of #98519 - TaKO8Ki:add-head-span-field-to-item-and-impl-item, ↵Guillaume Gomez-32/+11
r=cjgillot Replace some `guess_head_span` with `def_span` This patch fixes a part of #97417. r? `@cjgillot`
2022-07-06use `named_span` in case of tuple variantTakayuki Maeda-1/+1
2022-07-06replace `guess_head_span` with `def_span`Takayuki Maeda-32/+11
2022-07-06Rollup merge of #98884 - davidtwco:translation-on-lints-derive, r=oli-obkDylan DPC-2/+1
macros: `LintDiagnostic` derive - Move `LintDiagnosticBuilder` into `rustc_errors` so that a diagnostic derive can refer to it. - Introduce a `DecorateLint` trait, which is equivalent to `SessionDiagnostic` or `AddToDiagnostic` but for lints. Necessary without making more changes to the lint infrastructure as `DecorateLint` takes a `LintDiagnosticBuilder` and re-uses all of the existing logic for determining what type of diagnostic a lint should be emitted as (e.g. error/warning). - Various refactorings of the diagnostic derive machinery (extracting `build_field_mapping` helper and moving `sess` field out of the `DiagnosticDeriveBuilder`). - Introduce a `LintDiagnostic` derive macro that works almost exactly like the `SessionDiagnostic` derive macro except that it derives a `DecorateLint` implementation instead. A new derive is necessary for this because `SessionDiagnostic` is intended for when the generated code creates the diagnostic. `AddToDiagnostic` could have been used but it would have required more changes to the lint machinery. ~~At time of opening this pull request, ignore all of the commits from #98624, it's just the last few commits that are new.~~ r? `@oli-obk`
2022-07-06Auto merge of #98206 - eggyal:align-to-chalk-folding-api, r=jackh726bors-21/+27
Split TypeVisitable from TypeFoldable Impl of rust-lang/compiler-team#520 following MCP approval. r? `@ghost`
2022-07-06Update TypeVisitor pathsAlan Egerton-18/+22
2022-07-05Relax constrained generics to TypeVisitableAlan Egerton-4/+6
2022-07-05Add #[derive(TypeVisitable)]Alan Egerton-2/+2
2022-07-05Auto merge of #98936 - matthiaskrgr:rollup-dvr0ucm, r=matthiaskrgrbors-4/+3
Rollup of 6 pull requests Successful merges: - #98860 (adjust dangling-int-ptr error message) - #98888 (interpret: fix CheckedBinOp behavior when overflow checking is disabled) - #98889 (Add regression test for #79467) - #98895 (bootstrap.py: Always use `.exe` for Windows) - #98920 (adapt issue-37945 codegen test to accept any order of ops) - #98921 (Refactor: remove a redundant mutable variable) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-05Rollup merge of #98921 - TaKO8Ki:refactor-fulfillment-context-select, ↵Matthias Krüger-4/+3
r=Dylan-DPC Refactor: remove a redundant mutable variable
2022-07-05lint: `LintDiagnosticBuilder` into `rustc_errors`David Wood-2/+1
Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-05Auto merge of #98584 - lcnr:region-stuff-more-beans, r=oli-obkbors-112/+16
continue nll transition by removing stuff r? `@jackh726` for now building on #98641
2022-07-05refactor: remove a redundant mutable variableTakayuki Maeda-4/+3
2022-07-04region obligations, remove `body_id`lcnr-1/+1
2022-07-04implied bounds byebye nested hir idslcnr-21/+4
2022-07-04rip out `RegionCtxt` from hir typecklcnr-67/+3
2022-07-04remove an unused `DefId`lcnr-23/+8
2022-07-04remove unused function argumentlcnr-24/+3
2022-07-01Move Sized check before first error is createdMichael Goulet-31/+31
2022-07-01Don't point at Self type if we can't find an infer variable in ambiguous ↵Michael Goulet-27/+36
trait predicate
2022-07-01Show source of ambiguity in a few more placesMichael Goulet-3/+3
2022-07-01Only label place where type is needed if span is meaningfulMichael Goulet-2/+12