Auto merge of #72378 - Dylan-DPC:rollup-m87bp2d, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #71863 (Suggest fixes and add error recovery for `use foo::self`) - #72139 (Make `fold` standalone.) - #72275 (Continue lowering for unsupported async generator instead of returning an error.) - #72361 (split_inclusive: add tracking issue number (72360)) - #72364 (Remove unused dependencies) - #72366 (Adjust the zero check in `RawVec::grow`.) Failed merges: r? @ghost
This commit is contained in:
commit
0aa6751c19
28 changed files with 415 additions and 110 deletions
|
|
@ -1,8 +1,17 @@
|
|||
error[E0429]: `self` imports are only allowed within a { } list
|
||||
--> $DIR/E0429.rs:1:5
|
||||
--> $DIR/E0429.rs:1:13
|
||||
|
|
||||
LL | use std::fmt::self;
|
||||
| ^^^^^^^^^^^^^^
|
||||
| ^^^^^^
|
||||
|
|
||||
help: consider importing the module directly
|
||||
|
|
||||
LL | use std::fmt;
|
||||
| --
|
||||
help: alternatively, use the multi-path `use` syntax to import `self`
|
||||
|
|
||||
LL | use std::fmt::{self};
|
||||
| ^ ^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ use foo::{self};
|
|||
use foo as self;
|
||||
//~^ ERROR expected identifier
|
||||
|
||||
use foo::self;
|
||||
use foo::self; //~ ERROR is defined multiple times
|
||||
//~^ ERROR `self` imports are only allowed within a { } list
|
||||
|
||||
use foo::A;
|
||||
|
|
|
|||
|
|
@ -5,10 +5,19 @@ LL | use foo as self;
|
|||
| ^^^^ expected identifier, found keyword
|
||||
|
||||
error[E0429]: `self` imports are only allowed within a { } list
|
||||
--> $DIR/import-self.rs:12:5
|
||||
--> $DIR/import-self.rs:12:8
|
||||
|
|
||||
LL | use foo::self;
|
||||
| ^^^^^^^^^
|
||||
| ^^^^^^
|
||||
|
|
||||
help: consider importing the module directly
|
||||
|
|
||||
LL | use foo;
|
||||
| --
|
||||
help: alternatively, use the multi-path `use` syntax to import `self`
|
||||
|
|
||||
LL | use foo::{self};
|
||||
| ^ ^
|
||||
|
||||
error[E0255]: the name `foo` is defined multiple times
|
||||
--> $DIR/import-self.rs:6:11
|
||||
|
|
@ -25,6 +34,21 @@ help: you can use `as` to change the binding name of the import
|
|||
LL | use foo::{self as other_foo};
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0255]: the name `foo` is defined multiple times
|
||||
--> $DIR/import-self.rs:12:5
|
||||
|
|
||||
LL | mod foo {
|
||||
| ------- previous definition of the module `foo` here
|
||||
...
|
||||
LL | use foo::self;
|
||||
| ^^^^^^^^^ `foo` reimported here
|
||||
|
|
||||
= 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 as other_foo;
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0252]: the name `A` is defined multiple times
|
||||
--> $DIR/import-self.rs:16:11
|
||||
|
|
||||
|
|
@ -39,7 +63,7 @@ help: you can use `as` to change the binding name of the import
|
|||
LL | use foo::{self as OtherA};
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0252, E0255, E0429.
|
||||
For more information about an error, try `rustc --explain E0252`.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0429]: `self` imports are only allowed within a { } list
|
|||
--> $DIR/use-keyword.rs:6:13
|
||||
|
|
||||
LL | use self as A;
|
||||
| ^^^^^^^^^
|
||||
| ^^^^
|
||||
|
||||
error[E0432]: unresolved import `super`
|
||||
--> $DIR/use-keyword.rs:8:13
|
||||
|
|
|
|||
|
|
@ -1,20 +1,38 @@
|
|||
error[E0429]: `self` imports are only allowed within a { } list
|
||||
--> $DIR/use-mod-4.rs:1:5
|
||||
--> $DIR/use-mod-4.rs:1:8
|
||||
|
|
||||
LL | use foo::self;
|
||||
| ^^^^^^^^^
|
||||
| ^^^^^^
|
||||
|
|
||||
help: consider importing the module directly
|
||||
|
|
||||
LL | use foo;
|
||||
| --
|
||||
help: alternatively, use the multi-path `use` syntax to import `self`
|
||||
|
|
||||
LL | use foo::{self};
|
||||
| ^ ^
|
||||
|
||||
error[E0429]: `self` imports are only allowed within a { } list
|
||||
--> $DIR/use-mod-4.rs:4:5
|
||||
--> $DIR/use-mod-4.rs:4:13
|
||||
|
|
||||
LL | use std::mem::self;
|
||||
| ^^^^^^^^^^^^^^
|
||||
| ^^^^^^
|
||||
|
|
||||
help: consider importing the module directly
|
||||
|
|
||||
LL | use std::mem;
|
||||
| --
|
||||
help: alternatively, use the multi-path `use` syntax to import `self`
|
||||
|
|
||||
LL | use std::mem::{self};
|
||||
| ^ ^
|
||||
|
||||
error[E0432]: unresolved import `foo`
|
||||
--> $DIR/use-mod-4.rs:1:5
|
||||
|
|
||||
LL | use foo::self;
|
||||
| ^^^ maybe a missing crate `foo`?
|
||||
| ^^^^^^^^^ no `foo` in the root
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
13
src/test/ui/use/use-mod/use-mod-5.rs
Normal file
13
src/test/ui/use/use-mod/use-mod-5.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
mod foo {
|
||||
pub mod bar {
|
||||
pub fn drop() {}
|
||||
}
|
||||
}
|
||||
|
||||
use foo::bar::self;
|
||||
//~^ ERROR `self` imports are only allowed within a { } list
|
||||
|
||||
fn main() {
|
||||
// Because of error recovery this shouldn't error
|
||||
bar::drop();
|
||||
}
|
||||
18
src/test/ui/use/use-mod/use-mod-5.stderr
Normal file
18
src/test/ui/use/use-mod/use-mod-5.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error[E0429]: `self` imports are only allowed within a { } list
|
||||
--> $DIR/use-mod-5.rs:7:13
|
||||
|
|
||||
LL | use foo::bar::self;
|
||||
| ^^^^^^
|
||||
|
|
||||
help: consider importing the module directly
|
||||
|
|
||||
LL | use foo::bar;
|
||||
| --
|
||||
help: alternatively, use the multi-path `use` syntax to import `self`
|
||||
|
|
||||
LL | use foo::bar::{self};
|
||||
| ^ ^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0429`.
|
||||
13
src/test/ui/use/use-mod/use-mod-6.rs
Normal file
13
src/test/ui/use/use-mod/use-mod-6.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
mod foo {
|
||||
pub mod bar {
|
||||
pub fn drop() {}
|
||||
}
|
||||
}
|
||||
|
||||
use foo::bar::self as abc;
|
||||
//~^ ERROR `self` imports are only allowed within a { } list
|
||||
|
||||
fn main() {
|
||||
// Because of error recovery this shouldn't error
|
||||
abc::drop();
|
||||
}
|
||||
18
src/test/ui/use/use-mod/use-mod-6.stderr
Normal file
18
src/test/ui/use/use-mod/use-mod-6.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error[E0429]: `self` imports are only allowed within a { } list
|
||||
--> $DIR/use-mod-6.rs:7:13
|
||||
|
|
||||
LL | use foo::bar::self as abc;
|
||||
| ^^^^^^
|
||||
|
|
||||
help: consider importing the module directly
|
||||
|
|
||||
LL | use foo::bar as abc;
|
||||
| --
|
||||
help: alternatively, use the multi-path `use` syntax to import `self`
|
||||
|
|
||||
LL | use foo::bar::{self as abc};
|
||||
| ^ ^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0429`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue