-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hack out effects support for old solver #132119
Conversation
if candidate.is_some() { | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nyaaa?
either add a comment or modify the impl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this impl is scuffed lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should've been a return Err(EvaluationFailure::Ambiguous)
, so we bail on ambiguity if there are 2 applicable w.c.
todo!() | ||
ty::PredicateKind::Clause(ty::ClauseKind::HostEffect(data)) => { | ||
self.infcx.enter_forall(bound_predicate.rebind(data), |data| { | ||
match effects::evaluate_host_effect_obligation( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty sure that can cause undetected overflow 🤔 too tired to explain my thoughts here via comment for today, can do so in sync or maybe you're able to come up with a test yourself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, though it's the same way that we can encounter overflow in projection afaict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a consequence of not tracking effect goals (or projections) on the trait stack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test changes appear correct to me. For the solver parts I did not see anything else than what lcnr commented on (in my limited understanding of the trait solver infra)
☔ The latest upstream changes (presumably #132184) made this pull request unmergeable. Please resolve the merge conflicts. |
b4e9eeb
to
758d2d5
Compare
.instantiate(tcx, impl_.args) | ||
.into_iter() | ||
.map(|(trait_ref, _)| { | ||
obligation.with( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increment the depth correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this more manually. It's kinda ugly but 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls do:
- incr obligation depth when recursing in evaluate host effect
- ICE when used with intercrate mode
r=me after
758d2d5
to
824b932
Compare
824b932
to
8b7b8e5
Compare
@bors r=lcnr |
…, r=lcnr Hack out effects support for old solver Opening this for vibes ✨ Turns out that a basic, somewhat incomplete implementation of host effects is achievable in the old trait solver pretty easily. This should be sufficient for us to use in the standard library itself. Regarding incompleteness, maybe we should always treat host predicates as ambiguous in intercrate mode (at least in the old solver) to avoid any worries about accidental impl overlap or something. r? `@lcnr` cc `@fee1-dead`
…, r=lcnr Hack out effects support for old solver Opening this for vibes ✨ Turns out that a basic, somewhat incomplete implementation of host effects is achievable in the old trait solver pretty easily. This should be sufficient for us to use in the standard library itself. Regarding incompleteness, maybe we should always treat host predicates as ambiguous in intercrate mode (at least in the old solver) to avoid any worries about accidental impl overlap or something. r? ``@lcnr`` cc ``@fee1-dead``
…kingjubilee Rollup of 10 pull requests Successful merges: - rust-lang#131375 (compiler: apply clippy::clone_on_ref_ptr for CI) - rust-lang#132119 (Hack out effects support for old solver) - rust-lang#132151 (Ensure that resume arg outlives region bound for coroutines) - rust-lang#132216 (correct LLVMRustCreateThinLTOData arg types) - rust-lang#132233 (Split `boxed.rs` into a few modules) - rust-lang#132266 (riscv-soft-abi-with-float-features.rs: adapt for LLVM 20) - rust-lang#132270 (clarified doc for `std::fs::OpenOptions.truncate()`) - rust-lang#132274 (Cleanup op lookup in HIR typeck) - rust-lang#132284 (Remove my ping for rustdoc/clean/types.rs) - rust-lang#132293 (Remove myself from mentions inside `tests/ui/check-cfg` directory) r? `@ghost` `@rustbot` modify labels: rollup
…kingjubilee Rollup of 12 pull requests Successful merges: - rust-lang#131375 (compiler: apply clippy::clone_on_ref_ptr for CI) - rust-lang#131520 (Mark `str::is_char_boundary` and `str::split_at*` unstably `const`.) - rust-lang#132119 (Hack out effects support for old solver) - rust-lang#132194 (Collect item bounds for RPITITs from trait where clauses just like associated types) - rust-lang#132216 (correct LLVMRustCreateThinLTOData arg types) - rust-lang#132233 (Split `boxed.rs` into a few modules) - rust-lang#132266 (riscv-soft-abi-with-float-features.rs: adapt for LLVM 20) - rust-lang#132270 (clarified doc for `std::fs::OpenOptions.truncate()`) - rust-lang#132284 (Remove my ping for rustdoc/clean/types.rs) - rust-lang#132293 (Remove myself from mentions inside `tests/ui/check-cfg` directory) - rust-lang#132312 (Delete `tests/crashes/23707.rs` because it's flaky) - rust-lang#132313 (compiletest: Rename `command-list.rs` to `directive-list.rs`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#132119 - compiler-errors:effects-old-solver, r=lcnr Hack out effects support for old solver Opening this for vibes ✨ Turns out that a basic, somewhat incomplete implementation of host effects is achievable in the old trait solver pretty easily. This should be sufficient for us to use in the standard library itself. Regarding incompleteness, maybe we should always treat host predicates as ambiguous in intercrate mode (at least in the old solver) to avoid any worries about accidental impl overlap or something. r? ```@lcnr``` cc ```@fee1-dead```
…kingjubilee Rollup of 12 pull requests Successful merges: - rust-lang#131375 (compiler: apply clippy::clone_on_ref_ptr for CI) - rust-lang#131520 (Mark `str::is_char_boundary` and `str::split_at*` unstably `const`.) - rust-lang#132119 (Hack out effects support for old solver) - rust-lang#132194 (Collect item bounds for RPITITs from trait where clauses just like associated types) - rust-lang#132216 (correct LLVMRustCreateThinLTOData arg types) - rust-lang#132233 (Split `boxed.rs` into a few modules) - rust-lang#132266 (riscv-soft-abi-with-float-features.rs: adapt for LLVM 20) - rust-lang#132270 (clarified doc for `std::fs::OpenOptions.truncate()`) - rust-lang#132284 (Remove my ping for rustdoc/clean/types.rs) - rust-lang#132293 (Remove myself from mentions inside `tests/ui/check-cfg` directory) - rust-lang#132312 (Delete `tests/crashes/23707.rs` because it's flaky) - rust-lang#132313 (compiletest: Rename `command-list.rs` to `directive-list.rs`) r? `@ghost` `@rustbot` modify labels: rollup
Opening this for vibes ✨
Turns out that a basic, somewhat incomplete implementation of host effects is achievable in the old trait solver pretty easily. This should be sufficient for us to use in the standard library itself.
Regarding incompleteness, maybe we should always treat host predicates as ambiguous in intercrate mode (at least in the old solver) to avoid any worries about accidental impl overlap or something.
r? @lcnr cc @fee1-dead