forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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 rust-lang#54821 - pietroalbini:beta-backports, r=pietro…
…albini [beta] Rollup backports Merged and approved: * rust-lang#54605: resolve: Disambiguate a subset of conflicts "macro_rules" vs "macro name in module" * rust-lang#54557: incr.comp.: Don't automatically enable -Zshare-generics for incr. comp. builds. * rust-lang#54759: do not normalize non-scalar constants to a ConstValue::ScalarPair Closes rust-lang#54759 r? @ghost
- Loading branch information
Showing
12 changed files
with
160 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ mod m3 { | |
mod m4 { | ||
macro_rules! m { () => {} } | ||
use two_macros::m; | ||
m!(); //~ ERROR ambiguous | ||
m!(); | ||
} | ||
|
||
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
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 | ||
|
||
pub struct GstRc { | ||
_obj: *const (), | ||
_borrowed: bool, | ||
} | ||
|
||
const FOO: Option<GstRc> = None; | ||
|
||
fn main() { | ||
let _meh = FOO; | ||
} |
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,46 @@ | ||
// Some non-controversial subset of ambiguities "modern macro name" vs "macro_rules" | ||
// is disambiguated to mitigate regressions from macro modularization. | ||
// Scoping for `macro_rules` behaves like scoping for `let` at module level, in general. | ||
|
||
#![feature(decl_macro)] | ||
|
||
fn same_unnamed_mod() { | ||
macro m() { 0 } | ||
|
||
macro_rules! m { () => (()) } | ||
|
||
m!() // OK | ||
} | ||
|
||
fn nested_unnamed_mod() { | ||
macro m() { 0 } | ||
|
||
{ | ||
macro_rules! m { () => (()) } | ||
|
||
m!() // OK | ||
} | ||
} | ||
|
||
fn nested_unnamed_mod_fail() { | ||
macro_rules! m { () => (()) } | ||
|
||
{ | ||
macro m() { 0 } | ||
|
||
m!() //~ ERROR `m` is ambiguous | ||
} | ||
} | ||
|
||
fn nexted_named_mod_fail() { | ||
macro m() { 0 } | ||
|
||
#[macro_use] | ||
mod inner { | ||
macro_rules! m { () => (()) } | ||
} | ||
|
||
m!() //~ ERROR `m` is ambiguous | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
error[E0659]: `m` is ambiguous | ||
--> $DIR/ambiguity-legacy-vs-modern.rs:31:9 | ||
| | ||
LL | m!() //~ ERROR `m` is ambiguous | ||
| ^ ambiguous name | ||
| | ||
note: `m` could refer to the name defined here | ||
--> $DIR/ambiguity-legacy-vs-modern.rs:26:5 | ||
| | ||
LL | macro_rules! m { () => (()) } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
note: `m` could also refer to the name defined here | ||
--> $DIR/ambiguity-legacy-vs-modern.rs:29:9 | ||
| | ||
LL | macro m() { 0 } | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error[E0659]: `m` is ambiguous | ||
--> $DIR/ambiguity-legacy-vs-modern.rs:43:5 | ||
| | ||
LL | m!() //~ ERROR `m` is ambiguous | ||
| ^ ambiguous name | ||
| | ||
note: `m` could refer to the name defined here | ||
--> $DIR/ambiguity-legacy-vs-modern.rs:40:9 | ||
| | ||
LL | macro_rules! m { () => (()) } | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
note: `m` could also refer to the name defined here | ||
--> $DIR/ambiguity-legacy-vs-modern.rs:36:5 | ||
| | ||
LL | macro m() { 0 } | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0659`. |