about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
2023-02-15Use target instead of machine for mir interpreter integer handling.Oli Scherer-1/+1
The naming of `machine` only makes sense from a mir interpreter internals perspective, but outside users talk about the `target` platform
2023-02-15Auto merge of #107940 - BoxyUwU:const_ty_assertion_use_semantic_equality, ↵bors-2/+22
r=compiler-errors use semantic equality for const param type equality assertion Fixes #107898 See added test for what caused this ICE --- The current in assertion in `relate.rs` is rather inadequate when keeping in mind future expansions to const generics: - it will ICE when there are infer vars in a projection in a const param ty - it will spurriously return false when either ty has infer vars because of using `==` instead of `infcx.at(..).eq` - i am also unsure if it would be possible with `adt_const_params` to craft a situation where the const param type is not wf causing `normalize_erasing_regions` to `bug!` when we would have emitted a diagnostic. This impl feels pretty Not Great to me although i am not sure what a better idea would be. - We have to have the logic behind a query because neither `relate.rs` or `combine.rs` have access to trait solving machinery (without evaluating nested obligations this assert will become _far_ less useful under lazy norm, which consts are already doing) - `relate.rs` does not have access to canonicalization machinery which is necessary in order to have types potentially containing infer vars in query arguments. We could possible add a method to `TypeRelation` to do this assertion rather than a query but to avoid implementing the same logic over and over we'd probably end up with the logic in a free function somewhere in `rustc_trait_selection` _anyway_ so I don't think that would be much better. We could also just remove this assertion, it should not actually be necessary for it to be present. It has caught some bugs in the past though so if possible I would like to keep it. r? `@compiler-errors`
2023-02-15Add specialized variants of `mk_region`.Nicholas Nethercote-7/+6
Much like there are specialized variants of `mk_ty`. This will enable some optimization in the next commit. Also rename the existing `re_error*` functions as `mk_re_error*`, for consistency.
2023-02-14Auto merge of #108056 - matthiaskrgr:rollup-oa6bxvh, r=matthiaskrgrbors-2/+26
Rollup of 9 pull requests Successful merges: - #107573 (Update the minimum external LLVM to 14) - #107626 (Fix `x fix` on the standard library itself) - #107673 (update ICU4X to 1.1.0) - #107733 (Store metrics from `metrics.json` to CI PGO timer) - #108007 (Use `is_str` instead of string kind comparison) - #108033 (add an unstable `#[rustc_coinductive]` attribute) - #108039 (Refactor refcounted structural_impls via functors) - #108040 (Use derive attributes for uninteresting traversals) - #108044 (interpret: rename Pointer::from_addr → from_addr_invalid) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-14Rollup merge of #108033 - lcnr:coinductive-attr, r=compiler-errorsMatthias Krüger-2/+26
add an unstable `#[rustc_coinductive]` attribute useful to test coinduction, especially in the new solver. as this attribute should remain permanently unstable I don't think this needs any official approval. cc ``@rust-lang/types`` had to weaken the check for stable query results in the solver to prevent an ICE if there's a coinductive cycle with constraints. r? ``@compiler-errors``
2023-02-14Rollup merge of #108029 - oli-obk:🞋_usize, r=RalfJungMatthias Krüger-1/+1
s/eval_usize/eval_target_usize/ for clarity r? `@nnethercote` as discussed in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60Const.60.20and.20.60usize.60.2F.60u64.60 it is unclear what `usize` means and why we use a `u64` for something talking about `usize`. This renaming should make it clear that we're talking about `usize`s on the target platform, irrespective of the compiler host platform.
2023-02-14Rollup merge of #107739 - spastorino:check-overflow-evaluate_canonical_goal, ↵Matthias Krüger-88/+139
r=lcnr Check for overflow in evaluate_canonical_goal r? `@lcnr`
2023-02-14Reduce visibility of some itemsSantiago Pastorino-9/+9
2023-02-14Check for overflow in evaluate_canonical_goalSantiago Pastorino-24/+46
2023-02-14add test for coinduction in new solverlcnr-2/+26
2023-02-14Auto merge of #103695 - LYF1999:yf/103563, r=lcnrbors-1/+46
fix: Unexpected trait bound not satisfied in HRTB and Associated Type fix https://github.com/rust-lang/rust/issues/103563
2023-02-14s/eval_usize/eval_target_usize/ for clarityOli Scherer-1/+1
2023-02-13Make can_eq and can_sub return booleansMichael Goulet-10/+11
2023-02-13Implement repeat_while_none for both SearchGraph and EvalCtxtSantiago Pastorino-24/+38
2023-02-13Extract try_move_finished_goal_to_global_cache from try_finalize_goalSantiago Pastorino-23/+34
2023-02-13Make Ok value of repeat_while_none more generalSantiago Pastorino-28/+32
2023-02-13fix: Unexpected trait bound not satisfied in HRTByifei-1/+46
2023-02-13Rename folder traits' `tcx` method to `interner`Alan Egerton-16/+16
2023-02-13Make folding traits generic over the InternerAlan Egerton-7/+7
2023-02-13Make visiting traits generic over the InternerAlan Egerton-8/+8
2023-02-13Workaround issue #107747Alan Egerton-1/+4
Only required until fix #107803 is merged into stage0 compiler, expected when beta 1.69.0 is released on 2023-03-09, then this commit can be reverted.
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-19/+18
2023-02-13Reduce direct `mk_ty` usage.Nicholas Nethercote-5/+5
We use more specific `mk_*` functions in most places, might as well use them as much as possible.
2023-02-13Pre-intern some commonly used type variables.Nicholas Nethercote-1/+1
This requires some rearrangement of plumbing, such as adding `mk_fresh_{,int_,float_}ty` and removing `mk_ty_infer`.
2023-02-12rename query and use `NoSolution`Boxy-4/+5
2023-02-11make `relate`'s const ty assertion use semantic equalityBoxy-2/+21
2023-02-11Auto merge of #107919 - Dylan-DPC:rollup-fkl9swa, r=Dylan-DPCbors-7/+35
Rollup of 9 pull requests Successful merges: - #105019 (Add parentheses properly for borrowing suggestion) - #106001 (Stop at the first `NULL` argument when iterating `argv`) - #107098 (Suggest function call on pattern type mismatch) - #107490 (rustdoc: remove inconsistently-present sidebar tooltips) - #107855 (Add a couple random projection tests for new solver) - #107857 (Add ui test for implementation on projection) - #107878 (Clarify `new_size` for realloc means bytes) - #107888 (revert #107074, add regression test) - #107900 (Zero the `REPARSE_MOUNTPOINT_DATA_BUFFER` header) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-11Rollup merge of #105019 - chenyukang:yukang/fix-104961-borrow, r=cjgillotDylan DPC-7/+35
Add parentheses properly for borrowing suggestion Fixes #104961
2023-02-10implement `compute_alias_eq_goal`Boxy-3/+113
2023-02-10emit `AliasEq` when relating type and const aliasesBoxy-0/+15
2023-02-10add `AliasEq` to `PredicateKind`Boxy-0/+34
2023-02-10Rollup merge of #107863 - compiler-errors:new-solver-multiple-candidates, ↵Matthias Krüger-3/+6
r=jackh726 Allow multiple candidates with same response in new solver Treat >1 candidates as *not* ambiguous if they return the same response.
2023-02-10Rollup merge of #107831 - nnethercote:query-refactoring, r=oli-obkMatthias Krüger-4/+3
Query refactoring Just some cleanups I found when learning about the query system. Best reviewed one commit at a time. r? `@oli-obk`
2023-02-10Multiple candidates with same response is not ambiguousMichael Goulet-3/+6
2023-02-09Rollup merge of #107815 - compiler-errors:new-solver-no-auto-if-impl, r=lcnrDylan DPC-0/+14
Disqualify `auto trait` built-in impl in new solver if explicit `impl` exists
2023-02-09Disqualify auto-trait builtin impl in new solver if impl existsMichael Goulet-0/+14
2023-02-09Move winnowing to assemblyMichael Goulet-140/+81
2023-02-09Implement a dummy drop-in-favor-of for the new solverMichael Goulet-19/+33
2023-02-09Use elaborated item bounds for alias typesMichael Goulet-4/+1
2023-02-09Fix subst issue with object_ty_for_traitMichael Goulet-5/+3
2023-02-09Avoid some `tls::with` calls.Nicholas Nethercote-4/+3
These are in places where a `tcx` is easily obtained.
2023-02-08Rollup merge of #107799 - lcnr:update-provisional-result, r=oli-obkMichael Goulet-5/+8
correctly update goals in the cache we may want to actually write the response for our goal into the provisional or global cache instead of simply using the result from the last iteration '^^ r? ```@rust-lang/initiative-trait-system-refactor```
2023-02-09fix #104961, Add parentheses properly for borrowing suggestionyukang-7/+35
2023-02-08correctly update goals in the cachelcnr-5/+8
2023-02-08Rollup merge of #107780 - compiler-errors:instantiate-binder, r=lcnrMatthias Krüger-34/+34
Rename `replace_bound_vars_with_*` to `instantiate_binder_with_*` Mentioning "binder" rather than "bound vars", imo, makes it clearer that we're doing something to the binder as a whole. Also, "instantiate" is the verb that I'm always reaching for when I'm looking for these functions, and the name that we use in the new solver anyways. r? types
2023-02-08Rollup merge of #107769 - compiler-errors:pointer-like, r=eholkMatthias Krüger-8/+8
Rename `PointerSized` to `PointerLike` The old name was unnecessarily vague. This PR renames a nightly language feature that I added, so I don't think it needs any additional approval, though anyone can feel free to speak up if you dislike the rename. It's still unsatisfying that we don't the user which of {size, alignment} is wrong, but this trait really is just a stepping stone for a more generalized mechanism to create `dyn*`, just meant for nightly testing, so I don't think it really deserves additional diagnostic machinery for now. Fixes #107696, cc ``@RalfJung`` r? ``@eholk``
2023-02-07Replacing bound vars is actually instantiating a binderMichael Goulet-34/+34
2023-02-07Rename PointerSized to PointerLikeMichael Goulet-8/+8
2023-02-07Rollup merge of #107555 - edward-shen:edward-shen/dup-trait-suggestion, ↵Matthias Krüger-0/+2
r=compiler-errors Modify existing bounds if they exist Fixes #107335. This implementation is kinda gross but I don't really see a better way to do it. This primarily does two things: Modifies `suggest_constraining_type_param` to accept a new parameter that indicates a span to be replaced instead of added, if presented, and limit the additive suggestions to either suggest a new bound on an existing bound (see newly added unit test) or add the generics argument if a generics argument wasn't found. The former change is required to retain the capability to add an entirely new bounds if it was entirely omitted. r? ``@compiler-errors``
2023-02-06Rollup merge of #107724 - klensy:imports, r=Mark-SimulacrumMatthias Krüger-1/+0
remove unused rustc_* imports