rustc: reduce redundant resolve errors.

This commit is contained in:
Kevin Butler 2014-06-05 22:37:52 +01:00
parent 207bfee214
commit 3791a85087
18 changed files with 181 additions and 188 deletions

View file

@ -19,7 +19,6 @@ extern crate macro_crate_test;
fn main() {
macro_crate_test::foo();
//~^ ERROR unresolved name
//~^^ ERROR use of undeclared module `macro_crate_test`
//~^^^ ERROR unresolved name `macro_crate_test::foo`.
//~^ ERROR failed to resolve. Use of undeclared module `macro_crate_test`
//~^^ ERROR unresolved name `macro_crate_test::foo`.
}

View file

@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:failed to resolve import
use spam::{ham, eggs};
//~^ ERROR unresolved import `spam::eggs`. There is no `eggs` in `spam`
mod spam {
pub fn ham() { }

View file

@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern:failed to resolve import
use zed::bar;
use zed::baz;
//~^ ERROR unresolved import `zed::baz`. There is no `baz` in `zed`
mod zed {

View file

@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use baz::zed::bar; //~ ERROR unresolved import
//~^ ERROR failed to resolve import
use baz::zed::bar;
//~^ ERROR unresolved import `baz::zed::bar`. Could not find `zed` in `baz`.
mod baz {}

View file

@ -16,8 +16,7 @@ use foo::bar;
mod test {
use bar::foo;
//~^ ERROR: unresolved import
//~^^ ERROR: failed to resolve import
//~^ ERROR unresolved import `bar::foo`. Maybe a missing `extern crate bar`?
}
fn main() {}

View file

@ -10,8 +10,7 @@
use a::f;
use b::f;
//~^ ERROR: unresolved import
//~^^ ERROR: failed to resolve import
//~^ ERROR: unresolved import `b::f`. There is no `f` in `b`
mod a { pub fn f() {} }
mod b { }

View file

@ -12,8 +12,6 @@
#![feature(globs)]
use unresolved::*; //~ ERROR unresolved import. Maybe a missing
//~^ ERROR failed to resolve import
use unresolved::*; //~ ERROR unresolved import `unresolved::*`. Maybe a missing `extern crate unres
fn main() {
}
fn main() {}

View file

@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
@ -8,11 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use x = m::f; //~ ERROR failed to resolve import
//~^ unresolved import: there is no `f` in `m`
use x = m::f; //~ ERROR unresolved import `m::f`. There is no `f` in `m`
mod m {
}
mod m {}
fn main() {
}
fn main() {}

View file

@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
@ -8,11 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use x = m::f; //~ ERROR failed to resolve import
//~^ ERROR unresolved import: there is no `f` in `m`
use x = m::f; //~ ERROR unresolved import `m::f`. There is no `f` in `m`
mod m {
}
mod m {}
fn main() {
}
fn main() {}

View file

@ -25,9 +25,8 @@ test!(b,
#[qux]
fn main() {
a::bar();
//~^ ERROR use of undeclared module `a`
//~^^ ERROR unresolved name
//~^^^ ERROR unresolved name `a::bar`
//~^ ERROR failed to resolve. Use of undeclared module `a`
//~^^ ERROR unresolved name `a::bar`
b::bar();
}

View file

@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
@ -24,14 +24,13 @@ mod bar {
pub fn foo() {}
fn test1() {
use bar::foo; //~ ERROR: unresolved import
//~^ ERROR: failed to resolve
use bar::foo;
//~^ ERROR unresolved import `bar::foo`. There is no `foo` in `bar`
}
fn test2() {
use bar::glob::foo;
//~^ ERROR: there is no
//~^^ ERROR: failed to resolve
//~^ ERROR unresolved import `bar::glob::foo`. There is no `foo` in `bar::glob`
}
#[start] fn main(_: int, _: **u8) -> int { 3 }

View file

@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
@ -25,8 +25,8 @@ mod bar {
pub fn foo() {}
fn test1() {
use bar::gpriv; //~ ERROR: unresolved import
//~^ ERROR: failed to resolve
use bar::gpriv;
//~^ ERROR unresolved import `bar::gpriv`. There is no `gpriv` in `bar`
gpriv();
}

View file

@ -11,21 +11,16 @@
mod a {
extern crate collections;
use collections::HashMap;
//~^ ERROR unresolved import. Did you mean `self::collections`?
//~^^ ERROR failed to resolve import `collections::HashMap`
//~^ ERROR unresolved import `collections::HashMap`. Did you mean `self::collections`?
mod b {
use collections::HashMap;
//~^ ERROR unresolved import. Did you mean `a::collections`?
//~^^ ERROR failed to resolve import `collections::HashMap`
//~^ ERROR unresolved import `collections::HashMap`. Did you mean `a::collections`?
mod c {
use collections::HashMap;
//~^ ERROR unresolved import. Did you mean `a::collections`?
//~^^ ERROR failed to resolve import `collections::HashMap`
//~^ ERROR unresolved import `collections::HashMap`. Did you mean `a::collections`?
mod d {
use collections::HashMap;
//~^ ERROR unresolved import. Did you mean `a::collections`
//~^^ ERROR failed to resolve import `collections::HashMap`
//~^ ERROR unresolved import `collections::HashMap`. Did you mean `a::collections`?
}
}
}

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use super::f; //~ ERROR failed to resolve import
use super::f; //~ ERROR unresolved import `super::f`
fn main() {
}

View file

@ -8,10 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use foo::bar; //~ ERROR unresolved import. Maybe a missing `extern crate foo`?
//~^ ERROR failed to resolve import `foo::bar`
use x = bar::baz; //~ ERROR unresolved import: there is no `baz` in `bar`
//~^ ERROR failed to resolve import `bar::baz`
use foo::bar; //~ ERROR unresolved import `foo::bar`. Maybe a missing `extern crate foo`?
use x = bar::baz; //~ ERROR unresolved import `bar::baz`. There is no `baz` in `bar`
mod bar {
struct bar;

View file

@ -12,10 +12,10 @@
extern crate use_from_trait_xc;
use use_from_trait_xc::Trait::foo; //~ ERROR cannot import from a trait or type implementation
//~^ ERROR failed to resolve import
use use_from_trait_xc::Foo::new; //~ ERROR cannot import from a trait or type implementation
//~^ ERROR failed to resolve import
use use_from_trait_xc::Trait::foo;
//~^ ERROR unresolved import `use_from_trait_xc::Trait::foo`. Cannot import from a trait or type imp
fn main() {
}
use use_from_trait_xc::Foo::new;
//~^ ERROR unresolved import `use_from_trait_xc::Foo::new`. Cannot import from a trait or type imple
fn main() {}

View file

@ -8,10 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use Trait::foo; //~ ERROR cannot import from a trait or type implementation
//~^ ERROR failed to resolve import
use Foo::new; //~ ERROR cannot import from a trait or type implementation
//~^ ERROR failed to resolve import
use Trait::foo;
//~^ ERROR unresolved import `Trait::foo`. Cannot import from a trait or type implementation
use Foo::new;
//~^ ERROR unresolved import `Foo::new`. Cannot import from a trait or type implementation
pub trait Trait {
fn foo();