1
Fork 0

change the test suite //! kind syntax to //~ kind in order to avoid a

conflict with the new single-line-sugared-inner-doc-comment (`//! ...`).
This commit is contained in:
Gareth Daniel Smith 2012-06-30 12:23:59 +01:00
parent 0b653ab953
commit 6d86969260
253 changed files with 596 additions and 596 deletions

View file

@ -21,14 +21,14 @@ fn load_errors(testfile: str) -> [expected_error]/~ {
}
fn parse_expected(line_num: uint, line: str) -> [expected_error]/~ unsafe {
let error_tag = "//!";
let error_tag = "//~";
let mut idx;
alt str::find_str(line, error_tag) {
option::none { ret []/~; }
option::some(nn) { idx = (nn as uint) + str::len(error_tag); }
}
// "//!^^^ kind msg" denotes a message expected
// "//~^^^ kind msg" denotes a message expected
// three lines above current line:
let mut adjust_line = 0u;
let len = str::len(line);

View file

@ -6,6 +6,6 @@ fn my_fail() -> ! { fail; }
fn main() {
alt true { false { my_fail(); } true { } }
log(debug, x); //! ERROR unresolved name: x
log(debug, x); //~ ERROR unresolved name: x
let x: int;
}

View file

@ -10,7 +10,7 @@ fn main() {
rgb(_, _, _) { }
cmyk(_, _, _, _) { }
no_color(_) { }
//!^ ERROR this pattern has 1 field, but the corresponding variant has no fields
//~^ ERROR this pattern has 1 field, but the corresponding variant has no fields
}
}
}

View file

@ -8,7 +8,7 @@ fn main() {
fn foo(c: color) {
alt c {
rgb(_, _) { }
//!^ ERROR this pattern has 2 fields, but the corresponding variant has 3 fields
//~^ ERROR this pattern has 2 fields, but the corresponding variant has 3 fields
cmyk(_, _, _, _) { }
no_color { }
}

View file

@ -1,3 +1,3 @@
impl methods1 for uint { fn me() -> uint { self } } //! NOTE candidate #1 is `methods1::me`
impl methods2 for uint { fn me() -> uint { self } } //! NOTE candidate #2 is `methods2::me`
fn main() { 1u.me(); } //! ERROR multiple applicable methods in scope
impl methods1 for uint { fn me() -> uint { self } } //~ NOTE candidate #1 is `methods1::me`
impl methods2 for uint { fn me() -> uint { self } } //~ NOTE candidate #2 is `methods2::me`
fn main() { 1u.me(); } //~ ERROR multiple applicable methods in scope

View file

@ -2,6 +2,6 @@
// aux-build:ambig_impl_2_lib.rs
use ambig_impl_2_lib;
import ambig_impl_2_lib::methods1;
impl methods2 for uint { fn me() -> uint { self } } //! NOTE candidate #2 is `methods2::me`
fn main() { 1u.me(); } //! ERROR multiple applicable methods in scope
//!^ NOTE candidate #1 is `ambig_impl_2_lib::methods1::me`
impl methods2 for uint { fn me() -> uint { self } } //~ NOTE candidate #2 is `methods2::me`
fn main() { 1u.me(); } //~ ERROR multiple applicable methods in scope
//~^ NOTE candidate #1 is `ambig_impl_2_lib::methods1::me`

View file

@ -2,9 +2,9 @@ iface A { fn foo(); }
iface B { fn foo(); }
fn foo<T: A B>(t: T) {
t.foo(); //! ERROR multiple applicable methods in scope
//!^ NOTE candidate #1 derives from the bound `A`
//!^^ NOTE candidate #2 derives from the bound `B`
t.foo(); //~ ERROR multiple applicable methods in scope
//~^ NOTE candidate #1 derives from the bound `A`
//~^^ NOTE candidate #2 derives from the bound `B`
}
fn main() {}

View file

@ -1,12 +1,12 @@
impl methods for [uint]/~ {
fn foo() -> int {1} //! NOTE candidate #1 is `methods::foo`
fn foo() -> int {1} //~ NOTE candidate #1 is `methods::foo`
}
impl methods for [int]/~ {
fn foo() -> int {2} //! NOTE candidate #2 is `methods::foo`
fn foo() -> int {2} //~ NOTE candidate #2 is `methods::foo`
}
fn main() {
let x = []/~;
x.foo(); //! ERROR multiple applicable methods in scope
x.foo(); //~ ERROR multiple applicable methods in scope
}

View file

@ -1,8 +1,8 @@
fn test() {
let v: int;
v = 1; //! NOTE prior assignment occurs here
v = 1; //~ NOTE prior assignment occurs here
#debug["v=%d", v];
v = 2; //! ERROR re-assignment of immutable variable
v = 2; //~ ERROR re-assignment of immutable variable
#debug["v=%d", v];
}

View file

@ -1,5 +1,5 @@
fn main() {
let mut x: [mut int]/~ = [mut 3]/~;
let y: [int]/~ = [3]/~;
x = y; //! ERROR values differ in mutability
x = y; //~ ERROR values differ in mutability
}

View file

@ -11,5 +11,5 @@ class cat {
fn main() {
let nyan : cat = cat(52u, 99);
nyan.speak = fn@() { #debug["meow"]; }; //! ERROR assigning to method
nyan.speak = fn@() { #debug["meow"]; }; //~ ERROR assigning to method
}

View file

@ -1,6 +1,6 @@
// Check that bogus field access is non-fatal
fn main() {
let x = 0;
log(debug, x.foo); //! ERROR attempted access of field
log(debug, x.bar); //! ERROR attempted access of field
log(debug, x.foo); //~ ERROR attempted access of field
log(debug, x.bar); //~ ERROR attempted access of field
}

View file

@ -1,4 +1,4 @@
fn main() {
#[attr]
#debug("hi"); //! ERROR expected item
#debug("hi"); //~ ERROR expected item
}

View file

@ -1,4 +1,4 @@
fn main() {
#[attr]
let _i = 0; //! ERROR expected item
let _i = 0; //~ ERROR expected item
}

View file

@ -3,7 +3,7 @@
fn bad_bang(i: uint) -> ! {
ret 7u;
//!^ ERROR expected `_|_` but found `uint`
//~^ ERROR expected `_|_` but found `uint`
}
fn main() { bad_bang(5u); }

View file

@ -3,7 +3,7 @@
fn bad_bang(i: uint) -> ! {
if i < 0u { } else { fail; }
//!^ ERROR expected `_|_` but found `()`
//~^ ERROR expected `_|_` but found `()`
}
fn main() { bad_bang(5u); }

View file

@ -1,4 +1,4 @@
fn main() {
fn baz(_x: fn() -> int) {}
for baz {|_e| } //! ERROR should return `bool`
for baz {|_e| } //~ ERROR should return `bool`
}

View file

@ -1,5 +1,5 @@
fn foo<T>() {
1u.bar::<T>(); //! ERROR: missing `copy`
1u.bar::<T>(); //~ ERROR: missing `copy`
}
impl methods for uint {

View file

@ -1,2 +1,2 @@
fn false() { } //! ERROR found `false` in restricted position
fn false() { } //~ ERROR found `false` in restricted position
fn main() { }

View file

@ -1,2 +1,2 @@
fn true() { } //! ERROR found `true` in restricted position
fn true() { } //~ ERROR found `true` in restricted position
fn main() { }

View file

@ -2,6 +2,6 @@ fn main() {
let x = 3;
fn blah(_a: native fn()) {}
blah({||
log(debug, x); //! ERROR attempted dynamic environment capture
log(debug, x); //~ ERROR attempted dynamic environment capture
});
}

View file

@ -1,4 +1,4 @@
fn f() -> ! {
3i //! ERROR expected `_|_` but found `int`
3i //~ ERROR expected `_|_` but found `int`
}
fn main() { }

View file

@ -4,5 +4,5 @@ fn main() {
let x = true;
let y = 1;
let z = x + y;
//!^ ERROR binary operation + cannot be applied to type `bool`
//~^ ERROR binary operation + cannot be applied to type `bool`
}

View file

@ -3,7 +3,7 @@ fn compute1() -> float {
let v = [0f, 1f, 2f, 3f]/~;
vec::foldl(0f, v) { |x, y| x + y } - 10f
//!^ ERROR mismatched types: expected `()`
//~^ ERROR mismatched types: expected `()`
}
fn main() {

View file

@ -9,5 +9,5 @@ fn main() {
}
f(g);
//!^ ERROR mismatched types: expected `extern fn(extern fn(extern fn()))`
//~^ ERROR mismatched types: expected `extern fn(extern fn(extern fn()))`
}

View file

@ -6,7 +6,7 @@ fn coerce(b: fn()) -> native fn() {
g: fn()) -> native fn() { ret f(g); }
fn fn_id(f: native fn()) -> native fn() { ret f }
ret lol(fn_id, b);
//!^ ERROR mismatched types: expected `extern fn(fn()) -> extern fn()`
//~^ ERROR mismatched types: expected `extern fn(fn()) -> extern fn()`
}
fn main() {

View file

@ -4,9 +4,9 @@ fn a() {
let mut p = [mut 1]/~;
// Create an immutable pointer into p's contents:
let _q: &int = &p[0]; //! NOTE loan of mutable vec content granted here
let _q: &int = &p[0]; //~ NOTE loan of mutable vec content granted here
p[0] = 5; //! ERROR assigning to mutable vec content prohibited due to outstanding loan
p[0] = 5; //~ ERROR assigning to mutable vec content prohibited due to outstanding loan
}
fn borrow(_x: [int]/&, _f: fn()) {}
@ -17,8 +17,8 @@ fn b() {
let mut p = [mut 1]/~;
borrow(p) {|| //! NOTE loan of mutable vec content granted here
p[0] = 5; //! ERROR assigning to mutable vec content prohibited due to outstanding loan
borrow(p) {|| //~ NOTE loan of mutable vec content granted here
p[0] = 5; //~ ERROR assigning to mutable vec content prohibited due to outstanding loan
}
}

View file

@ -2,12 +2,12 @@ type point = { x: int, y: int };
fn a() {
let mut p = {x: 3, y: 4};
let _q = &p; //! NOTE loan of mutable local variable granted here
let _q = &p; //~ NOTE loan of mutable local variable granted here
// This assignment is illegal because the field x is not
// inherently mutable; since `p` was made immutable, `p.x` is now
// immutable. Otherwise the type of &_q.x (&int) would be wrong.
p.x = 5; //! ERROR assigning to mutable field prohibited due to outstanding loan
p.x = 5; //~ ERROR assigning to mutable field prohibited due to outstanding loan
}
fn b() {
@ -24,8 +24,8 @@ fn c() {
// and then try to overwrite `p` as a whole.
let mut p = {x: 3, mut y: 4};
let _q = &p.y; //! NOTE loan of mutable local variable granted here
p = {x: 5, mut y: 7};//! ERROR assigning to mutable local variable prohibited due to outstanding loan
let _q = &p.y; //~ NOTE loan of mutable local variable granted here
p = {x: 5, mut y: 7};//~ ERROR assigning to mutable local variable prohibited due to outstanding loan
copy p;
}
@ -34,8 +34,8 @@ fn d() {
// address of a subcomponent and then modify that subcomponent:
let mut p = {x: 3, mut y: 4};
let _q = &p.y; //! NOTE loan of mutable field granted here
p.y = 5; //! ERROR assigning to mutable field prohibited due to outstanding loan
let _q = &p.y; //~ NOTE loan of mutable field granted here
p.y = 5; //~ ERROR assigning to mutable field prohibited due to outstanding loan
copy p;
}

View file

@ -2,6 +2,6 @@ const foo: int = 5;
fn main() {
// assigning to various global constants
none = some(3); //! ERROR assigning to static item
foo = 6; //! ERROR assigning to static item
none = some(3); //~ ERROR assigning to static item
foo = 6; //~ ERROR assigning to static item
}

View file

@ -2,5 +2,5 @@ enum foo = int;
fn main() {
let x = foo(3);
*x = 4; //! ERROR assigning to enum content
*x = 4; //~ ERROR assigning to enum content
}

View file

@ -14,7 +14,7 @@ fn main() {
// in these cases we pass through a box, so the mut
// of the box is dominant
p.x.a = 2; //! ERROR assigning to immutable field
p.y.a = 2; //! ERROR assigning to const field
p.x.a = 2; //~ ERROR assigning to immutable field
p.y.a = 2; //~ ERROR assigning to const field
p.z.a = 2;
}

View file

@ -6,8 +6,8 @@ fn main() {
alt x {
{f: v} => {
impure(v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
impure(v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
}
}

View file

@ -1,8 +1,8 @@
fn main() {
let x = some(~1);
alt x { //! NOTE loan of immutable local variable granted here
alt x { //~ NOTE loan of immutable local variable granted here
some(y) {
let _a <- x; //! ERROR moving out of immutable local variable prohibited due to outstanding loan
let _a <- x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
}
_ {}
}

View file

@ -2,7 +2,7 @@ fn main() {
let x = some(~1);
alt x {
some(y) {
let _b <- y; //! ERROR moving out of pattern binding
let _b <- y; //~ ERROR moving out of pattern binding
}
_ {}
}

View file

@ -5,8 +5,8 @@ fn borrow_from_arg_imm_ref(&&v: ~int) {
}
fn borrow_from_arg_mut_ref(&v: ~int) {
borrow(v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn borrow_from_arg_move(-v: ~int) {

View file

@ -19,23 +19,23 @@ fn post_aliased_const() {
fn post_aliased_mut() {
// SPURIOUS--flow
let mut v = ~3;
borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan
let _w = &mut v; //! NOTE prior loan as mutable granted here
borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
let _w = &mut v; //~ NOTE prior loan as mutable granted here
}
fn post_aliased_scope(cond: bool) {
// NDM--scope of &
let mut v = ~3;
borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan
if cond { inc(&mut v); } //! NOTE prior loan as mutable granted here
borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
if cond { inc(&mut v); } //~ NOTE prior loan as mutable granted here
}
fn loop_aliased_mut() {
let mut v = ~3, w = ~4;
let mut _x = &mut w;
loop {
borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan
_x = &mut v; //! NOTE prior loan as mutable granted here
borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
_x = &mut v; //~ NOTE prior loan as mutable granted here
}
}
@ -43,8 +43,8 @@ fn while_aliased_mut(cond: bool) {
let mut v = ~3, w = ~4;
let mut _x = &mut w;
while cond {
borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan
_x = &mut v; //! NOTE prior loan as mutable granted here
borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
_x = &mut v; //~ NOTE prior loan as mutable granted here
}
}
@ -52,9 +52,9 @@ fn while_aliased_mut_cond(cond: bool, cond2: bool) {
let mut v = ~3, w = ~4;
let mut _x = &mut w;
while cond {
borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan
borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
if cond2 {
_x = &mut v; //! NOTE prior loan as mutable granted here
_x = &mut v; //~ NOTE prior loan as mutable granted here
}
}
}
@ -63,8 +63,8 @@ fn loop_in_block() {
let mut v = ~3, w = ~4;
let mut _x = &mut w;
for uint::range(0u, 10u) {|_i|
borrow(v); //! ERROR loan of mutable variable declared in an outer block as immutable conflicts with prior loan
_x = &mut v; //! NOTE prior loan as mutable granted here
borrow(v); //~ ERROR loan of mutable variable declared in an outer block as immutable conflicts with prior loan
_x = &mut v; //~ NOTE prior loan as mutable granted here
}
}
@ -77,8 +77,8 @@ fn at_most_once_block() {
let mut v = ~3, w = ~4;
let mut _x = &mut w;
at_most_once {||
borrow(v); //! ERROR loan of mutable variable declared in an outer block as immutable conflicts with prior loan
_x = &mut v; //! NOTE prior loan as mutable granted here
borrow(v); //~ ERROR loan of mutable variable declared in an outer block as immutable conflicts with prior loan
_x = &mut v; //~ NOTE prior loan as mutable granted here
}
}

View file

@ -4,16 +4,16 @@ fn borrow(v: &int, f: fn(x: &int)) {
fn box_imm() {
let mut v = ~3;
let _w = &mut v; //! NOTE loan of mutable local variable granted here
let _w = &mut v; //~ NOTE loan of mutable local variable granted here
task::spawn { |move v|
//!^ ERROR moving out of mutable local variable prohibited due to outstanding loan
//~^ ERROR moving out of mutable local variable prohibited due to outstanding loan
#debug["v=%d", *v];
}
let mut v = ~3;
let _w = &mut v; //! NOTE loan of mutable local variable granted here
let _w = &mut v; //~ NOTE loan of mutable local variable granted here
task::spawn(fn~(move v) {
//!^ ERROR moving out of mutable local variable prohibited due to outstanding loan
//~^ ERROR moving out of mutable local variable prohibited due to outstanding loan
#debug["v=%d", *v];
});
}

View file

@ -3,8 +3,8 @@ fn take(-_v: ~int) {
fn box_imm() {
let v = ~3;
let _w = &v; //! NOTE loan of immutable local variable granted here
take(v); //! ERROR moving out of immutable local variable prohibited due to outstanding loan
let _w = &v; //~ NOTE loan of immutable local variable granted here
take(v); //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
}
fn main() {

View file

@ -4,8 +4,8 @@ fn borrow(v: &int, f: fn(x: &int)) {
fn box_imm() {
let mut v = ~3;
borrow(v) { |w| //! NOTE loan of mutable local variable granted here
v = ~4; //! ERROR assigning to mutable variable declared in an outer block prohibited due to outstanding loan
borrow(v) { |w| //~ NOTE loan of mutable local variable granted here
v = ~4; //~ ERROR assigning to mutable variable declared in an outer block prohibited due to outstanding loan
assert *v == 3;
assert *w == 4;
}

View file

@ -18,11 +18,11 @@ fn b() {
// Here I create an outstanding loan and check that we get conflicts:
&mut p; //! NOTE prior loan as mutable granted here
//!^ NOTE prior loan as mutable granted here
&mut p; //~ NOTE prior loan as mutable granted here
//~^ NOTE prior loan as mutable granted here
p + 3; //! ERROR loan of mutable local variable as immutable conflicts with prior loan
p * 3; //! ERROR loan of mutable local variable as immutable conflicts with prior loan
p + 3; //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
p * 3; //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
}
fn c() {
@ -35,8 +35,8 @@ fn c() {
// ...but not impure fns
*q * 3; //! ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory
//!^ NOTE impure due to access to impure function
*q * 3; //~ ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory
//~^ NOTE impure due to access to impure function
}
fn main() {

View file

@ -19,8 +19,8 @@ fn a() {
p.impurem();
// But in this case we do not honor the loan:
p.blockm {|| //! NOTE loan of mutable local variable granted here
p.x = 10; //! ERROR assigning to mutable field prohibited due to outstanding loan
p.blockm {|| //~ NOTE loan of mutable local variable granted here
p.x = 10; //~ ERROR assigning to mutable field prohibited due to outstanding loan
}
}
@ -29,11 +29,11 @@ fn b() {
// Here I create an outstanding loan and check that we get conflicts:
&mut p; //! NOTE prior loan as mutable granted here
//!^ NOTE prior loan as mutable granted here
&mut p; //~ NOTE prior loan as mutable granted here
//~^ NOTE prior loan as mutable granted here
p.purem(); //! ERROR loan of mutable local variable as immutable conflicts with prior loan
p.impurem(); //! ERROR loan of mutable local variable as immutable conflicts with prior loan
p.purem(); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
p.impurem(); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
}
fn c() {
@ -45,8 +45,8 @@ fn c() {
(*q).purem();
// ...but not impure fns
(*q).impurem(); //! ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory
//!^ NOTE impure due to access to impure function
(*q).impurem(); //~ ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory
//~^ NOTE impure due to access to impure function
}
fn main() {

View file

@ -14,8 +14,8 @@ fn has_mut_vec_and_does_not_try_to_change_it() {
fn has_mut_vec_but_tries_to_change_it() {
let v = [mut 1, 2, 3]/~;
takes_imm_elt(&v[0]) {|| //! NOTE loan of mutable vec content granted here
v[1] = 4; //! ERROR assigning to mutable vec content prohibited due to outstanding loan
takes_imm_elt(&v[0]) {|| //~ NOTE loan of mutable vec content granted here
v[1] = 4; //~ ERROR assigning to mutable vec content prohibited due to outstanding loan
}
}

View file

@ -1,5 +1,5 @@
fn foo(x: *~int) -> ~int {
let y <- *x; //! ERROR dereference of unsafe pointer requires unsafe function or block
let y <- *x; //~ ERROR dereference of unsafe pointer requires unsafe function or block
ret y;
}

View file

@ -1,6 +1,6 @@
fn main() {
let x: int = 3;
let y: &mut int = &mut x; //! ERROR taking mut reference to immutable local variable
let y: &mut int = &mut x; //~ ERROR taking mut reference to immutable local variable
*y = 5;
log (debug, *y);
}

View file

@ -5,8 +5,8 @@ fn want_slice(v: [int]/&) -> int {
}
fn has_mut_vec(+v: @[mut int]/~) -> int {
want_slice(*v) //! ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory
//!^ NOTE impure due to access to impure function
want_slice(*v) //~ ERROR illegal borrow unless pure: creating immutable alias to aliasable, mutable memory
//~^ NOTE impure due to access to impure function
}
fn main() {

View file

@ -5,9 +5,9 @@ enum cycle {
fn main() {
let x = ~node({mut a: ~empty});
// Create a cycle!
alt check *x { //! NOTE loan of immutable local variable granted here
alt check *x { //~ NOTE loan of immutable local variable granted here
node(y) {
y.a <- x; //! ERROR moving out of immutable local variable prohibited due to outstanding loan
y.a <- x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
}
};
}

View file

@ -27,8 +27,8 @@ fn process(_i: int) {}
fn match_const_box_and_do_bad_things(v: &const @const option<int>) {
alt *v {
@some(i) { //! ERROR illegal borrow unless pure: enum variant in aliasable, mutable location
process(i) //! NOTE impure due to access to impure function
@some(i) { //~ ERROR illegal borrow unless pure: enum variant in aliasable, mutable location
process(i) //~ NOTE impure due to access to impure function
}
@none {}
}

View file

@ -33,8 +33,8 @@ fn match_const_reg_unused(v: &const option<int>) {
fn match_const_reg_impure(v: &const option<int>) {
alt *v {
some(i) {impure(i)} //! ERROR illegal borrow unless pure: enum variant in aliasable, mutable location
//!^ NOTE impure due to access to impure function
some(i) {impure(i)} //~ ERROR illegal borrow unless pure: enum variant in aliasable, mutable location
//~^ NOTE impure due to access to impure function
none {}
}
}

View file

@ -2,11 +2,11 @@
fn main() {
let mut x: option<int> = none;
alt x { //! NOTE loan of mutable local variable granted here
alt x { //~ NOTE loan of mutable local variable granted here
none {}
some(i) {
// Not ok: i is an outstanding ptr into x.
x = some(i+1); //! ERROR assigning to mutable local variable prohibited due to outstanding loan
x = some(i+1); //~ ERROR assigning to mutable local variable prohibited due to outstanding loan
}
}
copy x; // just to prevent liveness warnings

View file

@ -2,14 +2,14 @@
fn main() {
let mut x = none;
alt x { //! NOTE loan of mutable local variable granted here
alt x { //~ NOTE loan of mutable local variable granted here
none {
// It is ok to reassign x here, because there is in
// fact no outstanding loan of x!
x = some(0);
}
some(i) {
x = some(1); //! ERROR assigning to mutable local variable prohibited due to outstanding loan
x = some(1); //~ ERROR assigning to mutable local variable prohibited due to outstanding loan
}
}
copy x; // just to prevent liveness warnings

View file

@ -4,8 +4,8 @@ fn test1(x: @mut ~int) {
// Here, evaluating the second argument actually invalidates the
// first borrow, even though it occurs outside of the scope of the
// borrow!
pure_borrow(*x, *x = ~5); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to assigning to dereference of mutable @ pointer
pure_borrow(*x, *x = ~5); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to assigning to dereference of mutable @ pointer
}
fn test2() {
@ -13,8 +13,8 @@ fn test2() {
// Same, but for loanable data:
pure_borrow(x, x = ~5); //! ERROR assigning to mutable local variable prohibited due to outstanding loan
//!^ NOTE loan of mutable local variable granted here
pure_borrow(x, x = ~5); //~ ERROR assigning to mutable local variable prohibited due to outstanding loan
//~^ NOTE loan of mutable local variable granted here
copy x;
}

View file

@ -4,9 +4,9 @@ fn impure(_i: int) {}
fn foo(v: &const option<int>) {
alt *v {
some(i) {
//!^ ERROR illegal borrow unless pure: enum variant in aliasable, mutable location
//~^ ERROR illegal borrow unless pure: enum variant in aliasable, mutable location
unchecked {
impure(i); //! NOTE impure due to access to impure function
impure(i); //~ NOTE impure due to access to impure function
}
}
none {

View file

@ -1,23 +1,23 @@
fn borrow(_v: &int) {}
fn box_mut(v: @mut ~int) {
borrow(*v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(*v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_rec_mut(v: @{mut f: ~int}) {
borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_mut_rec(v: @mut {f: ~int}) {
borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_mut_recs(v: @mut {f: {g: {h: ~int}}}) {
borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_imm(v: @~int) {
@ -33,28 +33,28 @@ fn box_imm_recs(v: @{f: {g: {h: ~int}}}) {
}
fn box_const(v: @const ~int) {
borrow(*v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(*v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_rec_const(v: @{const f: ~int}) {
borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_recs_const(v: @{f: {g: {const h: ~int}}}) {
borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_const_rec(v: @const {f: ~int}) {
borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_const_recs(v: @const {f: {g: {h: ~int}}}) {
borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn main() {

View file

@ -29,8 +29,8 @@ fn aliased_const() {
fn aliased_mut() {
let mut v = ~3;
let _w = &mut v; //! NOTE prior loan as mutable granted here
borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan
let _w = &mut v; //~ NOTE prior loan as mutable granted here
borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
}
fn aliased_other() {
@ -42,8 +42,8 @@ fn aliased_other() {
fn aliased_other_reassign() {
let mut v = ~3, w = ~4;
let mut _x = &mut w;
_x = &mut v; //! NOTE prior loan as mutable granted here
borrow(v); //! ERROR loan of mutable local variable as immutable conflicts with prior loan
_x = &mut v; //~ NOTE prior loan as mutable granted here
borrow(v); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
}
fn main() {

View file

@ -1,23 +1,23 @@
fn borrow(_v: &int) {}
fn box_mut(v: &mut ~int) {
borrow(*v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(*v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_rec_mut(v: &{mut f: ~int}) {
borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_mut_rec(v: &mut {f: ~int}) {
borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_mut_recs(v: &mut {f: {g: {h: ~int}}}) {
borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_imm(v: &~int) {
@ -33,28 +33,28 @@ fn box_imm_recs(v: &{f: {g: {h: ~int}}}) {
}
fn box_const(v: &const ~int) {
borrow(*v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(*v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_rec_const(v: &{const f: ~int}) {
borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_recs_const(v: &{f: {g: {const h: ~int}}}) {
borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_const_rec(v: &const {f: ~int}) {
borrow(v.f); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn box_const_recs(v: &const {f: {g: {h: ~int}}}) {
borrow(v.f.g.h); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//!^ NOTE impure due to access to impure function
borrow(v.f.g.h); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
//~^ NOTE impure due to access to impure function
}
fn main() {

View file

@ -1,7 +1,7 @@
fn main() {
let x = 5;
let _y = fn~(move x) -> int {
let _z = fn~(move x) -> int { x }; //! ERROR moving out of variable declared in an outer block
let _z = fn~(move x) -> int { x }; //~ ERROR moving out of variable declared in an outer block
22
};
}

View file

@ -6,9 +6,9 @@ fn main() {
foo {|| bar(x); }
let x = @3;
foo {|copy x| bar(x); } //! ERROR cannot capture values explicitly with a block closure
foo {|copy x| bar(x); } //~ ERROR cannot capture values explicitly with a block closure
let x = @3;
foo {|move x| bar(x); } //! ERROR cannot capture values explicitly with a block closure
foo {|move x| bar(x); } //~ ERROR cannot capture values explicitly with a block closure
}

View file

@ -1,4 +1,4 @@
class cat : int { //! ERROR can only implement interface types
class cat : int { //~ ERROR can only implement interface types
let meows: uint;
new(in_x : uint) { self.meows = in_x; }
}

View file

@ -4,8 +4,8 @@ class cat {
fn sleep() { loop{} }
fn meow() {
#error("Meow");
meows += 1u; //! ERROR unresolved name
sleep(); //! ERROR unresolved name
meows += 1u; //~ ERROR unresolved name
sleep(); //~ ERROR unresolved name
}
}

View file

@ -1,3 +1,3 @@
fn main() {
let x = do y; //! ERROR: `do` must be followed by a block call
let x = do y; //~ ERROR: `do` must be followed by a block call
}

View file

@ -1,5 +1,5 @@
fn f(f: fn@(int) -> bool) -> bool { f(10i) }
fn main() {
assert do f() { |i| i == 10i } == 10i; //! ERROR: expected `bool` but found `int`
assert do f() { |i| i == 10i } == 10i; //~ ERROR: expected `bool` but found `int`
}

View file

@ -1,3 +1,3 @@
fn main() {
let v = [,]/~; //! ERROR unexpected token: ','
let v = [,]/~; //~ ERROR unexpected token: ','
}

View file

@ -1,5 +1,5 @@
enum hello = int;
fn main() {
let hello = 0; //!ERROR declaration of `hello` shadows an enum that's in
let hello = 0; //~ERROR declaration of `hello` shadows an enum that's in
}

View file

@ -4,26 +4,26 @@ fn wants_three(x: str/3) { }
fn has_box(x: str/@) {
wants_box(x);
wants_uniq(x); //! ERROR str storage differs: expected ~ but found @
wants_three(x); //! ERROR str storage differs: expected 3 but found @
wants_uniq(x); //~ ERROR str storage differs: expected ~ but found @
wants_three(x); //~ ERROR str storage differs: expected 3 but found @
}
fn has_uniq(x: str/~) {
wants_box(x); //! ERROR str storage differs: expected @ but found ~
wants_box(x); //~ ERROR str storage differs: expected @ but found ~
wants_uniq(x);
wants_three(x); //! ERROR str storage differs: expected 3 but found ~
wants_three(x); //~ ERROR str storage differs: expected 3 but found ~
}
fn has_three(x: str/3) {
wants_box(x); //! ERROR str storage differs: expected @ but found 3
wants_uniq(x); //! ERROR str storage differs: expected ~ but found 3
wants_box(x); //~ ERROR str storage differs: expected @ but found 3
wants_uniq(x); //~ ERROR str storage differs: expected ~ but found 3
wants_three(x);
}
fn has_four(x: str/4) {
wants_box(x); //! ERROR str storage differs: expected @ but found 4
wants_uniq(x); //! ERROR str storage differs: expected ~ but found 4
wants_three(x); //! ERROR str storage differs: expected 3 but found 4
wants_box(x); //~ ERROR str storage differs: expected @ but found 4
wants_uniq(x); //~ ERROR str storage differs: expected ~ but found 4
wants_three(x); //~ ERROR str storage differs: expected 3 but found 4
}
fn main() {

View file

@ -4,26 +4,26 @@ fn wants_three(x: [uint]/3) { }
fn has_box(x: [uint]/@) {
wants_box(x);
wants_uniq(x); //! ERROR [] storage differs: expected ~ but found @
wants_three(x); //! ERROR [] storage differs: expected 3 but found @
wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found @
wants_three(x); //~ ERROR [] storage differs: expected 3 but found @
}
fn has_uniq(x: [uint]/~) {
wants_box(x); //! ERROR [] storage differs: expected @ but found ~
wants_box(x); //~ ERROR [] storage differs: expected @ but found ~
wants_uniq(x);
wants_three(x); //! ERROR [] storage differs: expected 3 but found ~
wants_three(x); //~ ERROR [] storage differs: expected 3 but found ~
}
fn has_three(x: [uint]/3) {
wants_box(x); //! ERROR [] storage differs: expected @ but found 3
wants_uniq(x); //! ERROR [] storage differs: expected ~ but found 3
wants_box(x); //~ ERROR [] storage differs: expected @ but found 3
wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found 3
wants_three(x);
}
fn has_four(x: [uint]/4) {
wants_box(x); //! ERROR [] storage differs: expected @ but found 4
wants_uniq(x); //! ERROR [] storage differs: expected ~ but found 4
wants_three(x); //! ERROR [] storage differs: expected 3 but found 4
wants_box(x); //~ ERROR [] storage differs: expected @ but found 4
wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found 4
wants_three(x); //~ ERROR [] storage differs: expected 3 but found 4
}
fn main() {

View file

@ -2,5 +2,5 @@ fn main() {
fn f() { }
fn g(i: int) { }
let x = f == g;
//!^ ERROR expected `extern fn()` but found `extern fn(int)`
//~^ ERROR expected `extern fn()` but found `extern fn(int)`
}

View file

@ -7,11 +7,11 @@ fn apply<T>(t: T, f: fn(T)) {
}
fn main() {
apply(@3, takes_mut); //! ERROR (values differ in mutability)
apply(@3, takes_mut); //~ ERROR (values differ in mutability)
apply(@3, takes_const);
apply(@3, takes_imm);
apply(@mut 3, takes_mut);
apply(@mut 3, takes_const);
apply(@mut 3, takes_imm); //! ERROR (values differ in mutability)
apply(@mut 3, takes_imm); //~ ERROR (values differ in mutability)
}

View file

@ -18,5 +18,5 @@ fn main() {
let g: @const int = r();
// Bad.
let h: @int = r(); //! ERROR (values differ in mutability)
let h: @int = r(); //~ ERROR (values differ in mutability)
}

View file

@ -20,5 +20,5 @@ fn main() {
// mutability check will fail, because the
// type of r has been inferred to be
// fn(@const int) -> @const int
*r(@mut 3) = 4; //! ERROR assigning to dereference of const @ pointer
*r(@mut 3) = 4; //~ ERROR assigning to dereference of const @ pointer
}

View file

@ -3,5 +3,5 @@
fn main() {
let x: option<uint>;
x = 5;
//!^ ERROR mismatched types: expected `core::option::option<uint>`
//~^ ERROR mismatched types: expected `core::option::option<uint>`
}

View file

@ -10,7 +10,7 @@ mod y {
fn bar(x: x::foo) -> y::foo {
ret x;
//!^ ERROR mismatched types: expected `y::foo` but found `x::foo`
//~^ ERROR mismatched types: expected `y::foo` but found `x::foo`
}
fn main() {

View file

@ -5,7 +5,7 @@ type T2 = int;
fn bar(x: T1) -> T2 {
ret x;
//!^ ERROR mismatched types: expected `T2` but found `T1`
//~^ ERROR mismatched types: expected `T2` but found `T1`
}
fn main() {

View file

@ -4,7 +4,7 @@ import core::task::task;
fn bar(x: uint) -> task {
ret x;
//!^ ERROR mismatched types: expected `core::task::task`
//~^ ERROR mismatched types: expected `core::task::task`
}
fn main() {

View file

@ -2,7 +2,7 @@ iface foo<T> { }
fn bar(x: foo<uint>) -> foo<int> {
ret (x as foo::<int>);
//!^ ERROR mismatched types: expected `foo<int>` but found `foo<uint>`
//~^ ERROR mismatched types: expected `foo<int>` but found `foo<uint>`
}
fn main() {}

View file

@ -3,7 +3,7 @@ iface foo {
}
impl of foo for int {
fn bar() -> int {
//!^ ERROR method `bar` has 0 parameters but the iface has 1
//~^ ERROR method `bar` has 0 parameters but the iface has 1
self
}
}

View file

@ -4,8 +4,8 @@ impl of bar for uint { fn dup() -> uint { self } fn blah<X>() {} }
impl of bar for uint { fn dup() -> uint { self } fn blah<X>() {} }
fn main() {
10.dup::<int>(); //! ERROR does not take type parameters
10.blah::<int, int>(); //! ERROR incorrect number of type parameters
10u.dup(); //! ERROR multiple applicable methods
(10 as bar).dup(); //! ERROR contains a self type
10.dup::<int>(); //~ ERROR does not take type parameters
10.blah::<int, int>(); //~ ERROR incorrect number of type parameters
10u.dup(); //~ ERROR multiple applicable methods
(10 as bar).dup(); //~ ERROR contains a self type
}

View file

@ -1,9 +1,9 @@
iface foo { fn foo(); }
impl of foo for uint {} //! ERROR missing method `foo`
impl of foo for uint {} //~ ERROR missing method `foo`
impl of foo for uint { fn foo() -> int {} } //! ERROR incompatible type
impl of foo for uint { fn foo() -> int {} } //~ ERROR incompatible type
impl of int for uint { fn foo() {} } //! ERROR can only implement interface
impl of int for uint { fn foo() {} } //~ ERROR can only implement interface
fn main() {}

View file

@ -3,7 +3,7 @@
fn g() { }
pure fn f(_q: int) -> bool {
g(); //! ERROR access to impure function prohibited in pure context
g(); //~ ERROR access to impure function prohibited in pure context
ret true;
}

View file

@ -1,4 +1,4 @@
fn main() {
let z = ();
log(debug, z[0]); //! ERROR cannot index a value of type `()`
log(debug, z[0]); //~ ERROR cannot index a value of type `()`
}

View file

@ -29,62 +29,62 @@ fn main() {
fn id_u64(n: u64) -> u64 { n }
id_i8(a8); // ok
id_i8(a16); //! ERROR mismatched types: expected `i8` but found `i16`
id_i8(a32); //! ERROR mismatched types: expected `i8` but found `i32`
id_i8(a64); //! ERROR mismatched types: expected `i8` but found `i64`
id_i8(a16); //~ ERROR mismatched types: expected `i8` but found `i16`
id_i8(a32); //~ ERROR mismatched types: expected `i8` but found `i32`
id_i8(a64); //~ ERROR mismatched types: expected `i8` but found `i64`
id_i16(a8); //! ERROR mismatched types: expected `i16` but found `i8`
id_i16(a8); //~ ERROR mismatched types: expected `i16` but found `i8`
id_i16(a16); // ok
id_i16(a32); //! ERROR mismatched types: expected `i16` but found `i32`
id_i16(a64); //! ERROR mismatched types: expected `i16` but found `i64`
id_i16(a32); //~ ERROR mismatched types: expected `i16` but found `i32`
id_i16(a64); //~ ERROR mismatched types: expected `i16` but found `i64`
id_i32(a8); //! ERROR mismatched types: expected `i32` but found `i8`
id_i32(a16); //! ERROR mismatched types: expected `i32` but found `i16`
id_i32(a8); //~ ERROR mismatched types: expected `i32` but found `i8`
id_i32(a16); //~ ERROR mismatched types: expected `i32` but found `i16`
id_i32(a32); // ok
id_i32(a64); //! ERROR mismatched types: expected `i32` but found `i64`
id_i32(a64); //~ ERROR mismatched types: expected `i32` but found `i64`
id_i64(a8); //! ERROR mismatched types: expected `i64` but found `i8`
id_i64(a16); //! ERROR mismatched types: expected `i64` but found `i16`
id_i64(a32); //! ERROR mismatched types: expected `i64` but found `i32`
id_i64(a8); //~ ERROR mismatched types: expected `i64` but found `i8`
id_i64(a16); //~ ERROR mismatched types: expected `i64` but found `i16`
id_i64(a32); //~ ERROR mismatched types: expected `i64` but found `i32`
id_i64(a64); // ok
id_i8(c8); // ok
id_i8(c16); //! ERROR mismatched types: expected `i8` but found `i16`
id_i8(c32); //! ERROR mismatched types: expected `i8` but found `i32`
id_i8(c64); //! ERROR mismatched types: expected `i8` but found `i64`
id_i8(c16); //~ ERROR mismatched types: expected `i8` but found `i16`
id_i8(c32); //~ ERROR mismatched types: expected `i8` but found `i32`
id_i8(c64); //~ ERROR mismatched types: expected `i8` but found `i64`
id_i16(c8); //! ERROR mismatched types: expected `i16` but found `i8`
id_i16(c8); //~ ERROR mismatched types: expected `i16` but found `i8`
id_i16(c16); // ok
id_i16(c32); //! ERROR mismatched types: expected `i16` but found `i32`
id_i16(c64); //! ERROR mismatched types: expected `i16` but found `i64`
id_i16(c32); //~ ERROR mismatched types: expected `i16` but found `i32`
id_i16(c64); //~ ERROR mismatched types: expected `i16` but found `i64`
id_i32(c8); //! ERROR mismatched types: expected `i32` but found `i8`
id_i32(c16); //! ERROR mismatched types: expected `i32` but found `i16`
id_i32(c8); //~ ERROR mismatched types: expected `i32` but found `i8`
id_i32(c16); //~ ERROR mismatched types: expected `i32` but found `i16`
id_i32(c32); // ok
id_i32(c64); //! ERROR mismatched types: expected `i32` but found `i64`
id_i32(c64); //~ ERROR mismatched types: expected `i32` but found `i64`
id_i64(a8); //! ERROR mismatched types: expected `i64` but found `i8`
id_i64(a16); //! ERROR mismatched types: expected `i64` but found `i16`
id_i64(a32); //! ERROR mismatched types: expected `i64` but found `i32`
id_i64(a8); //~ ERROR mismatched types: expected `i64` but found `i8`
id_i64(a16); //~ ERROR mismatched types: expected `i64` but found `i16`
id_i64(a32); //~ ERROR mismatched types: expected `i64` but found `i32`
id_i64(a64); // ok
id_u8(b8); // ok
id_u8(b16); //! ERROR mismatched types: expected `u8` but found `u16`
id_u8(b32); //! ERROR mismatched types: expected `u8` but found `u32`
id_u8(b64); //! ERROR mismatched types: expected `u8` but found `u64`
id_u8(b16); //~ ERROR mismatched types: expected `u8` but found `u16`
id_u8(b32); //~ ERROR mismatched types: expected `u8` but found `u32`
id_u8(b64); //~ ERROR mismatched types: expected `u8` but found `u64`
id_u16(b8); //! ERROR mismatched types: expected `u16` but found `u8`
id_u16(b8); //~ ERROR mismatched types: expected `u16` but found `u8`
id_u16(b16); // ok
id_u16(b32); //! ERROR mismatched types: expected `u16` but found `u32`
id_u16(b64); //! ERROR mismatched types: expected `u16` but found `u64`
id_u16(b32); //~ ERROR mismatched types: expected `u16` but found `u32`
id_u16(b64); //~ ERROR mismatched types: expected `u16` but found `u64`
id_u32(b8); //! ERROR mismatched types: expected `u32` but found `u8`
id_u32(b16); //! ERROR mismatched types: expected `u32` but found `u16`
id_u32(b8); //~ ERROR mismatched types: expected `u32` but found `u8`
id_u32(b16); //~ ERROR mismatched types: expected `u32` but found `u16`
id_u32(b32); // ok
id_u32(b64); //! ERROR mismatched types: expected `u32` but found `u64`
id_u32(b64); //~ ERROR mismatched types: expected `u32` but found `u64`
id_u64(b8); //! ERROR mismatched types: expected `u64` but found `u8`
id_u64(b16); //! ERROR mismatched types: expected `u64` but found `u16`
id_u64(b32); //! ERROR mismatched types: expected `u64` but found `u32`
id_u64(b8); //~ ERROR mismatched types: expected `u64` but found `u8`
id_u64(b16); //~ ERROR mismatched types: expected `u64` but found `u16`
id_u64(b32); //~ ERROR mismatched types: expected `u64` but found `u32`
id_u64(b64); // ok
}

View file

@ -1,7 +1,7 @@
// Regression test for issue #1362 - without that fix the span will be bogus
// no-reformat
fn main() {
let x: uint = 20i; //! ERROR mismatched types
let x: uint = 20i; //~ ERROR mismatched types
}
// NOTE: Do not add any extra lines as the line number the error is
// on is significant; an error later in the source file might not

View file

@ -3,5 +3,5 @@
fn main() {
#macro[[#apply[f, [x, ...]], f(x, ...)]];
fn add(a: int, b: int) -> int { ret a + b; }
assert (#apply[add, [y, 15]] == 16); //! ERROR unresolved name: y
assert (#apply[add, [y, 15]] == 16); //~ ERROR unresolved name: y
}

View file

@ -1,5 +1,5 @@
// Regresion test for issue #1448 and #1386
fn main() {
#debug["%u", 10i]; //! ERROR mismatched types
#debug["%u", 10i]; //~ ERROR mismatched types
}

View file

@ -1,7 +1,7 @@
// Testing that we don't fail abnormally after hitting the errors
import unresolved::*; //! ERROR unresolved modulename
//!^ ERROR unresolved does not name a module
import unresolved::*; //~ ERROR unresolved modulename
//~^ ERROR unresolved does not name a module
fn main() {
}

View file

@ -1,6 +1,6 @@
// Issue #1763 - infer types correctly
type actor<T> = { //! ERROR type parameter `T` is unused
type actor<T> = { //~ ERROR type parameter `T` is unused
unused: bool
};

View file

@ -3,6 +3,6 @@ type t<T> = { f: fn() -> T };
fn f<T>(_x: t<T>) {}
fn main() {
let x: t<()> = { f: { || () } }; //! ERROR expressions with stack closure
let x: t<()> = { f: { || () } }; //~ ERROR expressions with stack closure
f(x);
}

View file

@ -1,7 +1,7 @@
// compile-flags: -W err-while-true
fn main() {
let mut i = 0;
while true { //! ERROR denote infinite loops with loop
while true { //~ ERROR denote infinite loops with loop
i += 1;
if i == 5 { break; }
}

View file

@ -1,12 +1,12 @@
// test that autoderef of a type like this does not
// cause compiler to loop. Note that no instances
// of such a type could ever be constructed.
class t { //! ERROR this type cannot be instantiated
class t { //~ ERROR this type cannot be instantiated
let x: x;
let to_str: ();
new(x: x) { self.x = x; self.to_str = (); }
}
enum x = @t; //! ERROR this type cannot be instantiated
enum x = @t; //~ ERROR this type cannot be instantiated
fn main() {
}

View file

@ -1,7 +1,7 @@
// test that autoderef of a type like this does not
// cause compiler to loop. Note that no instances
// of such a type could ever be constructed.
enum t = @t; //! ERROR this type cannot be instantiated
enum t = @t; //~ ERROR this type cannot be instantiated
// I use an impl here because it will cause
// the compiler to attempt autoderef and then

View file

@ -1,5 +1,5 @@
fn foo(a: option<uint>, b: option<uint>) {
alt (a,b) { //! ERROR: non-exhaustive patterns: none not covered
alt (a,b) { //~ ERROR: non-exhaustive patterns: none not covered
(some(a), some(b)) if a == b { }
(some(_), none) |
(none, some(_)) { }

View file

@ -2,8 +2,8 @@ impl monad<A> for [A]/~ {
fn bind<B>(f: fn(A) -> [B]/~) {
let mut r = fail;
for self.each {|elt| r += f(elt); }
//!^ WARNING unreachable expression
//!^^ ERROR the type of this value must be known
//~^ WARNING unreachable expression
//~^^ ERROR the type of this value must be known
}
}
fn main() {

View file

@ -1,8 +1,8 @@
fn fail_len(v: [const int]/~) -> uint {
let mut i = fail;
for v.each {|x| i += 1u; }
//!^ WARNING unreachable statement
//!^^ ERROR the type of this value must be known
//~^ WARNING unreachable statement
//~^^ ERROR the type of this value must be known
ret i;
}
fn main() {}

View file

@ -1,6 +1,6 @@
fn main() {
vec::iter(fail) {|i|
log (debug, i * 2);
//!^ ERROR the type of this value must be known
//~^ ERROR the type of this value must be known
};
}

View file

@ -5,7 +5,7 @@ iface channel<T> {
}
// `chan` is not an iface, it's an enum
impl of chan for int { //! ERROR can only implement interface types
impl of chan for int { //~ ERROR can only implement interface types
fn send(v: int) { fail }
}

View file

@ -4,7 +4,7 @@
near the corresponding open brace. But currently it's reported at the end.
xfailed for now (see Issue #2354)
*/
fn foo() { //! ERROR this open brace is not closed
fn foo() { //~ ERROR this open brace is not closed
alt some(x) {
some(y) { fail; }
none { fail; }

View file

@ -1,5 +1,5 @@
enum test { thing = 3u } //! ERROR mismatched types
//!^ ERROR expected signed integer constant
enum test { thing = 3u } //~ ERROR mismatched types
//~^ ERROR expected signed integer constant
fn main() {
log(error, thing as int);
assert(thing as int == 3);

View file

@ -7,7 +7,7 @@ class socket {
fn set_identity() {
closure { ||
setsockopt_bytes(self.sock) //! ERROR copying a noncopyable value
setsockopt_bytes(self.sock) //~ ERROR copying a noncopyable value
}
}
}

View file

@ -1,4 +1,4 @@
class c { //! ERROR a class must have at least one field
class c { //~ ERROR a class must have at least one field
new() { }
}

View file

@ -6,7 +6,7 @@ type parser = {
impl parser for parser {
fn parse() -> [mut int] {
dvec::unwrap(self.tokens) //! ERROR illegal move from self
dvec::unwrap(self.tokens) //~ ERROR illegal move from self
}
}

View file

@ -6,7 +6,7 @@ class send_packet<T: copy> {
mod pingpong {
type ping = send_packet<pong>;
enum pong = send_packet<ping>; //! ERROR illegal recursive enum type; wrap the inner value in a box to make it representable
enum pong = send_packet<ping>; //~ ERROR illegal recursive enum type; wrap the inner value in a box to make it representable
}
fn main() {}

Some files were not shown because too many files have changed in this diff Show more