diff options
| author | Chris Stankus <cdstankus@gmail.com> | 2016-08-10 13:36:36 -0500 |
|---|---|---|
| committer | Chris Stankus <cdstankus@gmail.com> | 2016-08-10 13:37:59 -0500 |
| commit | c5f9febc480804c8e9053ca9678058722d1a8ce3 (patch) | |
| tree | 924bea8420e6177c4b3f7e1d4d75ce238d1566f4 | |
| parent | ae774103501337ed63b42b673c6c4fdbf369e80e (diff) | |
| download | rust-c5f9febc480804c8e9053ca9678058722d1a8ce3.tar.gz rust-c5f9febc480804c8e9053ca9678058722d1a8ce3.zip | |
E0072 update error format
| -rw-r--r-- | src/librustc/traits/error_reporting.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/E0072.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-3008-2.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-32326.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-3779.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/type-recursive.rs | 1 |
6 files changed, 6 insertions, 0 deletions
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<ListNode>, } 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<S> } 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 } |
