From ef833d41014481acdfc19bfd50f27f662dba8a2b Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Fri, 16 Nov 2012 19:22:48 -0800 Subject: Introduce a T_err type for type errors This allows more errors to be non-fatal, as per #1871. I only went through and started changing span_fatal to span_err in check.rs. There are probably more errors that could be made non-fatal. So if you see derived type errors appearing from now on, file a bug! r=graydon Closes #1871 --- src/test/compile-fail/cast-from-nil.rs | 2 +- src/test/compile-fail/cast-to-nil.rs | 2 +- src/test/compile-fail/extern-no-call.rs | 2 +- src/test/compile-fail/issue-1871.rs | 7 ++++--- src/test/compile-fail/issue-2149.rs | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src/test') diff --git a/src/test/compile-fail/cast-from-nil.rs b/src/test/compile-fail/cast-from-nil.rs index a76df00d0d5..b7cf35e6f1b 100644 --- a/src/test/compile-fail/cast-from-nil.rs +++ b/src/test/compile-fail/cast-from-nil.rs @@ -1,2 +1,2 @@ -// error-pattern: cast from nil: () as u32 +// error-pattern: cast from nil: `()` as `u32` fn main() { let u = (assert true) as u32; } \ No newline at end of file diff --git a/src/test/compile-fail/cast-to-nil.rs b/src/test/compile-fail/cast-to-nil.rs index 44c0f5a1da2..5c5d456484a 100644 --- a/src/test/compile-fail/cast-to-nil.rs +++ b/src/test/compile-fail/cast-to-nil.rs @@ -1,2 +1,2 @@ -// error-pattern: cast to nil: u32 as () +// error-pattern: cast to nil: `u32` as `()` fn main() { let u = 0u32 as (); } \ No newline at end of file diff --git a/src/test/compile-fail/extern-no-call.rs b/src/test/compile-fail/extern-no-call.rs index e53f4ee6940..4ed32e16d33 100644 --- a/src/test/compile-fail/extern-no-call.rs +++ b/src/test/compile-fail/extern-no-call.rs @@ -1,4 +1,4 @@ -// error-pattern:expected function or foreign function but found *u8 +// error-pattern:expected function or foreign function but found `*u8` extern fn f() { } diff --git a/src/test/compile-fail/issue-1871.rs b/src/test/compile-fail/issue-1871.rs index 6937dbdce07..99458b835f0 100644 --- a/src/test/compile-fail/issue-1871.rs +++ b/src/test/compile-fail/issue-1871.rs @@ -1,11 +1,12 @@ -// xfail-test +// Tests that we don't generate a spurious error about f.honk's type +// being undeterminable fn main() { let f = 42; let _g = if f < 5 { - f.honk(); + f.honk() //~ ERROR attempted access of field `honk` } else { - 12 + () }; } diff --git a/src/test/compile-fail/issue-2149.rs b/src/test/compile-fail/issue-2149.rs index eb8da1519e8..b9ccfc66703 100644 --- a/src/test/compile-fail/issue-2149.rs +++ b/src/test/compile-fail/issue-2149.rs @@ -11,5 +11,5 @@ impl ~[A]: vec_monad { } } fn main() { - ["hi"].bind({|x| [x] }); + ["hi"].bind({|x| [x] }); //~ ERROR attempted access of field `bind` } -- cgit 1.4.1-3-g733a5