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:
Matthew Jasper 2020-10-28 20:04:39 +00:00
parent 299a65ff71
commit acb6a06123
4 changed files with 161 additions and 42 deletions

View 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;
}

View 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);
}