-
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 only the outermost const-anon in non_local_def lint
- Loading branch information
Showing
5 changed files
with
164 additions
and
45 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
24 changes: 24 additions & 0 deletions
24
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,24 @@ | ||
// 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 {} | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
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,20 @@ | ||
// 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 Default for Test { | ||
fn default() -> Test { | ||
Test | ||
} | ||
} | ||
}; | ||
}; | ||
|
||
fn main() {} |