forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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 rust-lang#107786 - compiler-errors:new-solver-some-tw…
…eaks, r=lcnr Implement some tweaks in the new solver I've been testing the new solver on some small codebases, and these are a few small changes I've needed to make. The most "controversial" here is implementing `trait_candidate_should_be_dropped_in_favor_of`, which I just implemented to always return false. This surprisingly allows some code to compile, without us having to actually decide on any semantics yet. r? `@rust-lang/initiative-trait-system-refactor`
- Loading branch information
Showing
6 changed files
with
119 additions
and
135 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
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
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,12 @@ | ||
// compile-flags: -Ztrait-solver=next | ||
// check-pass | ||
|
||
trait Foo { | ||
type Bar: Bar; | ||
} | ||
|
||
trait Bar: Baz {} | ||
|
||
trait Baz {} | ||
|
||
fn main() {} |
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,22 @@ | ||
// compile-flags: -Ztrait-solver=next | ||
// check-pass | ||
|
||
// Checks that we don't explode when we assemble >1 candidate for a goal. | ||
|
||
struct Wrapper<T>(T); | ||
|
||
trait Foo {} | ||
|
||
impl Foo for Wrapper<i32> {} | ||
|
||
impl Foo for Wrapper<()> {} | ||
|
||
fn needs_foo(_: impl Foo) {} | ||
|
||
fn main() { | ||
let mut x = Default::default(); | ||
let w = Wrapper(x); | ||
needs_foo(w); | ||
x = 1; | ||
drop(x); | ||
} |