about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
AgeCommit message (Collapse)AuthorLines
2023-07-06Auto merge of #113406 - matthiaskrgr:rollup-0rprs5k, r=matthiaskrgrbors-4/+6
Rollup of 4 pull requests Successful merges: - #112295 (Fix the tests-listing-format-json test on Windows) - #113246 (fix compiletest crash) - #113395 (Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver) - #113402 (Diagnose unsorted CGUs.) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-06always emit consider `AutoImplCandidates` for them if they don't also have a ↵Oleksandr Babak-1/+1
`ProjectionCandidate`
2023-07-06deal with opaque types without cyclinglcnr-10/+24
2023-07-06update auto trait handlinglcnr-14/+63
2023-07-06Prefer object candidates over impl candidates in new selectionMichael Goulet-0/+8
2023-07-06Dont ICE for `dyn* Trait: Trait` goals during selection in new trait solverMichael Goulet-4/+6
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-54/+64
2023-07-05Rollup merge of #113337 - compiler-errors:next-solver-winnow-specializing, ↵Michael Goulet-2/+13
r=lcnr Winnow specialized impls during selection in new solver We need to be able to winnow impls that are specialized by more specific impls in order for codegen to be able to proceed. r? ``@lcnr``
2023-07-05Rollup merge of #113321 - BoxyUwU:move_constkind_to_typeir, r=oli-obkMichael Goulet-3/+3
Move `ty::ConstKind` to `rustc_type_ir` Needed this in another PR for custom debug impls, and this will also be required to move the new solver into a separate crate that does not use `TyCtxt` so that r-a and friends can depend on the trait solver. Rebased on top of #113325, only the second and third commits needs reviewing
2023-07-05Rollup merge of #113320 - oli-obk:eval_obligation_query, r=petrochenkov,BoxyUwUMichael Goulet-18/+60
Add some extra information to opaque type cycle errors Plus a bunch of cleanups. This should help users debug query cycles due to auto trait checking. We'll probably want to fix cycle errors in most (or all?) cases by looking at the current item's hidden types (new solver does this), and by delaying the auto trait checks to after typeck.
2023-07-05Rollup merge of #113319 - lcnr:type-param-def-def-id, r=compiler-errorsMichael Goulet-2/+2
`TypeParameterDefinition` always require a `DefId` the `None` case never actually reaches diagnostics so it feels better for diagnostics to be able to rely on the `DefId` being there, cc #113310
2023-07-05Rollup merge of #113317 - lcnr:sketchy-new-select, r=oli-obkMichael Goulet-60/+74
-Ztrait-solver=next: stop depending on old solver removes the final dependencies on the old solver when `-Ztrait-solver=next` is enabled.
2023-07-05Deal with falloutBoxy-3/+3
2023-07-05Make all generics_require_sized_self go through the query to get caching.Oli Scherer-3/+3
2023-07-05Add some extra information to opaque type cycle errorsOli Scherer-9/+57
2023-07-05Remove redundant `delay_span_bug`Oli Scherer-9/+3
2023-07-05Don't require associated types with `Self: Sized` bounds in `dyn Trait` objectsOli Scherer-1/+6
2023-07-05Winnow specializing implsMichael Goulet-2/+13
2023-07-05Auto merge of #113329 - lcnr:probe_candidate, r=BoxyUwUbors-298/+280
add `ecx.probe_candidate` Not yet changing the candidate source to an enum because that would be more involved, but this by itself should already be a significant improvement imo r? `@BoxyUwU`
2023-07-04Auto merge of #113330 - matthiaskrgr:rollup-zm3owin, r=matthiaskrgrbors-42/+187
Rollup of 5 pull requests Successful merges: - #113192 (`assemble_candidates_after_normalizing_self_ty` docs) - #113251 (Use scoped-tls for SMIR to map between TyCtxt and SMIR datastructures) - #113282 (Update platform-support.md to improve ARM target descriptions) - #113296 (add flag for enabling global cache usage for proof trees and printing proof trees on error) - #113324 (implement `ConstEvaluatable` goals in new solver) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-04Rollup merge of #113324 - lcnr:const-evaluatable-goal, r=BoxyUwUMatthias Krüger-6/+42
implement `ConstEvaluatable` goals in new solver this only supports stable const generics. `feature(generic_const_exprs)` needs to extend that function is non-trivial ways. Leaving this for someone else or some later date. r? `@BoxyUwU`
2023-07-04Rollup merge of #113296 - BoxyUwU:proof_trees_on_error, r=lcnrMatthias Krüger-32/+132
add flag for enabling global cache usage for proof trees and printing proof trees on error This adds a few new things: - `-Zdump-solver-proof-tree=always/never/on-error` - `always`/`never` were previosuly specifiable by whether the flag exists or not, th new flag is `on_error` which reruns obligations of fulfillment and selection errors with proof tree generation enabled and prints them out - `-Zdump-solver-proof-tree-uses-cache` - allows forcing global cache to be used or unused for all generated proof trees, global cache is enabled by default for `always` so that it accurately represents what happend. This flag currently would affect misc uses of `GenerateProofTree::Yes` which will be added in the future for things like diagnostics logic and rustdoc's auto_trait file. We can fix this when we start using proof tree generation for those use cases if it's desirable. I also changed the output to go straight to stdout instead of going through `debug!` so that `-Zdump-solver-proof-tree` can be adequately used on `nightly` not just a locally built toolchain. The idea for `on-error` is that it should hopefully make it easier to quickly figure out "why doesnt this code compile"- you just pass in `-Zdump-solver-proof-tree=on-error` and you'll only get proof trees you care about. --- r? `@lcnr` `@compiler-errors`
2023-07-04Rollup merge of #113192 - lcnr:add-comment, r=compiler-errorsMatthias Krüger-4/+13
`assemble_candidates_after_normalizing_self_ty` docs I already explained that in different places a few times, should have added that explanation as a doc comment the first time I did so :3 r? `@BoxyUwU`
2023-07-04add `ecx.probe_candidate`lcnr-298/+280
2023-07-04reviewsBoxy-90/+84
2023-07-04implement `ConstEvaluatable` goals in new solverlcnr-6/+42
we don't yet handle `generic_const_exprs`, someone else can do that :3
2023-07-04Replace `const_error` methods with `Const::new_error`Boxy-6/+5
2023-07-04Replace `mk_const` with `Const::new_x` methodsBoxy-34/+32
2023-07-04`TypeParameterDefinition` always require a `DefId`lcnr-2/+2
2023-07-04move logic for flags into separate functionBoxy-30/+35
2023-07-04extend commentlcnr-0/+5
2023-07-04change flag nameBoxy-1/+1
2023-07-04reviewsBoxy-3/+1
2023-07-04 -Ztrait-solver=next: stop depending on old solverlcnr-60/+69
2023-07-03remove TypeWellFormedFromEnvMichael Goulet-30/+5
2023-07-03Remove chalk from the compilerMichael Goulet-163/+6
2023-07-03add flag for disabling global cache and printing proof trees on errorBoxy-46/+149
2023-07-03Helpers for creating EvalCtxts, some commentsMichael Goulet-153/+174
2023-07-03Implement selection in new trait solverMichael Goulet-21/+352
2023-07-03rebaselcnr-2/+2
2023-07-03reviewlcnr-16/+25
2023-07-03`deeply_normalize` pass in fulfill cx for old solverlcnr-12/+15
2023-07-03use `deeply_normalize` for `assumed_wf_types`lcnr-10/+26
2023-07-03add deep normalization via the new solverlcnr-6/+280
2023-07-03add instrument to `register_predicate_obligation`lcnr-0/+1
2023-07-01Auto merge of #113154 - lcnr:better-probe-check, r=compiler-errorsbors-82/+59
change snapshot tracking in fulfillment contexts use the exact snapshot number to prevent misuse even when created inside of a snapshot
2023-06-30assemble_candidates_after_normalizing_self_ty docslcnr-4/+13
2023-06-29Auto merge of #113108 - ↵bors-11/+2
compiler-errors:normalize-opaques-with-late-bound-vars-again, r=jackh726 Normalize opaques with late-bound vars again We have a hack in the compiler where if an opaque has escaping late-bound vars, we skip revealing it even though we *could* reveal it from a technical perspective. First of all, this is weird, since we really should be revealing all opaques in `Reveal::All` mode. Second of all, it causes subtle bugs (linked below). I attempted to fix this in #100980, which was unfortunately reverted due to perf regressions on codebases that used really deeply nested futures in some interesting ways. The worst of which was #103423, which caused the project to hang on build. Another one was #104842, which was just a slow-down, but not a hang. I took some time afterwards to investigate how to rework `normalize_erasing_regions` to take advantage of better caching, but that effort kinda fizzled out (#104133). However, recently, I was made aware of more bugs whose root cause is not revealing opaques during codegen. That made me want to fix this again -- in the process, interestingly, I took the the minimized example from https://github.com/rust-lang/rust/issues/103423#issuecomment-1292947043, and it doesn't seem to hang any more... Thinking about this harder, there have been some changes to the way we lower and typecheck async futures that may have reduced the pathologically large number of outlives obligations (see description of #103423) that we were encountering when normalizing opaques with bound vars the last time around: * #104321 (lower `async { .. }` directly as a generator that implements `Future`, removing the `from_generator` shim) * #104833 (removing an `identity_future` fn that was wrapping desugared future generators) ... so given that I can see: * No significant regression on rust perf bot (https://github.com/rust-lang/rust/pull/107620#issuecomment-1600070317) * No timeouts in crater run I did (https://github.com/rust-lang/rust/pull/107620#issuecomment-1605428952, rechecked failing crates in https://github.com/rust-lang/rust/pull/107620#issuecomment-1605973434) ... and given that this PR: * Fixes #104601 * Fixes #107557 * Fixes #109464 * Allows us to remove a `DefiningAnchor::Bubble` from codegen (75a8f681837c70051e0200a14f58ae07dbe58e66) I'm inclined to give this another shot at landing this. Best case, it just works -- worst case, we get more examples to study how we need to improve the compiler to make this work. r? types
2023-06-29change snapshot tracking in fulfillment contextslcnr-82/+59
2023-06-28convert to fluent, make plurals workMichael Goulet-11/+38