-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #115269 - bvanjoi:fix-113834, r=petrochenkov
resolve: mark binding is determined after all macros had been expanded Fixes #113834 Fixes #115377 r? `@petrochenkov`
- Loading branch information
Showing
14 changed files
with
154 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// check-pass | ||
|
||
mod b { | ||
pub mod http { | ||
pub struct HeaderMap; | ||
} | ||
|
||
pub use self::http::*; | ||
#[derive(Debug)] | ||
pub struct HeaderMap; | ||
} | ||
|
||
use crate::b::*; | ||
|
||
fn main() { | ||
let h: crate::b::HeaderMap = HeaderMap; | ||
} |
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,21 @@ | ||
// check-pass | ||
|
||
#[derive(Debug)] | ||
struct H; | ||
|
||
mod p { | ||
use super::*; | ||
|
||
#[derive(Clone)] | ||
struct H; | ||
|
||
mod t { | ||
use super::*; | ||
|
||
fn f() { | ||
let h: crate::p::H = H; | ||
} | ||
} | ||
} | ||
|
||
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,34 @@ | ||
// check-pass | ||
// https://github.com/rust-lang/rust/issues/115377 | ||
|
||
use module::*; | ||
|
||
mod module { | ||
pub enum B {} | ||
impl B { | ||
pub const ASSOC: u8 = 0; | ||
} | ||
} | ||
|
||
#[derive()] | ||
pub enum B {} | ||
impl B { | ||
pub const ASSOC: u16 = 0; | ||
} | ||
|
||
macro_rules! m { | ||
($right:expr) => { | ||
$right | ||
}; | ||
} | ||
|
||
fn main() { | ||
let a: u16 = { | ||
use self::*; | ||
B::ASSOC | ||
}; | ||
let b: u16 = m!({ | ||
use self::*; | ||
B::ASSOC | ||
}); | ||
} |
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,22 @@ | ||
// check-pass | ||
// similar as `import-after-macro-expand-6.rs` | ||
|
||
use crate::a::HeaderMap; | ||
|
||
mod b { | ||
pub mod http { | ||
pub struct HeaderMap; | ||
} | ||
|
||
pub use self::http::*; | ||
#[derive(Debug)] | ||
pub struct HeaderMap; | ||
} | ||
|
||
mod a { | ||
pub use crate::b::*; | ||
} | ||
|
||
fn main() { | ||
let h: crate::b::HeaderMap = HeaderMap; | ||
} |
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,22 @@ | ||
// check-pass | ||
|
||
use crate::a::HeaderMap; | ||
|
||
mod b { | ||
pub mod http { | ||
#[derive(Clone)] | ||
pub struct HeaderMap; | ||
} | ||
|
||
pub use self::http::*; | ||
#[derive(Debug)] | ||
pub struct HeaderMap; | ||
} | ||
|
||
mod a { | ||
pub use crate::b::*; | ||
} | ||
|
||
fn main() { | ||
let h: crate::b::HeaderMap = HeaderMap; | ||
} |
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.
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,17 @@ | ||
// check-pass | ||
|
||
use crate::b::*; | ||
|
||
mod b { | ||
pub mod http { | ||
pub struct HeaderMap; | ||
} | ||
|
||
pub use self::http::*; | ||
#[derive(Debug)] | ||
pub struct HeaderMap; | ||
} | ||
|
||
fn main() { | ||
let h: crate::b::HeaderMap = HeaderMap; | ||
} |