rust/src/test/compile-fail
Tim Chevalier 1a6d029b07 Emit a better error message for unbound type parameters in nested functions
This code was causing a bounds check failure:

fn hd[U](&vec[U] v) -> U {
  fn hd1(&vec[U] w) -> U {
    ret w.(0);
  }
  ret hd1(v);
}

because in hd1, U was being treated as if it referred to a type
parameter of hd1, rather than referring to the lexically enclosing binding
for U that's part of hd.

I'm actually not sure whether this is a legit program or not. But I wanted
to get rid of the bounds check error, so I assumed that program shouldn't
compile and made it a proper error message.
2011-06-21 17:58:49 -07:00
..
aliasness-mismatch.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
alt-tag-nullary.rs
alt-tag-unary.rs
arg-count-mismatch.rs rustc: Fix error pattern in compile-fail/arg-count-mismatch.rs 2011-06-08 18:42:34 -07:00
arg-type-mismatch.rs
assign-alias.rs Extend alias analysis to check assignments 2011-06-15 14:10:07 +02:00
attr-bad-crate-attr.rc Add better error messages for bad attributes in .rc files 2011-06-16 17:23:20 -07:00
attr-before-stmt.rs Improve and test failure behavior for malformed attributes 2011-06-15 19:30:10 -07:00
attr-before-view-item2.rs rustc: Fix regressed handling of bad attributes 2011-06-16 17:23:20 -07:00
attr-before-view-item.rs Improve and test failure behavior for malformed attributes 2011-06-15 19:30:10 -07:00
attr-dangling-in-fn.rs Improve and test failure behavior for malformed attributes 2011-06-15 19:30:10 -07:00
attr-dangling-in-mod.rs Improve and test failure behavior for malformed attributes 2011-06-15 19:30:10 -07:00
bad-alt.rs test: Un-xfail some compile-fail tests 2011-05-23 23:13:18 -04:00
bad-bang-ann-2.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
bad-bang-ann-3.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
bad-bang-ann.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
bad-env-capture2.rs test: Un-xfail some compile-fail tests 2011-05-23 23:13:18 -04:00
bad-env-capture3.rs test: Un-xfail some compile-fail tests 2011-05-23 23:13:18 -04:00
bad-env-capture.rs test: Un-xfail some compile-fail tests 2011-05-23 23:13:18 -04:00
bad-expr-path2.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
bad-expr-path.rs Remove xfail-boot lines from tests 2011-05-14 21:05:22 -04:00
bad-main.rs
bad-module.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
bad-name.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
bad-recv.rs Change the syntax for RECV from "var <- port" to "port |> var". 2011-05-27 12:01:20 -07:00
bad-send.rs test: Un-xfail some compile-fail tests 2011-05-23 23:13:18 -04:00
bad-type-env-capture.rs
bind-alias.rs
binop-typeck.rs rustc: Fail to unify if two ty_vars don't unify 2011-06-17 11:35:00 -07:00
bogus-tag.rs
break-outside-loop.rs Add xfail-stage0 to some tests (not sure if it matters...) 2011-06-14 12:27:23 -07:00
break-uninit2.rs Remove xfail-boot lines from tests 2011-05-14 21:05:22 -04:00
break-uninit.rs test: Fix mismatched types in prep for typechecker fixes 2011-06-17 11:35:00 -07:00
capture1.rs
capture2.rs
constructor-as-cast.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
dead-code-be.rs
dead-code-ret.rs
direct-obj-fn-call.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
does-nothing.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
duplicate-name.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
export2.rs Remove xfail-boot lines from tests 2011-05-14 21:05:22 -04:00
export-fully-qualified.rs Remove xfail-boot lines from tests 2011-05-14 21:05:22 -04:00
export-import.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
export-no-tag-variants.rs Remove xfail-boot lines from tests 2011-05-14 21:05:22 -04:00
export-tag-variant.rs Remove xfail-boot lines from tests 2011-05-14 21:05:22 -04:00
export.rs Remove xfail-boot lines from tests 2011-05-14 21:05:22 -04:00
ext-after-attrib.rs test: Add a compile-fail test for attribute/syntax parsing 2011-06-15 16:01:39 -07:00
ext-nonexistent.rs rustc: Use a set-based approach to unification; remove ty_bound_param and ty_local. 2011-06-07 19:33:18 -07:00
extenv-no-args.rs rustc: Use spans for #env errors 2011-06-04 17:14:32 -04:00
extenv-not-string-literal.rs rustc: Use spans for #env errors 2011-06-04 17:14:32 -04:00
extenv-too-many-args.rs rustc: Use spans for #env errors 2011-06-04 17:14:32 -04:00
extfmt-missing-type.rs stdlib: Use spans for #fmt errors originating in std 2011-06-04 19:48:19 -04:00
extfmt-no-args.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
extfmt-non-literal2.rs rustc: Use spans on extfmt error messages 2011-06-04 17:10:04 -04:00
extfmt-non-literal.rs rustc: Fail better when the first argument to #fmt is not a string literal 2011-05-25 23:50:19 -04:00
extfmt-not-enough-args.rs rustc: Use spans on extfmt error messages 2011-06-04 17:10:04 -04:00
extfmt-too-many-args.rs rustc: Fail when #fmt is given too many arguments 2011-05-25 23:43:04 -04:00
extfmt-unknown-type.rs stdlib: Use spans for #fmt errors originating in std 2011-06-04 19:48:19 -04:00
extfmt-unsigned-plus.rs rustc: Use spans on extfmt error messages 2011-06-04 17:10:04 -04:00
extfmt-unsigned-space.rs rustc: Use spans on extfmt error messages 2011-06-04 17:10:04 -04:00
extfmt-unterminated-conv.rs stdlib: Use spans for #fmt errors originating in std 2011-06-04 19:48:19 -04:00
fail-simple.rs Parser fix: 'fail' was eating the next token that came after it. 2011-05-17 05:40:17 +00:00
fn-bad-block-type.rs Typecheck block tail expressions that are fn return values 2011-06-18 20:23:05 -07:00
fn-constraint.rs Serialize constraints in types (literal arguments still not supported) 2011-06-21 14:37:33 -07:00
for-loop-decl.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
forgot-ret.rs Un-xfail some tests that work 2011-06-14 12:27:23 -07:00
fru-extra-field.rs
fru-typestate.rs
if-branch-types.rs test: Add a test for mismatched types of if branches 2011-05-21 18:18:48 -04:00
if-check-precond-fail.rs Restructure the "checking" pass in typestate 2011-06-17 19:09:18 -07:00
if-typeck.rs rustc: Demand that if conditions have bool type 2011-06-17 11:35:00 -07:00
import2.rs Remove xfail-boot lines from tests 2011-05-14 21:05:22 -04:00
import3.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
import4.rs Remove xfail-boot lines from tests 2011-05-14 21:05:22 -04:00
import5.rs Now imports are not re-exported unless 'export' is explicitly used. 2011-05-31 18:43:26 -07:00
import-glob-0.rs Fix bugs: make sure glob imports show up in the right module, 2011-05-27 02:42:33 +00:00
import-glob-circular.rs Now imports are not re-exported unless 'export' is explicitly used. 2011-05-31 18:43:26 -07:00
import-glob-multiple.rs Handle circularity in glob imports in a more elegant fashion. 2011-05-27 02:42:33 +00:00
import-loop-2.rs Now imports are not re-exported unless 'export' is explicitly used. 2011-05-31 18:43:26 -07:00
import-loop.rs Now imports are not re-exported unless 'export' is explicitly used. 2011-05-31 18:43:26 -07:00
import.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
impure-pred.rs Serialize constraints in types (literal arguments still not supported) 2011-06-21 14:37:33 -07:00
infinite-tag-type-recursion.rs
infinite-vec-type-recursion.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
item-name-overload.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
missing-return2.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
missing-return.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
multiline-comment-line-tracking.rs Fix mistaken replacements in error-pattern comments in tests 2011-05-12 21:45:29 +02:00
nested-ty-params.rs Emit a better error message for unbound type parameters in nested functions 2011-06-21 17:58:49 -07:00
no-self-dispatch.rs test: Un-xfail some compile-fail tests 2011-05-23 23:13:18 -04:00
not-a-pred-2.rs Un-XFAIL some tests that now pass. 2011-05-20 19:54:14 -07:00
not-a-pred-3.rs Un-XFAIL some tests that now pass. 2011-05-20 19:54:14 -07:00
not-a-pred-check.rs Un-XFAIL some tests that now pass. 2011-05-20 19:54:14 -07:00
not-a-pred.rs Refactor data structures representing constraints (again...) 2011-06-15 15:38:12 -07:00
not-pred-args.rs Serialize constraints in types (literal arguments still not supported) 2011-06-21 14:37:33 -07:00
output-type-mismatch.rs
pattern-tyvar-2.rs Un-XFAIL some tests that now pass. 2011-05-20 19:54:14 -07:00
pattern-tyvar.rs Un-xfail some tests that work 2011-06-14 12:27:23 -07:00
pred-not-bool.rs Un-XFAIL some tests that now pass. 2011-05-20 19:54:14 -07:00
pred-on-wrong-slots.rs Un-XFAIL pred-on-wrong-slots 2011-06-10 19:17:15 -07:00
put-in-fn.rs
rec-missing-fields.rs
ret-non-nil.rs Use span_err instead of err. Fixes issue #444. 2011-06-01 17:22:23 -07:00
return-uninit.rs
self-missing-method.rs Remove xfail-boot lines from tests 2011-05-14 21:05:22 -04:00
shadow.rs Fix testcase to be slightly less fussy about line number of error, as it just drifted. 2011-05-26 18:29:28 -07:00
slot-as-pred.rs Un-xfail some tests that work 2011-06-14 12:27:23 -07:00
spawn-non-nil-fn.rs rustc: Use demand functions instead of open-coded typecheck for spawn 2011-05-24 20:23:21 -04:00
swap-uninit.rs Write some tests for swap. 2011-06-16 11:47:54 -07:00
tag-type-args.rs Improve error message for wrong number of type arguments 2011-06-09 14:50:49 -07:00
tail-non-call.rs Remove xfail-boot lines from tests 2011-05-14 21:05:22 -04:00
tail-typeck.rs
type-recursive.rs Add xfail-stage0 to some tests (not sure if it matters...) 2011-06-14 12:27:23 -07:00
type-shadow.rs
unbalanced-comment.rs test: Un-xfail some compile-fail tests 2011-05-23 23:13:18 -04:00
unsafe-alias-2.rs A revised, improved alias-checker 2011-06-09 13:11:29 +02:00
unsafe-alias.rs A revised, improved alias-checker 2011-06-09 13:11:29 +02:00
unsafe-alt.rs A revised, improved alias-checker 2011-06-09 13:11:29 +02:00
unsafe-for.rs Add new visitor framework 2011-06-09 13:08:38 +02:00
unsafe-mutable-alias.rs Handle mutable references in alias analysis 2011-06-10 16:44:33 +02:00
use-uninit-2.rs Fix mistaken replacements in error-pattern comments in tests 2011-05-12 21:45:29 +02:00
use-uninit-3.rs Fix mistaken replacements in error-pattern comments in tests 2011-05-12 21:45:29 +02:00
use-uninit-dtor.rs Fix mistaken replacements in error-pattern comments in tests 2011-05-12 21:45:29 +02:00
use-uninit.rs Fix mistaken replacements in error-pattern comments in tests 2011-05-12 21:45:29 +02:00
vector-no-ann.rs Remove some unnecessary xfails 2011-06-14 15:11:48 -07:00
while-bypass.rs
while-expr.rs
while-type-error.rs
writing-through-read-alias.rs Extend alias analysis to check assignments 2011-06-15 14:10:07 +02:00
writing-through-uninit-vec.rs
writing-to-immutable-obj.rs Implement checking against assignments to immutable obj fields 2011-06-15 14:59:51 +02:00
writing-to-immutable-rec.rs
writing-to-immutable-tup.rs
writing-to-immutable-vec.rs Extend alias analysis to check assignments 2011-06-15 14:10:07 +02:00
wrong-ret-type.rs