-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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>`
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.