Skip to content

Commit a7641e9

Browse files
committed
remove leading ::, new tests
1 parent bcbe36b commit a7641e9

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

src/comp/middle/ast_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn path_to_str_with_sep(p: path, sep: str) -> str {
1717
}
1818

1919
fn path_to_str(p: path) -> str {
20-
"::" + path_to_str_with_sep(p, "::")
20+
path_to_str_with_sep(p, "::")
2121
}
2222

2323
enum ast_node {

src/test/compile-fail/fully-qualified-type-name1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
fn main() {
44
let x: option<uint>;
55
x = 5;
6-
//!^ ERROR mismatched types: expected `::core::option::t<uint>`
6+
//!^ ERROR mismatched types: expected `core::option::t<uint>`
77
}

src/test/compile-fail/fully-qualified-type-name2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mod y {
1010

1111
fn bar(x: x::foo) -> y::foo {
1212
ret x;
13-
//!^ ERROR mismatched types: expected `::y::foo` but found `::x::foo`
13+
//!^ ERROR mismatched types: expected `y::foo` but found `x::foo`
1414
}
1515

1616
fn main() {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Test that we use fully-qualified type names in error messages.
2+
3+
type T1 = uint;
4+
type T2 = int;
5+
6+
fn bar(x: T1) -> T2 {
7+
ret x;
8+
//!^ ERROR mismatched types: expected `T2` but found `T1`
9+
}
10+
11+
fn main() {
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Test that we use fully-qualified type names in error messages.
2+
3+
import core::task::task;
4+
5+
fn bar(x: uint) -> task {
6+
ret x;
7+
//!^ ERROR mismatched types: expected `core::task::task`
8+
}
9+
10+
fn main() {
11+
}

0 commit comments

Comments
 (0)