mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 19:58:32 +00:00
Update E0033 to the new error format
This commit is contained in:
parent
695b3d8279
commit
b9762f8b8c
@ -347,9 +347,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||||||
if let ty::TyTrait(..) = mt.ty.sty {
|
if let ty::TyTrait(..) = mt.ty.sty {
|
||||||
// This is "x = SomeTrait" being reduced from
|
// This is "x = SomeTrait" being reduced from
|
||||||
// "let &x = &SomeTrait" or "let box x = Box<SomeTrait>", an error.
|
// "let &x = &SomeTrait" or "let box x = Box<SomeTrait>", an error.
|
||||||
span_err!(self.tcx.sess, span, E0033,
|
let type_str = self.ty_to_string(expected);
|
||||||
"type `{}` cannot be dereferenced",
|
struct_span_err!(self.tcx.sess, span, E0033,
|
||||||
self.ty_to_string(expected));
|
"type `{}` cannot be dereferenced", type_str)
|
||||||
|
.span_label(span, &format!("type `{}` cannot be dereferenced", type_str))
|
||||||
|
.emit();
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,5 +15,9 @@ trait SomeTrait {
|
|||||||
fn main() {
|
fn main() {
|
||||||
let trait_obj: &SomeTrait = SomeTrait; //~ ERROR E0425
|
let trait_obj: &SomeTrait = SomeTrait; //~ ERROR E0425
|
||||||
//~^ ERROR E0038
|
//~^ ERROR E0038
|
||||||
let &invalid = trait_obj; //~ ERROR E0033
|
//~| method `foo` has no receiver
|
||||||
|
|
||||||
|
let &invalid = trait_obj;
|
||||||
|
//~^ ERROR E0033
|
||||||
|
//~| NOTE type `&SomeTrait` cannot be dereferenced
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user