E0072 update error format
This commit is contained in:
parent
ae77410350
commit
c5f9febc48
@ -654,6 +654,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
|
|||||||
let mut err = struct_span_err!(self.sess, span, E0072,
|
let mut err = struct_span_err!(self.sess, span, E0072,
|
||||||
"recursive type `{}` has infinite size",
|
"recursive type `{}` has infinite size",
|
||||||
self.item_path_str(type_def_id));
|
self.item_path_str(type_def_id));
|
||||||
|
err.span_label(span, &format!("recursive type has infinite size"));
|
||||||
err.help(&format!("insert indirection (e.g., a `Box`, `Rc`, or `&`) \
|
err.help(&format!("insert indirection (e.g., a `Box`, `Rc`, or `&`) \
|
||||||
at some point to make `{}` representable",
|
at some point to make `{}` representable",
|
||||||
self.item_path_str(type_def_id)));
|
self.item_path_str(type_def_id)));
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
struct ListNode { //~ ERROR E0072
|
struct ListNode { //~ ERROR E0072
|
||||||
|
//~| NOTE recursive type has infinite size
|
||||||
head: u8,
|
head: u8,
|
||||||
tail: Option<ListNode>,
|
tail: Option<ListNode>,
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
enum foo { foo_(bar) }
|
enum foo { foo_(bar) }
|
||||||
struct bar { x: bar }
|
struct bar { x: bar }
|
||||||
//~^ ERROR E0072
|
//~^ ERROR E0072
|
||||||
|
//~| NOTE recursive type has infinite size
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
// too big.
|
// too big.
|
||||||
|
|
||||||
enum Expr { //~ ERROR E0072
|
enum Expr { //~ ERROR E0072
|
||||||
|
//~| NOTE recursive type has infinite size
|
||||||
Plus(Expr, Expr),
|
Plus(Expr, Expr),
|
||||||
Literal(i64),
|
Literal(i64),
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
struct S { //~ ERROR E0072
|
struct S { //~ ERROR E0072
|
||||||
|
//~| NOTE recursive type has infinite size
|
||||||
element: Option<S>
|
element: Option<S>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
struct t1 { //~ ERROR E0072
|
struct t1 { //~ ERROR E0072
|
||||||
|
//~| NOTE recursive type has infinite size
|
||||||
foo: isize,
|
foo: isize,
|
||||||
foolish: t1
|
foolish: t1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user