rust/src/test/ui/chalkify/trait-objects.rs
Matthew Jasper acb6a06123 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
2020-10-30 19:39:33 +00:00

13 lines
342 B
Rust

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