diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/issue-3008-1.rs | 13 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-3779.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/span/E0072.stderr | 3 | ||||
| -rw-r--r-- | src/test/ui/span/multiline-span-E0072.stderr | 1 | ||||
| -rw-r--r-- | src/test/ui/span/recursive-type-field.stderr | 39 |
5 files changed, 35 insertions, 27 deletions
diff --git a/src/test/compile-fail/issue-3008-1.rs b/src/test/compile-fail/issue-3008-1.rs index d3c15763eb0..7ca6d9301a6 100644 --- a/src/test/compile-fail/issue-3008-1.rs +++ b/src/test/compile-fail/issue-3008-1.rs @@ -8,9 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -enum foo { foo_(bar) } -enum bar { bar_none, bar_some(bar) } -//~^ ERROR recursive type `bar` has infinite size +enum Foo { + Foo_(Bar) +} + +enum Bar { + //~^ ERROR recursive type `Bar` has infinite size + //~| NOTE recursive type has infinite size + BarNone, + BarSome(Bar) //~ NOTE recursive without indirection +} fn main() { } diff --git a/src/test/compile-fail/issue-3779.rs b/src/test/compile-fail/issue-3779.rs index 71e9325ab75..10f73dc0862 100644 --- a/src/test/compile-fail/issue-3779.rs +++ b/src/test/compile-fail/issue-3779.rs @@ -8,9 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -struct S { //~ ERROR E0072 - //~| NOTE recursive type has infinite size +struct S { + //~^ ERROR E0072 + //~| NOTE recursive type has infinite size element: Option<S> + //~^ NOTE recursive without indirection } fn main() { diff --git a/src/test/ui/span/E0072.stderr b/src/test/ui/span/E0072.stderr index 5204390ef9d..1f6dd6b1d16 100644 --- a/src/test/ui/span/E0072.stderr +++ b/src/test/ui/span/E0072.stderr @@ -3,6 +3,9 @@ error[E0072]: recursive type `ListNode` has infinite size | 11 | struct ListNode { | ^^^^^^^^^^^^^^^ recursive type has infinite size +12 | head: u8, +13 | tail: Option<ListNode>, + | ---------------------- recursive without indirection | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `ListNode` representable diff --git a/src/test/ui/span/multiline-span-E0072.stderr b/src/test/ui/span/multiline-span-E0072.stderr index 9c6816e7363..a06cbd04deb 100644 --- a/src/test/ui/span/multiline-span-E0072.stderr +++ b/src/test/ui/span/multiline-span-E0072.stderr @@ -6,6 +6,7 @@ error[E0072]: recursive type `ListNode` has infinite size 14 | | { 15 | | head: u8, 16 | | tail: Option<ListNode>, + | | ---------------------- recursive without indirection 17 | | } | |_^ recursive type has infinite size | diff --git a/src/test/ui/span/recursive-type-field.stderr b/src/test/ui/span/recursive-type-field.stderr index d8219cbc220..b4d0b5a6a25 100644 --- a/src/test/ui/span/recursive-type-field.stderr +++ b/src/test/ui/span/recursive-type-field.stderr @@ -1,34 +1,29 @@ error[E0072]: recursive type `Foo` has infinite size --> $DIR/recursive-type-field.rs:13:1 | -13 | struct Foo<'a> { - | _^ starting here... -14 | | bar: Bar<'a>, - | | ------------ recursive without indirection -15 | | b: Rc<Bar<'a>>, -16 | | } - | |_^ ...ending here: recursive type has infinite size +13 | struct Foo<'a> { + | ^^^^^^^^^^^^^^ recursive type has infinite size +14 | bar: Bar<'a>, + | ------------ recursive without indirection | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Foo` representable error[E0072]: recursive type `Bar` has infinite size --> $DIR/recursive-type-field.rs:18:1 | -18 | struct Bar<'a> { - | _^ starting here... -19 | | y: (Foo<'a>, Foo<'a>), - | | --------------------- recursive without indirection -20 | | z: Option<Bar<'a>>, -21 | | a: &'a Foo<'a>, -22 | | c: &'a [Bar<'a>], -23 | | d: [Bar<'a>; 1], - | | --------------- recursive without indirection -24 | | e: Foo<'a>, - | | ---------- recursive without indirection -25 | | x: Bar<'a>, - | | ---------- recursive without indirection -26 | | } - | |_^ ...ending here: recursive type has infinite size +18 | struct Bar<'a> { + | ^^^^^^^^^^^^^^ recursive type has infinite size +19 | y: (Foo<'a>, Foo<'a>), + | --------------------- recursive without indirection +20 | z: Option<Bar<'a>>, + | ------------------ recursive without indirection +... +23 | d: [Bar<'a>; 1], + | --------------- recursive without indirection +24 | e: Foo<'a>, + | ---------- recursive without indirection +25 | x: Bar<'a>, + | ---------- recursive without indirection | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Bar` representable |
