From c5f9febc480804c8e9053ca9678058722d1a8ce3 Mon Sep 17 00:00:00 2001 From: Chris Stankus Date: Wed, 10 Aug 2016 13:36:36 -0500 Subject: [PATCH] E0072 update error format --- src/librustc/traits/error_reporting.rs | 1 + src/test/compile-fail/E0072.rs | 1 + src/test/compile-fail/issue-3008-2.rs | 1 + src/test/compile-fail/issue-32326.rs | 1 + src/test/compile-fail/issue-3779.rs | 1 + src/test/compile-fail/type-recursive.rs | 1 + 6 files changed, 6 insertions(+) diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index 9950560b13a..80f1559fefc 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -654,6 +654,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { let mut err = struct_span_err!(self.sess, span, E0072, "recursive type `{}` has infinite size", 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 `&`) \ at some point to make `{}` representable", self.item_path_str(type_def_id))); diff --git a/src/test/compile-fail/E0072.rs b/src/test/compile-fail/E0072.rs index 2f96ba1046d..e6de7921b30 100644 --- a/src/test/compile-fail/E0072.rs +++ b/src/test/compile-fail/E0072.rs @@ -9,6 +9,7 @@ // except according to those terms. struct ListNode { //~ ERROR E0072 + //~| NOTE recursive type has infinite size head: u8, tail: Option, } diff --git a/src/test/compile-fail/issue-3008-2.rs b/src/test/compile-fail/issue-3008-2.rs index e6cc29634a1..38b5fcbb3db 100644 --- a/src/test/compile-fail/issue-3008-2.rs +++ b/src/test/compile-fail/issue-3008-2.rs @@ -13,6 +13,7 @@ enum foo { foo_(bar) } struct bar { x: bar } //~^ ERROR E0072 +//~| NOTE recursive type has infinite size fn main() { } diff --git a/src/test/compile-fail/issue-32326.rs b/src/test/compile-fail/issue-32326.rs index 8af243afc22..afffe2a2c8d 100644 --- a/src/test/compile-fail/issue-32326.rs +++ b/src/test/compile-fail/issue-32326.rs @@ -13,6 +13,7 @@ // too big. enum Expr { //~ ERROR E0072 + //~| NOTE recursive type has infinite size Plus(Expr, Expr), Literal(i64), } diff --git a/src/test/compile-fail/issue-3779.rs b/src/test/compile-fail/issue-3779.rs index d96b1a1cbe3..71e9325ab75 100644 --- a/src/test/compile-fail/issue-3779.rs +++ b/src/test/compile-fail/issue-3779.rs @@ -9,6 +9,7 @@ // except according to those terms. struct S { //~ ERROR E0072 + //~| NOTE recursive type has infinite size element: Option } diff --git a/src/test/compile-fail/type-recursive.rs b/src/test/compile-fail/type-recursive.rs index 4bb739800df..7b56c6c15eb 100644 --- a/src/test/compile-fail/type-recursive.rs +++ b/src/test/compile-fail/type-recursive.rs @@ -9,6 +9,7 @@ // except according to those terms. struct t1 { //~ ERROR E0072 + //~| NOTE recursive type has infinite size foo: isize, foolish: t1 }