-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #107799 - lcnr:update-provisional-result, r=oli-obk
correctly update goals in the cache we may want to actually write the response for our goal into the provisional or global cache instead of simply using the result from the last iteration '^^ r? ```@rust-lang/initiative-trait-system-refactor```
- Loading branch information
Showing
3 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// known-bug: unknown | ||
// compile-flags: -Ztrait-solver=next | ||
// failure-status: 101 | ||
// normalize-stderr-test "note: .*\n\n" -> "" | ||
// normalize-stderr-test "thread 'rustc' panicked.*\n" -> "" | ||
// rustc-env:RUST_BACKTRACE=0 | ||
|
||
// This tests checks that we update results in the provisional cache when | ||
// we pop a goal from the stack. | ||
#![feature(auto_traits)] | ||
auto trait Coinductive {} | ||
struct Foo<T>(T); | ||
struct Bar<T>(T); | ||
|
||
impl<T> Coinductive for Foo<T> | ||
where | ||
Bar<T>: Coinductive | ||
{} | ||
|
||
impl<T> Coinductive for Bar<T> | ||
where | ||
Foo<T>: Coinductive, | ||
Bar<T>: ConstrainInfer, | ||
{} | ||
|
||
trait ConstrainInfer {} | ||
impl ConstrainInfer for Bar<u8> {} | ||
impl ConstrainInfer for Foo<u16> {} | ||
|
||
fn impls<T: Coinductive>() -> T { todo!() } | ||
|
||
fn constrain<T: ConstrainInfer>(_: T) {} | ||
|
||
fn main() { | ||
// This should constrain `_` to `u8`. | ||
impls::<Foo<_>>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
error: the compiler unexpectedly panicked. this is a bug. | ||
|
||
query stack during panic: | ||
#0 [check_well_formed] checking that `<impl at $DIR/provisional-result-done.rs:20:1: 20:31>` is well-formed | ||
#1 [check_mod_type_wf] checking that types are well-formed in top-level module | ||
end of query stack |