diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-06-21 22:32:35 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-06-22 14:35:42 -0400 |
| commit | 3ed96a6d638f8dc8aa081ca1ad82e61caa8930ca (patch) | |
| tree | c9e61e21031dd995975cb1fe073ab7bf0cc8ba01 /src/test/ui/recursion/recursion.rs | |
| parent | 1a4e2b6f9c75a0e21722c88a0e3b610d6ffc3ae3 (diff) | |
| download | rust-3ed96a6d638f8dc8aa081ca1ad82e61caa8930ca.tar.gz rust-3ed96a6d638f8dc8aa081ca1ad82e61caa8930ca.zip | |
Point at the call spawn when overflow occurs during monomorphization
This improves the output for issue #72577, but there's still more work to be done. Currently, an overflow error during monomorphization results in an error that points at the function we were unable to monomorphize. However, we don't point at the call that caused the monomorphization to happen. In the overflow occurs in a large recursive function, it may be difficult to determine where the issue is. This commit tracks and `Span` information during collection of `MonoItem`s, which is used when emitting an overflow error. `MonoItem` itself is unchanged, so this only affects `src/librustc_mir/monomorphize/collector.rs`
Diffstat (limited to 'src/test/ui/recursion/recursion.rs')
| -rw-r--r-- | src/test/ui/recursion/recursion.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/ui/recursion/recursion.rs b/src/test/ui/recursion/recursion.rs index bf1eaef367d..373cc17d0e0 100644 --- a/src/test/ui/recursion/recursion.rs +++ b/src/test/ui/recursion/recursion.rs @@ -12,11 +12,10 @@ impl<T:Dot> Dot for Cons<T> { self.head * other.head + self.tail.dot(other.tail) } } -fn test<T:Dot> (n:isize, i:isize, first:T, second:T) ->isize { //~ ERROR recursion limit +fn test<T:Dot> (n:isize, i:isize, first:T, second:T) ->isize { match n { 0 => {first.dot(second)} - // FIXME(#4287) Error message should be here. It should be - // a type error to instantiate `test` at a type other than T. _ => {test (n-1, i+1, Cons {head:2*i+1, tail:first}, Cons{head:i*i, tail:second})} + //~^ ERROR recursion limit } } pub fn main() { |
