-
Notifications
You must be signed in to change notification settings - Fork 13.4k
new solver: prefer trivial builtin impls #135639
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
please add the following to at least one affected test //@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@ ignore-compare-mode-next-solver (explicit revisions) r=me after nits |
for now, only builtin `Sized` impls are tracked as being `Trivial`
d35df81
to
00844be
Compare
I added the explicit revisions to the two tests that didn't need blessing for the new solver (and fixed the run-pass I mentioned above), and were initially affected when inhibiting this very preference in the old solver. @bors r=lcnr rollup |
new solver: prefer trivial builtin impls As discussed [on zulip](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/needs_help.3A.20trivial.20builtin.20impls), this PR: - adds a new `BuiltinImplSource::Trivial` source, and marks the `Sized` builtin impls as trivial - prefers these trivial builtin impls in `merge_trait_candidates` The comments can likely be wordsmithed a bit better, and I ~stole~ was inspired by the old solver ones. Let me know how you want them improved. When enabling the new solver for tests, 3 UI tests now pass: - `regions/issue-26448-1.rs` and its sibling `regions/issue-26448-2.rs` were rejected by the new solver but accepted by the old one - and `issues/issue-42796.rs` where the old solver emitted some overflow errors in addition to the expected error (For some reason one of these tests is run-pass, but I can take care of that another day) r? lcnr
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#134455 (cleanup promoteds move check) - rust-lang#135421 (Make tidy warn on unrecognized directives) - rust-lang#135611 (Remove unnecessary assertion for reference error) - rust-lang#135620 (ci: improve github action name) - rust-lang#135621 (Move some std tests to integration tests) - rust-lang#135639 (new solver: prefer trivial builtin impls) - rust-lang#135654 (add src/librustdoc and src/rustdoc-json-types to RUSTC_IF_UNCHANGED_ALLOWED_PATHS) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#134455 (cleanup promoteds move check) - rust-lang#135421 (Make tidy warn on unrecognized directives) - rust-lang#135611 (Remove unnecessary assertion for reference error) - rust-lang#135620 (ci: improve github action name) - rust-lang#135639 (new solver: prefer trivial builtin impls) - rust-lang#135654 (add src/librustdoc and src/rustdoc-json-types to RUSTC_IF_UNCHANGED_ALLOWED_PATHS) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#135639 - lqd:trivial-builtin-impls, r=lcnr new solver: prefer trivial builtin impls As discussed [on zulip](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/needs_help.3A.20trivial.20builtin.20impls), this PR: - adds a new `BuiltinImplSource::Trivial` source, and marks the `Sized` builtin impls as trivial - prefers these trivial builtin impls in `merge_trait_candidates` The comments can likely be wordsmithed a bit better, and I ~stole~ was inspired by the old solver ones. Let me know how you want them improved. When enabling the new solver for tests, 3 UI tests now pass: - `regions/issue-26448-1.rs` and its sibling `regions/issue-26448-2.rs` were rejected by the new solver but accepted by the old one - and `issues/issue-42796.rs` where the old solver emitted some overflow errors in addition to the expected error (For some reason one of these tests is run-pass, but I can take care of that another day) r? lcnr
As discussed on zulip, this PR:
BuiltinImplSource::Trivial
source, and marks theSized
builtin impls as trivialmerge_trait_candidates
The comments can likely be wordsmithed a bit better, and I
stolewas inspired by the old solver ones. Let me know how you want them improved.When enabling the new solver for tests, 3 UI tests now pass:
regions/issue-26448-1.rs
and its siblingregions/issue-26448-2.rs
were rejected by the new solver but accepted by the old oneissues/issue-42796.rs
where the old solver emitted some overflow errors in addition to the expected error(For some reason one of these tests is run-pass, but I can take care of that another day)
r? lcnr