-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consider inner modules to be local in the
non_local_definitions
lint
- Loading branch information
Showing
2 changed files
with
49 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
//! This test checks that module are treated as if they were local | ||
//! | ||
//! https://github.com/rust-lang/rust/issues/124396 | ||
//@ check-pass | ||
|
||
trait JoinTo {} | ||
|
||
fn simple_one() { | ||
mod posts { | ||
#[allow(non_camel_case_types)] | ||
pub struct table {} | ||
} | ||
|
||
impl JoinTo for posts::table {} | ||
} | ||
|
||
fn simple_two() { | ||
mod posts { | ||
pub mod posts { | ||
#[allow(non_camel_case_types)] | ||
pub struct table {} | ||
} | ||
} | ||
|
||
impl JoinTo for posts::posts::table {} | ||
} | ||
|
||
struct Global; | ||
fn trait_() { | ||
mod posts { | ||
pub trait AdjecentTo {} | ||
} | ||
|
||
impl posts::AdjecentTo for Global {} | ||
} | ||
|
||
fn main() {} |