mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +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 {
|
||||
// This is "x = SomeTrait" being reduced from
|
||||
// "let &x = &SomeTrait" or "let box x = Box<SomeTrait>", an error.
|
||||
span_err!(self.tcx.sess, span, E0033,
|
||||
"type `{}` cannot be dereferenced",
|
||||
self.ty_to_string(expected));
|
||||
let type_str = self.ty_to_string(expected);
|
||||
struct_span_err!(self.tcx.sess, span, E0033,
|
||||
"type `{}` cannot be dereferenced", type_str)
|
||||
.span_label(span, &format!("type `{}` cannot be dereferenced", type_str))
|
||||
.emit();
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
@ -15,5 +15,9 @@ trait SomeTrait {
|
||||
fn main() {
|
||||
let trait_obj: &SomeTrait = SomeTrait; //~ ERROR E0425
|
||||
//~^ 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