remove leading ::, new tests
This commit is contained in:
parent
bcbe36b33b
commit
a7641e99e8
@ -17,7 +17,7 @@ fn path_to_str_with_sep(p: path, sep: str) -> str {
|
||||
}
|
||||
|
||||
fn path_to_str(p: path) -> str {
|
||||
"::" + path_to_str_with_sep(p, "::")
|
||||
path_to_str_with_sep(p, "::")
|
||||
}
|
||||
|
||||
enum ast_node {
|
||||
|
@ -3,5 +3,5 @@
|
||||
fn main() {
|
||||
let x: option<uint>;
|
||||
x = 5;
|
||||
//!^ ERROR mismatched types: expected `::core::option::t<uint>`
|
||||
//!^ ERROR mismatched types: expected `core::option::t<uint>`
|
||||
}
|
||||
|
@ -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() {
|
||||
|
12
src/test/compile-fail/fully-qualified-type-name3.rs
Normal file
12
src/test/compile-fail/fully-qualified-type-name3.rs
Normal file
@ -0,0 +1,12 @@
|
||||
// Test that we use fully-qualified type names in error messages.
|
||||
|
||||
type T1 = uint;
|
||||
type T2 = int;
|
||||
|
||||
fn bar(x: T1) -> T2 {
|
||||
ret x;
|
||||
//!^ ERROR mismatched types: expected `T2` but found `T1`
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
11
src/test/compile-fail/fully-qualified-type-name4.rs
Normal file
11
src/test/compile-fail/fully-qualified-type-name4.rs
Normal file
@ -0,0 +1,11 @@
|
||||
// Test that we use fully-qualified type names in error messages.
|
||||
|
||||
import core::task::task;
|
||||
|
||||
fn bar(x: uint) -> task {
|
||||
ret x;
|
||||
//!^ ERROR mismatched types: expected `core::task::task`
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
Loading…
Reference in New Issue
Block a user