1
Fork 0

fix various error messages

This commit is contained in:
Niko Matsakis 2016-04-12 12:19:13 -04:00
parent 47d3b801ef
commit 2c9dfafa57
7 changed files with 6 additions and 7 deletions

View file

@ -29,7 +29,6 @@ fn main() {
let mut map = HashMap::new(); let mut map = HashMap::new();
//~^ ERROR E0433 //~^ ERROR E0433
//~| ERROR E0425
for line in input.lines() { for line in input.lines() {
let line = line.unwrap(); let line = line.unwrap();

View file

@ -35,7 +35,7 @@ impl Node for Stuff {
fn iterate<N: Node, G: Graph<N>>(graph: &G) { fn iterate<N: Node, G: Graph<N>>(graph: &G) {
for node in graph.iter() { //~ ERROR no method named `iter` found for node in graph.iter() { //~ ERROR no method named `iter` found
node.zomg(); //~ error: the type of this value must be known in this context node.zomg();
} }
} }

View file

@ -12,7 +12,7 @@ struct Homura;
fn akemi(homura: Homura) { fn akemi(homura: Homura) {
let Some(ref madoka) = Some(homura.kaname()); //~ ERROR no method named `kaname` found let Some(ref madoka) = Some(homura.kaname()); //~ ERROR no method named `kaname` found
madoka.clone(); //~ ERROR the type of this value must be known madoka.clone();
} }
fn main() { } fn main() { }

View file

@ -11,6 +11,5 @@
fn main() { fn main() {
for (ref i,) in [].iter() { //~ ERROR mismatched types for (ref i,) in [].iter() { //~ ERROR mismatched types
i.clone(); i.clone();
//~^ ERROR: the type of this value must be known in this context
} }
} }

View file

@ -30,7 +30,7 @@ macro_rules! write {
} }
macro_rules! cast { macro_rules! cast {
($x:expr) => ($x as ()) ($x:expr) => ($x as ()) //~ ERROR non-scalar cast
} }
fn main() { fn main() {
@ -39,4 +39,5 @@ fn main() {
//~^ NOTE in this expansion of write! //~^ NOTE in this expansion of write!
cast!(2); cast!(2);
//~^ NOTE in this expansion of cast!
} }

View file

@ -31,5 +31,5 @@ impl ToString_ for Point {
fn main() { fn main() {
let p = Point::new(0.0, 0.0); let p = Point::new(0.0, 0.0);
//~^ ERROR no associated item named `new` found for type `Point` in the current scope //~^ ERROR no associated item named `new` found for type `Point` in the current scope
println!("{}", p.to_string()); //~ ERROR type of this value must be known println!("{}", p.to_string());
} }

View file

@ -19,7 +19,7 @@ fn foo(x: Whatever) {
//~| found `std::option::Option<_>` //~| found `std::option::Option<_>`
//~| expected enum `Whatever` //~| expected enum `Whatever`
//~| found enum `std::option::Option` //~| found enum `std::option::Option`
field.access(), //~ ERROR the type of this value must be known in this context field.access(),
} }
} }