Closed
Description
We have not yet stabilized dyn Trait
(see #49218), but once we do, we should start using it in error messages. So for example this test:
#![feature(dyn_trait)]
use std::fmt::{Debug, Display};
fn main() {
let x: Box<dyn Debug> = Box::new(1);
let _: Box<dyn Display> = x;
}
should print
error[E0308]: mismatched types
--> src/main.rs:5:31
|
5 | let _: Box<dyn Display> = x;
| ^ expected trait `std::fmt::Display`, found trait `std::fmt::Debug`
|
= note: expected type `std::boxed::Box<dyn std::fmt::Display>`
found type `std::boxed::Box<dyn std::fmt::Debug>`