Fix various Chalk lowering bugs
- Add more well-known traits - Use the correct binders when lowering trait objects - Use correct substs when lowering trait objects - Use the correct binders for opaque_ty_data - Lower negative impls with the correct polarity - Supply associated type values - Use `predicates_defined_on` for where clauses
This commit is contained in:
parent
299a65ff71
commit
acb6a06123
4 changed files with 161 additions and 42 deletions
20
src/test/ui/chalkify/arithmetic.rs
Normal file
20
src/test/ui/chalkify/arithmetic.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// check-pass
|
||||
// compile-flags: -Z chalk
|
||||
|
||||
fn main() {
|
||||
1 + 2;
|
||||
3 * 6;
|
||||
2 - 5;
|
||||
17 / 6;
|
||||
23 % 11;
|
||||
4 & 6;
|
||||
7 | 15;
|
||||
4 << 7;
|
||||
123 >> 3;
|
||||
1 == 2;
|
||||
5 != 5;
|
||||
6 < 2;
|
||||
7 > 11;
|
||||
3 <= 1;
|
||||
9 >= 14;
|
||||
}
|
||||
13
src/test/ui/chalkify/trait-objects.rs
Normal file
13
src/test/ui/chalkify/trait-objects.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// check-pass
|
||||
// compile-flags: -Z chalk
|
||||
|
||||
use std::fmt::Display;
|
||||
|
||||
fn main() {
|
||||
let d: &dyn Display = &mut 3;
|
||||
// FIXME(chalk) should be able to call d.to_string() as well, but doing so
|
||||
// requires Chalk to be able to prove trait object well-formed goals.
|
||||
(&d).to_string();
|
||||
let f: &dyn Fn(i32) -> _ = &|x| x + x;
|
||||
f(2);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue