diff options
Diffstat (limited to 'src/test/compile-fail/recursion.rs')
| -rw-r--r-- | src/test/compile-fail/recursion.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/test/compile-fail/recursion.rs b/src/test/compile-fail/recursion.rs index 67177eff9f9..f39c839a0e7 100644 --- a/src/test/compile-fail/recursion.rs +++ b/src/test/compile-fail/recursion.rs @@ -8,18 +8,25 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-command-line: See https://github.com/rust-lang/rust/issues/20747 +// +// We also get a second error message at the top of file (dummy +// span). This is not helpful, but also kind of annoying to prevent, +// so for now just live with it, since we also get a second message +// that is more helpful. + enum Nil {NilValue} -struct Cons<T> {head:int, tail:T} -trait Dot {fn dot(&self, other:Self) -> int;} +struct Cons<T> {head:isize, tail:T} +trait Dot {fn dot(&self, other:Self) -> isize;} impl Dot for Nil { - fn dot(&self, _:Nil) -> int {0} + fn dot(&self, _:Nil) -> isize {0} } impl<T:Dot> Dot for Cons<T> { - fn dot(&self, other:Cons<T>) -> int { + fn dot(&self, other:Cons<T>) -> isize { self.head * other.head + self.tail.dot(other.tail) } } -fn test<T:Dot> (n:int, i:int, first:T, second:T) ->int { +fn test<T:Dot> (n:isize, i:isize, first:T, second:T) ->isize { match n { 0 => {first.dot(second)} //~^ ERROR: reached the recursion limit during monomorphization // Error message should be here. It should be a type error |
