-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #57918 - Centril:rollup, r=Centril
Rollup of 7 pull requests Successful merges: - #57407 (Stabilize extern_crate_self) - #57703 (Make MutexGuard's Debug implementation more useful.) - #57764 (Fix some minor warnings) - #57825 (un-deprecate mem::zeroed) - #57827 (Ignore aarch64 in simd-intrinsic-generic-reduction) - #57908 (resolve: Fix span arithmetics in the import conflict error) - #57913 (Change crate-visibility-modifier issue number in The Unstable Book) Failed merges: r? @ghost
- Loading branch information
Showing
21 changed files
with
156 additions
and
84 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
src/doc/unstable-book/src/language-features/crate-visibility-modifier.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/test/ui/feature-gates/feature-gate-extern_crate_self.stderr
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
...test/ui/imports/extern-crate-self-fail.rs → ...tern-crate-self/extern-crate-self-fail.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../ui/imports/extern-crate-self-fail.stderr → ...-crate-self/extern-crate-self-fail.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/test/ui/imports/extern-crate-self/extern-crate-self-macro-alias.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// run-pass | ||
|
||
// Test that a macro can correctly expand the alias | ||
// in an `extern crate self as ALIAS` item. | ||
|
||
fn the_answer() -> usize { 42 } | ||
|
||
macro_rules! alias_self { | ||
($alias:ident) => { extern crate self as $alias; } | ||
} | ||
|
||
alias_self!(the_alias); | ||
|
||
fn main() { | ||
assert_eq!(the_alias::the_answer(), 42); | ||
} |
12 changes: 12 additions & 0 deletions
12
src/test/ui/imports/extern-crate-self/extern-crate-self-macro-item.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// compile-pass | ||
|
||
// Test that `extern crate self;` is accepted | ||
// syntactically as an item for use in a macro. | ||
|
||
macro_rules! accept_item { ($x:item) => {} } | ||
|
||
accept_item! { | ||
extern crate self; | ||
} | ||
|
||
fn main() {} |
16 changes: 16 additions & 0 deletions
16
src/test/ui/imports/extern-crate-self/extern-crate-self-macro-self.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// run-pass | ||
|
||
// Test that a macro can correctly expand `self` in | ||
// an `extern crate self as ALIAS` item. | ||
|
||
fn the_answer() -> usize { 42 } | ||
|
||
macro_rules! extern_something { | ||
($alias:ident) => { extern crate $alias as the_alias; } | ||
} | ||
|
||
extern_something!(self); | ||
|
||
fn main() { | ||
assert_eq!(the_alias::the_answer(), 42); | ||
} |
2 changes: 0 additions & 2 deletions
2
...test/ui/imports/extern-crate-self-pass.rs → ...tern-crate-self/extern-crate-self-pass.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
// compile-pass | ||
|
||
#![feature(extern_crate_self)] | ||
|
||
extern crate self as foo; | ||
|
||
struct S; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
macro_rules! import { | ||
( $($name:ident),* ) => { | ||
$( | ||
mod $name; | ||
pub use self::$name; | ||
//~^ ERROR the name `issue_56411_aux` is defined multiple times | ||
//~| ERROR `issue_56411_aux` is private, and cannot be re-exported | ||
|
||
)* | ||
} | ||
} | ||
|
||
import!(issue_56411_aux); | ||
|
||
fn main() { | ||
println!("Hello, world!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
error[E0255]: the name `issue_56411_aux` is defined multiple times | ||
--> $DIR/issue-56411.rs:5:21 | ||
| | ||
LL | mod $name; | ||
| ---------- previous definition of the module `issue_56411_aux` here | ||
LL | pub use self::$name; | ||
| ^^^^^^^^^^^ | ||
| | | ||
| `issue_56411_aux` reimported here | ||
| you can use `as` to change the binding name of the import | ||
... | ||
LL | import!(issue_56411_aux); | ||
| ------------------------- in this macro invocation | ||
| | ||
= note: `issue_56411_aux` must be defined only once in the type namespace of this module | ||
|
||
error[E0365]: `issue_56411_aux` is private, and cannot be re-exported | ||
--> $DIR/issue-56411.rs:5:21 | ||
| | ||
LL | pub use self::$name; | ||
| ^^^^^^^^^^^ re-export of private `issue_56411_aux` | ||
... | ||
LL | import!(issue_56411_aux); | ||
| ------------------------- in this macro invocation | ||
| | ||
= note: consider declaring type or module `issue_56411_aux` with `pub` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors occurred: E0255, E0365. | ||
For more information about an error, try `rustc --explain E0255`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// compile-pass | ||
|
||
struct T {} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters