Migrate more stuff to the next solver#20841
Conversation
The bulk of the work is trait solving and cached in the trait solver's cache, and this will save memory.
| ), | ||
| }; | ||
| // if the arg is error like, render it to inform the user | ||
| if is_err(arg) { |
There was a problem hiding this comment.
This was needed because params without default would have an error default, but now they just have None.
|
|
||
| let sized_trait = LangItem::Sized.resolve_trait(db, resolver.krate()); | ||
| if let Some(sized_trait) = sized_trait { | ||
| let (mut generics, mut def_id) = |
There was a problem hiding this comment.
This code had a bug, that it thought the first param of an assoc item of a trait was Self (because it compared by index and not the owner def), therefore I rewrote it.
| self.current_or_prev_segment = | ||
| segments.get(resolved_segment_idx).expect("should have resolved segment"); | ||
|
|
||
| if matches!(self.path, Path::BarePath(..)) { |
There was a problem hiding this comment.
This optimization had to be removed since now validation can fail on non-generic paths too (AdtSelf on param default).
| *a* | ||
|
|
||
| ```rust | ||
| a: T |
There was a problem hiding this comment.
This code was erroneous, you cannot refer to Self in param default.
ShoyuVanilla
left a comment
There was a problem hiding this comment.
Looks good to me, and despite many lines are being changed, I believe most of them are quite straightforward, so merging without other approvals 😅
|
changelog fixup #20329 |
Migrate more stuff to the next solver
Reviewing commit-by-commit is recommended.