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 9950560b13a5a..80f1559fefce5 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 2f96ba1046d74..e6de7921b3036 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 e6cc29634a1e8..38b5fcbb3db0e 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 8af243afc2299..afffe2a2c8d03 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 d96b1a1cbe35b..71e9325ab75d1 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 4bb739800df36..7b56c6c15ebb3 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 }