Skip to content

Commit 6d86969

Browse files
committed
change the test suite //! kind syntax to //~ kind in order to avoid a
conflict with the new single-line-sugared-inner-doc-comment (`//! ...`).
1 parent 0b653ab commit 6d86969

File tree

253 files changed

+596
-596
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+596
-596
lines changed

src/compiletest/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ fn load_errors(testfile: str) -> [expected_error]/~ {
2121
}
2222

2323
fn parse_expected(line_num: uint, line: str) -> [expected_error]/~ unsafe {
24-
let error_tag = "//!";
24+
let error_tag = "//~";
2525
let mut idx;
2626
alt str::find_str(line, error_tag) {
2727
option::none { ret []/~; }
2828
option::some(nn) { idx = (nn as uint) + str::len(error_tag); }
2929
}
3030

31-
// "//!^^^ kind msg" denotes a message expected
31+
// "//~^^^ kind msg" denotes a message expected
3232
// three lines above current line:
3333
let mut adjust_line = 0u;
3434
let len = str::len(line);

src/test/compile-fail/alt-join.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ fn my_fail() -> ! { fail; }
66
fn main() {
77
alt true { false { my_fail(); } true { } }
88

9-
log(debug, x); //! ERROR unresolved name: x
9+
log(debug, x); //~ ERROR unresolved name: x
1010
let x: int;
1111
}

src/test/compile-fail/alt-pattern-field-mismatch-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn main() {
1010
rgb(_, _, _) { }
1111
cmyk(_, _, _, _) { }
1212
no_color(_) { }
13-
//!^ ERROR this pattern has 1 field, but the corresponding variant has no fields
13+
//~^ ERROR this pattern has 1 field, but the corresponding variant has no fields
1414
}
1515
}
1616
}

src/test/compile-fail/alt-pattern-field-mismatch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() {
88
fn foo(c: color) {
99
alt c {
1010
rgb(_, _) { }
11-
//!^ ERROR this pattern has 2 fields, but the corresponding variant has 3 fields
11+
//~^ ERROR this pattern has 2 fields, but the corresponding variant has 3 fields
1212
cmyk(_, _, _, _) { }
1313
no_color { }
1414
}

src/test/compile-fail/ambig_impl_1.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
impl methods1 for uint { fn me() -> uint { self } } //! NOTE candidate #1 is `methods1::me`
2-
impl methods2 for uint { fn me() -> uint { self } } //! NOTE candidate #2 is `methods2::me`
3-
fn main() { 1u.me(); } //! ERROR multiple applicable methods in scope
1+
impl methods1 for uint { fn me() -> uint { self } } //~ NOTE candidate #1 is `methods1::me`
2+
impl methods2 for uint { fn me() -> uint { self } } //~ NOTE candidate #2 is `methods2::me`
3+
fn main() { 1u.me(); } //~ ERROR multiple applicable methods in scope

src/test/compile-fail/ambig_impl_2_exe.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
// aux-build:ambig_impl_2_lib.rs
33
use ambig_impl_2_lib;
44
import ambig_impl_2_lib::methods1;
5-
impl methods2 for uint { fn me() -> uint { self } } //! NOTE candidate #2 is `methods2::me`
6-
fn main() { 1u.me(); } //! ERROR multiple applicable methods in scope
7-
//!^ NOTE candidate #1 is `ambig_impl_2_lib::methods1::me`
5+
impl methods2 for uint { fn me() -> uint { self } } //~ NOTE candidate #2 is `methods2::me`
6+
fn main() { 1u.me(); } //~ ERROR multiple applicable methods in scope
7+
//~^ NOTE candidate #1 is `ambig_impl_2_lib::methods1::me`

src/test/compile-fail/ambig_impl_bounds.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ iface A { fn foo(); }
22
iface B { fn foo(); }
33

44
fn foo<T: A B>(t: T) {
5-
t.foo(); //! ERROR multiple applicable methods in scope
6-
//!^ NOTE candidate #1 derives from the bound `A`
7-
//!^^ NOTE candidate #2 derives from the bound `B`
5+
t.foo(); //~ ERROR multiple applicable methods in scope
6+
//~^ NOTE candidate #1 derives from the bound `A`
7+
//~^^ NOTE candidate #2 derives from the bound `B`
88
}
99

1010
fn main() {}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
impl methods for [uint]/~ {
2-
fn foo() -> int {1} //! NOTE candidate #1 is `methods::foo`
2+
fn foo() -> int {1} //~ NOTE candidate #1 is `methods::foo`
33
}
44

55
impl methods for [int]/~ {
6-
fn foo() -> int {2} //! NOTE candidate #2 is `methods::foo`
6+
fn foo() -> int {2} //~ NOTE candidate #2 is `methods::foo`
77
}
88

99
fn main() {
1010
let x = []/~;
11-
x.foo(); //! ERROR multiple applicable methods in scope
11+
x.foo(); //~ ERROR multiple applicable methods in scope
1212
}

src/test/compile-fail/assign-imm-local-twice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
fn test() {
22
let v: int;
3-
v = 1; //! NOTE prior assignment occurs here
3+
v = 1; //~ NOTE prior assignment occurs here
44
#debug["v=%d", v];
5-
v = 2; //! ERROR re-assignment of immutable variable
5+
v = 2; //~ ERROR re-assignment of immutable variable
66
#debug["v=%d", v];
77
}
88

src/test/compile-fail/assign-super.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn main() {
22
let mut x: [mut int]/~ = [mut 3]/~;
33
let y: [int]/~ = [3]/~;
4-
x = y; //! ERROR values differ in mutability
4+
x = y; //~ ERROR values differ in mutability
55
}

src/test/compile-fail/assign-to-method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ class cat {
1111

1212
fn main() {
1313
let nyan : cat = cat(52u, 99);
14-
nyan.speak = fn@() { #debug["meow"]; }; //! ERROR assigning to method
14+
nyan.speak = fn@() { #debug["meow"]; }; //~ ERROR assigning to method
1515
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Check that bogus field access is non-fatal
22
fn main() {
33
let x = 0;
4-
log(debug, x.foo); //! ERROR attempted access of field
5-
log(debug, x.bar); //! ERROR attempted access of field
4+
log(debug, x.foo); //~ ERROR attempted access of field
5+
log(debug, x.bar); //~ ERROR attempted access of field
66
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn main() {
22
#[attr]
3-
#debug("hi"); //! ERROR expected item
3+
#debug("hi"); //~ ERROR expected item
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn main() {
22
#[attr]
3-
let _i = 0; //! ERROR expected item
3+
let _i = 0; //~ ERROR expected item
44
}

src/test/compile-fail/bad-bang-ann-3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
fn bad_bang(i: uint) -> ! {
55
ret 7u;
6-
//!^ ERROR expected `_|_` but found `uint`
6+
//~^ ERROR expected `_|_` but found `uint`
77
}
88

99
fn main() { bad_bang(5u); }

src/test/compile-fail/bad-bang-ann.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
fn bad_bang(i: uint) -> ! {
55
if i < 0u { } else { fail; }
6-
//!^ ERROR expected `_|_` but found `()`
6+
//~^ ERROR expected `_|_` but found `()`
77
}
88

99
fn main() { bad_bang(5u); }

src/test/compile-fail/bad-for-loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn main() {
22
fn baz(_x: fn() -> int) {}
3-
for baz {|_e| } //! ERROR should return `bool`
3+
for baz {|_e| } //~ ERROR should return `bool`
44
}

src/test/compile-fail/bad-method-typaram-kind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn foo<T>() {
2-
1u.bar::<T>(); //! ERROR: missing `copy`
2+
1u.bar::<T>(); //~ ERROR: missing `copy`
33
}
44

55
impl methods for uint {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
fn false() { } //! ERROR found `false` in restricted position
1+
fn false() { } //~ ERROR found `false` in restricted position
22
fn main() { }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
fn true() { } //! ERROR found `true` in restricted position
1+
fn true() { } //~ ERROR found `true` in restricted position
22
fn main() { }

src/test/compile-fail/bad-var-env-capture-in-block-arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ fn main() {
22
let x = 3;
33
fn blah(_a: native fn()) {}
44
blah({||
5-
log(debug, x); //! ERROR attempted dynamic environment capture
5+
log(debug, x); //~ ERROR attempted dynamic environment capture
66
});
77
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn f() -> ! {
2-
3i //! ERROR expected `_|_` but found `int`
2+
3i //~ ERROR expected `_|_` but found `int`
33
}
44
fn main() { }

src/test/compile-fail/binop-typeck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ fn main() {
44
let x = true;
55
let y = 1;
66
let z = x + y;
7-
//!^ ERROR binary operation + cannot be applied to type `bool`
7+
//~^ ERROR binary operation + cannot be applied to type `bool`
88
}

src/test/compile-fail/block-arg-as-stmt-with-value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ fn compute1() -> float {
33
let v = [0f, 1f, 2f, 3f]/~;
44

55
vec::foldl(0f, v) { |x, y| x + y } - 10f
6-
//!^ ERROR mismatched types: expected `()`
6+
//~^ ERROR mismatched types: expected `()`
77
}
88

99
fn main() {

src/test/compile-fail/block-coerce-no-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ fn main() {
99
}
1010

1111
f(g);
12-
//!^ ERROR mismatched types: expected `extern fn(extern fn(extern fn()))`
12+
//~^ ERROR mismatched types: expected `extern fn(extern fn(extern fn()))`
1313
}

src/test/compile-fail/block-coerce-no.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn coerce(b: fn()) -> native fn() {
66
g: fn()) -> native fn() { ret f(g); }
77
fn fn_id(f: native fn()) -> native fn() { ret f }
88
ret lol(fn_id, b);
9-
//!^ ERROR mismatched types: expected `extern fn(fn()) -> extern fn()`
9+
//~^ ERROR mismatched types: expected `extern fn(fn()) -> extern fn()`
1010
}
1111

1212
fn main() {

src/test/compile-fail/borrowck-assign-comp-idx.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ fn a() {
44
let mut p = [mut 1]/~;
55

66
// Create an immutable pointer into p's contents:
7-
let _q: &int = &p[0]; //! NOTE loan of mutable vec content granted here
7+
let _q: &int = &p[0]; //~ NOTE loan of mutable vec content granted here
88

9-
p[0] = 5; //! ERROR assigning to mutable vec content prohibited due to outstanding loan
9+
p[0] = 5; //~ ERROR assigning to mutable vec content prohibited due to outstanding loan
1010
}
1111

1212
fn borrow(_x: [int]/&, _f: fn()) {}
@@ -17,8 +17,8 @@ fn b() {
1717

1818
let mut p = [mut 1]/~;
1919

20-
borrow(p) {|| //! NOTE loan of mutable vec content granted here
21-
p[0] = 5; //! ERROR assigning to mutable vec content prohibited due to outstanding loan
20+
borrow(p) {|| //~ NOTE loan of mutable vec content granted here
21+
p[0] = 5; //~ ERROR assigning to mutable vec content prohibited due to outstanding loan
2222
}
2323
}
2424

src/test/compile-fail/borrowck-assign-comp.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ type point = { x: int, y: int };
22

33
fn a() {
44
let mut p = {x: 3, y: 4};
5-
let _q = &p; //! NOTE loan of mutable local variable granted here
5+
let _q = &p; //~ NOTE loan of mutable local variable granted here
66

77
// This assignment is illegal because the field x is not
88
// inherently mutable; since `p` was made immutable, `p.x` is now
99
// immutable. Otherwise the type of &_q.x (&int) would be wrong.
10-
p.x = 5; //! ERROR assigning to mutable field prohibited due to outstanding loan
10+
p.x = 5; //~ ERROR assigning to mutable field prohibited due to outstanding loan
1111
}
1212

1313
fn b() {
@@ -24,8 +24,8 @@ fn c() {
2424
// and then try to overwrite `p` as a whole.
2525

2626
let mut p = {x: 3, mut y: 4};
27-
let _q = &p.y; //! NOTE loan of mutable local variable granted here
28-
p = {x: 5, mut y: 7};//! ERROR assigning to mutable local variable prohibited due to outstanding loan
27+
let _q = &p.y; //~ NOTE loan of mutable local variable granted here
28+
p = {x: 5, mut y: 7};//~ ERROR assigning to mutable local variable prohibited due to outstanding loan
2929
copy p;
3030
}
3131

@@ -34,8 +34,8 @@ fn d() {
3434
// address of a subcomponent and then modify that subcomponent:
3535

3636
let mut p = {x: 3, mut y: 4};
37-
let _q = &p.y; //! NOTE loan of mutable field granted here
38-
p.y = 5; //! ERROR assigning to mutable field prohibited due to outstanding loan
37+
let _q = &p.y; //~ NOTE loan of mutable field granted here
38+
p.y = 5; //~ ERROR assigning to mutable field prohibited due to outstanding loan
3939
copy p;
4040
}
4141

src/test/compile-fail/borrowck-assign-to-constants.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ const foo: int = 5;
22

33
fn main() {
44
// assigning to various global constants
5-
none = some(3); //! ERROR assigning to static item
6-
foo = 6; //! ERROR assigning to static item
5+
none = some(3); //~ ERROR assigning to static item
6+
foo = 6; //~ ERROR assigning to static item
77
}

src/test/compile-fail/borrowck-assign-to-enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ enum foo = int;
22

33
fn main() {
44
let x = foo(3);
5-
*x = 4; //! ERROR assigning to enum content
5+
*x = 4; //~ ERROR assigning to enum content
66
}

src/test/compile-fail/borrowck-assign-to-subfield.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414

1515
// in these cases we pass through a box, so the mut
1616
// of the box is dominant
17-
p.x.a = 2; //! ERROR assigning to immutable field
18-
p.y.a = 2; //! ERROR assigning to const field
17+
p.x.a = 2; //~ ERROR assigning to immutable field
18+
p.y.a = 2; //~ ERROR assigning to const field
1919
p.z.a = 2;
2020
}

src/test/compile-fail/borrowck-binding-mutbl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ fn main() {
66

77
alt x {
88
{f: v} => {
9-
impure(v); //! ERROR illegal borrow unless pure: unique value in aliasable, mutable location
10-
//!^ NOTE impure due to access to impure function
9+
impure(v); //~ ERROR illegal borrow unless pure: unique value in aliasable, mutable location
10+
//~^ NOTE impure due to access to impure function
1111
}
1212
}
1313
}

src/test/compile-fail/borrowck-issue-2657-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
fn main() {
22
let x = some(~1);
3-
alt x { //! NOTE loan of immutable local variable granted here
3+
alt x { //~ NOTE loan of immutable local variable granted here
44
some(y) {
5-
let _a <- x; //! ERROR moving out of immutable local variable prohibited due to outstanding loan
5+
let _a <- x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
66
}
77
_ {}
88
}

src/test/compile-fail/borrowck-issue-2657-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ fn main() {
22
let x = some(~1);
33
alt x {
44
some(y) {
5-
let _b <- y; //! ERROR moving out of pattern binding
5+
let _b <- y; //~ ERROR moving out of pattern binding
66
}
77
_ {}
88
}

src/test/compile-fail/borrowck-lend-args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ fn borrow_from_arg_imm_ref(&&v: ~int) {
55
}
66

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

1212
fn borrow_from_arg_move(-v: ~int) {

0 commit comments

Comments
 (0)