mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Bless other tests
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
error[E0432]: unresolved import `ops`
|
||||
--> $DIR/cycle-import-in-std-1.rs:5:11
|
||||
--> $DIR/cycle-import-in-std-1.rs:5:5
|
||||
|
|
||||
LL | use ops::{self as std};
|
||||
| ^^^^^^^^^^^ no external crate `ops`
|
||||
| ^^^
|
||||
|
|
||||
= help: consider importing this module instead:
|
||||
std::ops
|
||||
help: a similar path exists
|
||||
|
|
||||
LL | use core::ops::{self as std};
|
||||
| ++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
error[E0432]: unresolved import `ops`
|
||||
--> $DIR/cycle-import-in-std-2.rs:5:11
|
||||
--> $DIR/cycle-import-in-std-2.rs:5:5
|
||||
|
|
||||
LL | use ops::{self as std};
|
||||
| ^^^^^^^^^^^ no external crate `ops`
|
||||
| ^^^
|
||||
|
|
||||
= help: consider importing this module instead:
|
||||
std::ops
|
||||
help: a similar path exists
|
||||
|
|
||||
LL | use core::ops::{self as std};
|
||||
| ++++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
||||
@@ -2,7 +2,12 @@ error[E0432]: unresolved import `foo`
|
||||
--> $DIR/issue-28388-1.rs:4:5
|
||||
|
|
||||
LL | use foo::{};
|
||||
| ^^^ no `foo` in the root
|
||||
| ^^^ use of unresolved module or unlinked crate `foo`
|
||||
|
|
||||
help: you might be missing a crate named `foo`, add it to your project and import it in your code
|
||||
|
|
||||
LL + extern crate foo;
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
error[E0432]: unresolved import `foo::f`
|
||||
--> $DIR/issue-38293.rs:7:14
|
||||
--> $DIR/issue-38293.rs:7:10
|
||||
|
|
||||
LL | use foo::f::{self};
|
||||
| ^^^^ no `f` in `foo`
|
||||
| ^ expected type, found function `f` in `foo`
|
||||
|
||||
error[E0423]: expected function, found module `baz`
|
||||
--> $DIR/issue-38293.rs:16:5
|
||||
|
||||
@@ -47,9 +47,8 @@ LL | use foo::self;
|
||||
= note: `foo` must be defined only once in the type namespace of this module
|
||||
help: you can use `as` to change the binding name of the import
|
||||
|
|
||||
LL - use foo::self;
|
||||
LL + use foo as other_foo;
|
||||
|
|
||||
LL | use foo::self as other_foo;
|
||||
| ++++++++++++
|
||||
|
||||
error[E0252]: the name `A` is defined multiple times
|
||||
--> $DIR/import-self.rs:16:11
|
||||
|
||||
@@ -8,7 +8,7 @@ mod m2 {
|
||||
}
|
||||
|
||||
mod m3 {
|
||||
pub use ::E::V::{self}; //~ ERROR `V` is only public within the crate, and cannot be re-exported outside
|
||||
pub use ::E::V::{self}; //~ ERROR unresolved import `E::V`
|
||||
}
|
||||
|
||||
#[deny(unused_imports)]
|
||||
|
||||
@@ -22,13 +22,11 @@ note: consider marking `V` as `pub` in the imported module
|
||||
LL | pub use ::E::{V};
|
||||
| ^
|
||||
|
||||
error[E0365]: `V` is only public within the crate, and cannot be re-exported outside
|
||||
--> $DIR/private-variant-reexport.rs:11:22
|
||||
error[E0432]: unresolved import `E::V`
|
||||
--> $DIR/private-variant-reexport.rs:11:18
|
||||
|
|
||||
LL | pub use ::E::V::{self};
|
||||
| ^^^^ re-export of crate public `V`
|
||||
|
|
||||
= note: consider declaring type or module `V` with `pub`
|
||||
| ^ `V` is a variant, not a module
|
||||
|
||||
error: glob import doesn't reexport anything with visibility `pub` because no imported item is public enough
|
||||
--> $DIR/private-variant-reexport.rs:16:13
|
||||
@@ -56,5 +54,5 @@ LL | pub use ::E::*;
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0364, E0365.
|
||||
Some errors have detailed explanations: E0364, E0432.
|
||||
For more information about an error, try `rustc --explain E0364`.
|
||||
|
||||
@@ -8,7 +8,7 @@ trait Tr {}
|
||||
use ::{}; // OK
|
||||
use m::{}; // OK
|
||||
use E::{}; // OK
|
||||
use S::{}; // FIXME, this and `use S::{self};` should be an error
|
||||
use S::{}; //~ ERROR unresolved import `S`
|
||||
use Tr::{}; // FIXME, this and `use Tr::{self};` should be an error
|
||||
use Nonexistent::{}; //~ ERROR unresolved import `Nonexistent`
|
||||
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
error[E0432]: unresolved import `S`
|
||||
--> $DIR/resolve-bad-import-prefix.rs:11:5
|
||||
|
|
||||
LL | use S::{};
|
||||
| ^ `S` is a struct, not a module
|
||||
|
||||
error[E0432]: unresolved import `Nonexistent`
|
||||
--> $DIR/resolve-bad-import-prefix.rs:13:5
|
||||
|
|
||||
LL | use Nonexistent::{};
|
||||
| ^^^^^^^^^^^ no `Nonexistent` in the root
|
||||
| ^^^^^^^^^^^ use of unresolved module or unlinked crate `Nonexistent`
|
||||
|
|
||||
help: you might be missing a crate named `Nonexistent`, add it to your project and import it in your code
|
||||
|
|
||||
LL + extern crate Nonexistent;
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0432`.
|
||||
|
||||
@@ -8,7 +8,7 @@ pub mod bar {
|
||||
pub use self::super as parent2;
|
||||
//~^ ERROR `super` is only public within the crate, and cannot be re-exported outside
|
||||
pub use super::{self as parent3};
|
||||
//~^ ERROR `super` is only public within the crate, and cannot be re-exported outside
|
||||
//~^ ERROR `self` is only public within the crate, and cannot be re-exported outside
|
||||
pub use self::{super as parent4};
|
||||
//~^ ERROR `super` is only public within the crate, and cannot be re-exported outside
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@ LL | pub use self::super as parent2;
|
||||
|
|
||||
= note: consider declaring type or module `super` with `pub`
|
||||
|
||||
error[E0365]: `super` is only public within the crate, and cannot be re-exported outside
|
||||
error[E0365]: `self` is only public within the crate, and cannot be re-exported outside
|
||||
--> $DIR/pub-use-self-super-crate.rs:10:25
|
||||
|
|
||||
LL | pub use super::{self as parent3};
|
||||
| ^^^^^^^^^^^^^^^ re-export of crate public `super`
|
||||
| ^^^^^^^^^^^^^^^ re-export of crate public `self`
|
||||
|
|
||||
= note: consider declaring type or module `super` with `pub`
|
||||
= note: consider declaring type or module `self` with `pub`
|
||||
|
||||
error[E0365]: `super` is only public within the crate, and cannot be re-exported outside
|
||||
--> $DIR/pub-use-self-super-crate.rs:12:24
|
||||
|
||||
@@ -31,10 +31,15 @@ LL | use std::mem::{self};
|
||||
| + +
|
||||
|
||||
error[E0432]: unresolved import `crate::foo`
|
||||
--> $DIR/use-mod-4.rs:1:5
|
||||
--> $DIR/use-mod-4.rs:1:12
|
||||
|
|
||||
LL | use crate::foo::self;
|
||||
| ^^^^^^^^^^^^^^^^ no `foo` in the root
|
||||
| ^^^ use of unresolved module or unlinked crate `foo`
|
||||
|
|
||||
help: you might be missing a crate named `foo`, add it to your project and import it in your code
|
||||
|
|
||||
LL + extern crate foo;
|
||||
|
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
||||
@@ -935,39 +935,49 @@ help: try renaming it with a name
|
||||
LL | use $crate::{self as name};
|
||||
| +++++++
|
||||
|
||||
error[E0432]: unresolved import `foobar`
|
||||
error[E0433]: cannot find module or crate `foobar` in the crate root
|
||||
--> $DIR/use-path-segment-kw.rs:187:17
|
||||
|
|
||||
LL | pub use foobar::qux::self;
|
||||
| ^^^^^^
|
||||
| ^^^^^^ use of unresolved module or unlinked crate `foobar`
|
||||
|
|
||||
help: a similar path exists
|
||||
help: you might be missing a crate named `foobar`, add it to your project and import it in your code
|
||||
|
|
||||
LL + extern crate foobar;
|
||||
|
|
||||
|
||||
error[E0433]: cannot find module or crate `foobar` in the crate root
|
||||
--> $DIR/use-path-segment-kw.rs:191:17
|
||||
|
|
||||
LL | pub use foobar::baz::{self};
|
||||
| ^^^^^^ use of unresolved module or unlinked crate `foobar`
|
||||
|
|
||||
help: you might be missing a crate named `foobar`, add it to your project and import it in your code
|
||||
|
|
||||
LL + extern crate foobar;
|
||||
|
|
||||
LL | pub use self::foobar::qux::self;
|
||||
| ++++++
|
||||
|
||||
error[E0432]: unresolved import `foobar`
|
||||
--> $DIR/use-path-segment-kw.rs:189:17
|
||||
|
|
||||
LL | pub use foobar::self as _self3;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ no `foobar` in the root
|
||||
|
||||
error[E0432]: unresolved import `foobar`
|
||||
--> $DIR/use-path-segment-kw.rs:191:17
|
||||
|
|
||||
LL | pub use foobar::baz::{self};
|
||||
| ^^^^^^
|
||||
|
|
||||
help: a similar path exists
|
||||
|
|
||||
LL | pub use self::foobar::baz::{self};
|
||||
LL | pub use self::foobar::self as _self3;
|
||||
| ++++++
|
||||
|
||||
error[E0432]: unresolved import `foobar`
|
||||
--> $DIR/use-path-segment-kw.rs:192:26
|
||||
--> $DIR/use-path-segment-kw.rs:192:17
|
||||
|
|
||||
LL | pub use foobar::{self as _nested_self3};
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ no `foobar` in the root
|
||||
| ^^^^^^
|
||||
|
|
||||
help: a similar path exists
|
||||
|
|
||||
LL | pub use self::foobar::{self as _nested_self3};
|
||||
| ++++++
|
||||
|
||||
error[E0433]: `self` in paths can only be used in start position
|
||||
--> $DIR/use-path-segment-kw.rs:215:36
|
||||
|
||||
@@ -185,10 +185,10 @@ pub fn inner() {}
|
||||
|
||||
type D3 = foobar::self; //~ ERROR `self` in paths can only be used in start position
|
||||
pub use foobar::qux::self; //~ ERROR `self` imports are only allowed within a { } list
|
||||
//[e2015]~^ ERROR unresolved import `foobar`
|
||||
//[e2015]~^ ERROR cannot find module or crate `foobar` in the crate root
|
||||
pub use foobar::self as _self3; //~ ERROR `self` imports are only allowed within a { } list
|
||||
//[e2015]~^ ERROR unresolved import `foobar`
|
||||
pub use foobar::baz::{self}; //[e2015]~ ERROR unresolved import `foobar`
|
||||
pub use foobar::baz::{self}; //[e2015]~ ERROR cannot find module or crate `foobar` in the crate root
|
||||
pub use foobar::{self as _nested_self3}; //[e2015]~ ERROR unresolved import `foobar`
|
||||
|
||||
type D4 = crate::self; //~ ERROR `self` in paths can only be used in start position
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
pub mod x {
|
||||
pub use crate::x::super::{self as crate1}; //~ ERROR `super` in paths can only be used in start position
|
||||
pub use crate::x::self::super::{self as crate2}; //~ ERROR `super` in paths can only be used in start position
|
||||
pub use crate::x::self::super::{self as crate2}; //~ ERROR `self` in paths can only be used in start position
|
||||
|
||||
pub fn foo() {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
x::crate1::x::foo(); //~ ERROR cannot find `crate1` in `x`
|
||||
x::crate2::x::foo(); //~ ERROR cannot find `crate2` in `x`
|
||||
x::crate1::x::foo();
|
||||
x::crate2::x::foo();
|
||||
|
||||
crate::x::super::x::foo(); //~ ERROR `super` in paths can only be used in start position
|
||||
crate::x::self::super::x::foo(); //~ ERROR `self` in paths can only be used in start position
|
||||
|
||||
@@ -1,26 +1,14 @@
|
||||
error: `super` in paths can only be used in start position, after `self`, or after another `super`
|
||||
error[E0433]: `super` in paths can only be used in start position
|
||||
--> $DIR/use-super-in-middle.rs:2:23
|
||||
|
|
||||
LL | pub use crate::x::super::{self as crate1};
|
||||
| ^^^^^
|
||||
| ^^^^^ can only be used in path start position
|
||||
|
||||
error: `super` in paths can only be used in start position, after `self`, or after another `super`
|
||||
--> $DIR/use-super-in-middle.rs:3:29
|
||||
error[E0433]: `self` in paths can only be used in start position
|
||||
--> $DIR/use-super-in-middle.rs:3:23
|
||||
|
|
||||
LL | pub use crate::x::self::super::{self as crate2};
|
||||
| ^^^^^
|
||||
|
||||
error[E0433]: cannot find `crate1` in `x`
|
||||
--> $DIR/use-super-in-middle.rs:9:8
|
||||
|
|
||||
LL | x::crate1::x::foo();
|
||||
| ^^^^^^ could not find `crate1` in `x`
|
||||
|
||||
error[E0433]: cannot find `crate2` in `x`
|
||||
--> $DIR/use-super-in-middle.rs:10:8
|
||||
|
|
||||
LL | x::crate2::x::foo();
|
||||
| ^^^^^^ could not find `crate2` in `x`
|
||||
| ^^^^ can only be used in path start position
|
||||
|
||||
error[E0433]: `super` in paths can only be used in start position
|
||||
--> $DIR/use-super-in-middle.rs:12:15
|
||||
@@ -34,6 +22,6 @@ error[E0433]: `self` in paths can only be used in start position
|
||||
LL | crate::x::self::super::x::foo();
|
||||
| ^^^^ can only be used in path start position
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0433`.
|
||||
|
||||
Reference in New Issue
Block a user