Alan Egerton
695072daa6
Remove type-traversal trait aliases
2023-02-22 17:04:58 +00:00
Michael Goulet
7596998d1c
Move some InferCtxt methods to EvalCtxt in new solver
2023-02-22 03:22:30 +00:00
Michael Goulet
6402c98621
Add consider_implied_clause
2023-02-18 19:45:02 +00:00
Michael Goulet
82b52056fe
Check that built-in callable types validate their output type is Sized
(in new solver)
2023-02-18 19:32:58 +00:00
Nicholas Nethercote
9d5cf0f0bf
Remove the InternIteratorElement
impl for &'a T
.
...
`InternIteratorElement` is a trait used to intern values produces by
iterators. There are three impls, corresponding to iterators that
produce different types:
- One for `T`, which operates straightforwardly.
- One for `Result<T, E>`, which is fallible, and will fail early with an
error result if any of the iterator elements are errors.
- One for `&'a T`, which clones the items as it iterates.
That last one is bad: it's extremely easy to use it without realizing
that it clones, which goes against Rust's normal "explicit is better"
approach to cloning.
So this commit just removes it. In practice, there weren't many use
sites. For all but one of them `into_iter()` could be used, which avoids
the need for cloning. And for the one remaining case `copied()` is
used.
2023-02-17 22:24:34 +11:00
Kyle Matsuda
c183110cc2
remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata
2023-02-16 17:05:56 -07:00
Dylan DPC
b080a1a4fc
Rollup merge of #107815 - compiler-errors:new-solver-no-auto-if-impl, r=lcnr
...
Disqualify `auto trait` built-in impl in new solver if explicit `impl` exists
2023-02-09 23:18:37 +05:30
Michael Goulet
68e27b3052
Disqualify auto-trait builtin impl in new solver if impl exists
2023-02-09 17:23:50 +00:00
Michael Goulet
654f43f34e
Move winnowing to assembly
2023-02-09 17:22:39 +00:00
Michael Goulet
8987e68247
Implement a dummy drop-in-favor-of for the new solver
2023-02-09 17:22:37 +00:00
Matthias Krüger
ec65285fdd
Rollup merge of #107780 - compiler-errors:instantiate-binder, r=lcnr
...
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-08 18:32:44 +01:00
Michael Goulet
03a8a4ff3e
Replacing bound vars is actually instantiating a binder
2023-02-07 23:13:54 +00:00
Michael Goulet
2b70cbb8a5
Rename PointerSized to PointerLike
2023-02-07 19:05:53 +00:00
Wilco Kusee
5fd4f5bceb
Add candidates for DiscriminantKind builtin
2023-02-01 16:43:01 +01:00
Michael Goulet
f7fc0b7121
nits
2023-01-30 19:19:07 +00:00
Michael Goulet
c24844048f
Trait upcasting support in new solver
2023-01-30 19:11:01 +00:00
Michael Goulet
085a48e798
Implement unsizing in the new trait solver
2023-01-30 19:11:01 +00:00
Matthias Krüger
70fc114ccc
Rollup merge of #107401 - lenko-d:remove_the_usize_field_from_CandidateSource_AliasBound, r=compiler-errors
...
remove the usize field from CandidateSource::AliasBound
Fixes [#107380 ](https://github.com/rust-lang/rust/issues/107380 )
2023-01-29 06:14:18 +01:00
Lenko Donchev
d3cf813b8d
Use field-less variant for AliasBound.
2023-01-28 06:00:27 -06:00
Lenko Donchev
d4a816c813
remove the usize field from CandidateSource::AliasBound
2023-01-27 22:50:24 -06:00
Michael Goulet
8a0b2156d5
Micro-optimization in consider_assumption
2023-01-27 20:06:12 +00:00
Michael Goulet
d600b94ebb
Implement Generator and Future
2023-01-26 03:15:36 +00:00
Boxy
430dab0b42
implement builtin candidate
2023-01-24 23:24:30 +00:00
Michael Goulet
444cbcd729
Address goal nits
2023-01-21 17:15:00 +00:00
Michael Goulet
ed6aebbfec
trait solver: Implement Fn traits and tuple trait
2023-01-19 16:15:28 +00:00
Michael Goulet
69890b2df4
trait solver: PointerSized
2023-01-19 16:15:28 +00:00
Michael Goulet
f672436f04
Handle structural traits more gracefully
2023-01-18 14:59:15 +00:00
Michael Goulet
34127c5080
no subtyping in the new trait solver
2023-01-18 14:59:15 +00:00
Michael Goulet
685c32fd85
Sized, Copy/Clone
2023-01-18 14:59:15 +00:00
Michael Goulet
45aa5c0f90
Auto and alias traits
2023-01-18 14:59:15 +00:00
Michael Goulet
f99b273d57
implement consider_assumption
2023-01-18 14:28:14 +00:00
Michael Goulet
b84b1da2db
Canonicalize trait solver response inside probe
2023-01-18 14:28:14 +00:00
lcnr
9a757d6ee4
add eq
to InferCtxtExt
2023-01-18 08:11:15 +01:00
lcnr
660c28391c
remove assembly context and impl a bit more
2023-01-18 08:11:15 +01:00
lcnr
bf7dbff921
instantiate canonical vars eagerly
2023-01-18 08:11:13 +01:00
Kyle Matsuda
f29a334c90
change impl_trait_ref query to return EarlyBinder; remove bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata
2023-01-14 00:29:56 -07:00
Michael Goulet
36ee66c6c5
Check impl's where clauses in consider_impl_candidate in experimental solver
2023-01-09 17:24:36 +00:00
lcnr
750bf36c33
dedup assembly
2022-12-20 07:30:24 +00:00
lcnr
a213bb36c9
implement the skeleton of the updated trait solver
2022-12-19 16:46:17 +00:00