-
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.
Consider outermost const-anon in non_local_def lint
- Loading branch information
Showing
6 changed files
with
148 additions
and
34 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
34 changes: 34 additions & 0 deletions
34
tests/ui/lint/non-local-defs/convoluted-locals-131474-with-mods.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,34 @@ | ||
// This test check that no matter the nesting of const-anons and modules | ||
// we consider them as transparent. | ||
// | ||
// Similar to https://github.com/rust-lang/rust/issues/131474 | ||
|
||
//@ check-pass | ||
|
||
pub mod tmp { | ||
pub mod tmp { | ||
pub struct Test; | ||
} | ||
} | ||
|
||
const _: () = { | ||
const _: () = { | ||
const _: () = { | ||
const _: () = { | ||
impl tmp::tmp::Test {} | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
const _: () = { | ||
const _: () = { | ||
mod tmp { | ||
pub(super) struct InnerTest; | ||
} | ||
|
||
impl tmp::InnerTest {} | ||
}; | ||
}; | ||
|
||
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,24 @@ | ||
// This test check that no matter the nesting of const-anons we consider | ||
// them as transparent. | ||
// | ||
// https://github.com/rust-lang/rust/issues/131474 | ||
|
||
//@ check-pass | ||
|
||
pub struct Test; | ||
|
||
const _: () = { | ||
const _: () = { | ||
impl Test {} | ||
}; | ||
}; | ||
|
||
const _: () = { | ||
const _: () = { | ||
struct InnerTest; | ||
|
||
impl InnerTest {} | ||
}; | ||
}; | ||
|
||
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