-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Also treat impl
definition parent as transparent regarding modules
#132453
Also treat impl
definition parent as transparent regarding modules
#132453
Conversation
(Nit: did u mean threat -> thread in PR title and commit msg?) |
impl
definition parent as transparent regarding modulesimpl
definition parent as transparent regarding modules
Nope, I meant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks reasonable to me, one question about uhh more "exotic" code patterns.
tests/ui/lint/non-local-defs/convoluted-locals-131474-with-mods.rs
Outdated
Show resolved
Hide resolved
0dda46d
to
6ae4697
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this LGTM, feel free to r=me after PR CI is green.
Nominating for beta-backport: this PR fixes pub mod auth {
const _: () = {
pub enum ArbitraryContext {}
const _: () = {
impl ArbitraryContext {}
};
};
} where the anon-const was nested inside modules but to the (When I say "anon-const" I mean a const with an anonymous name @rustbot label +beta-nominated |
6ae4697
to
54c46c0
Compare
54c46c0
to
37db365
Compare
@bors r=jieyouxu |
…sparent, r=jieyouxu Also treat `impl` definition parent as transparent regarding modules This PR changes the `non_local_definitions` lint logic to also consider `impl` definition parent as transparent regarding modules. See tests and explanation in the changes. `@rustbot` label +L-non_local_definitions Fixes *(after beta-backport)* rust-lang#132427 cc `@leighmcculloch` r? `@jieyouxu`
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#131037 (Move versioned Apple LLVM targets from `rustc_target` to `rustc_codegen_ssa`) - rust-lang#132147 (Tweak E0277 output when a candidate is available) - rust-lang#132398 (Add a couple of intra-doc links to str) - rust-lang#132453 (Also treat `impl` definition parent as transparent regarding modules) - rust-lang#132457 (Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline assembly test) - rust-lang#132465 (refactor(config): remove FIXME statement in comment of `omit-git-hash`) - rust-lang#132471 (Add a bunch of mailmap entries) r? `@ghost` `@rustbot` modify labels: rollup
…sparent, r=jieyouxu Also treat `impl` definition parent as transparent regarding modules This PR changes the `non_local_definitions` lint logic to also consider `impl` definition parent as transparent regarding modules. See tests and explanation in the changes. ``@rustbot`` label +L-non_local_definitions Fixes *(after beta-backport)* rust-lang#132427 cc ``@leighmcculloch`` r? ``@jieyouxu``
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#125579 (Add `--print host-tuple` to print host target tuple) - rust-lang#132398 (Add a couple of intra-doc links to str) - rust-lang#132453 (Also treat `impl` definition parent as transparent regarding modules) - rust-lang#132457 (Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline assembly test) - rust-lang#132465 (refactor(config): remove FIXME statement in comment of `omit-git-hash`) - rust-lang#132471 (Add a bunch of mailmap entries) Failed merges: - rust-lang#131037 (Move versioned Apple LLVM targets from `rustc_target` to `rustc_codegen_ssa`) r? `@ghost` `@rustbot` modify labels: rollup
…sparent, r=jieyouxu Also treat `impl` definition parent as transparent regarding modules This PR changes the `non_local_definitions` lint logic to also consider `impl` definition parent as transparent regarding modules. See tests and explanation in the changes. ```@rustbot``` label +L-non_local_definitions Fixes *(after beta-backport)* rust-lang#132427 cc ```@leighmcculloch``` r? ```@jieyouxu```
…sparent, r=jieyouxu Also treat `impl` definition parent as transparent regarding modules This PR changes the `non_local_definitions` lint logic to also consider `impl` definition parent as transparent regarding modules. See tests and explanation in the changes. ````@rustbot```` label +L-non_local_definitions Fixes *(after beta-backport)* rust-lang#132427 cc ````@leighmcculloch```` r? ````@jieyouxu````
…sparent, r=jieyouxu Also treat `impl` definition parent as transparent regarding modules This PR changes the `non_local_definitions` lint logic to also consider `impl` definition parent as transparent regarding modules. See tests and explanation in the changes. `````@rustbot````` label +L-non_local_definitions Fixes *(after beta-backport)* rust-lang#132427 cc `````@leighmcculloch````` r? `````@jieyouxu`````
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#131037 (Move versioned Apple LLVM targets from `rustc_target` to `rustc_codegen_ssa`) - rust-lang#132170 (Add a Few Codegen Tests) - rust-lang#132333 (rust_analyzer_helix.toml: add library/ manifest) - rust-lang#132398 (Add a couple of intra-doc links to str) - rust-lang#132411 (CI: switch dist-x86_64-musl to free runner) - rust-lang#132453 (Also treat `impl` definition parent as transparent regarding modules) - rust-lang#132457 (Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline assembly test) - rust-lang#132465 (refactor(config): remove FIXME statement in comment of `omit-git-hash`) - rust-lang#132466 (Account for late-bound depth when capturing all opaque lifetimes.) - rust-lang#132471 (Add a bunch of mailmap entries) - rust-lang#132488 (Remove or fix some more `FIXME(async_closure)`) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#131037 (Move versioned Apple LLVM targets from `rustc_target` to `rustc_codegen_ssa`) - rust-lang#132398 (Add a couple of intra-doc links to str) - rust-lang#132453 (Also treat `impl` definition parent as transparent regarding modules) - rust-lang#132457 (Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline assembly test) - rust-lang#132465 (refactor(config): remove FIXME statement in comment of `omit-git-hash`) - rust-lang#132466 (Account for late-bound depth when capturing all opaque lifetimes.) - rust-lang#132471 (Add a bunch of mailmap entries) - rust-lang#132488 (Remove or fix some more `FIXME(async_closure)`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#132453 - Urgau:non_local_defs-impl-mod-transparent, r=jieyouxu Also treat `impl` definition parent as transparent regarding modules This PR changes the `non_local_definitions` lint logic to also consider `impl` definition parent as transparent regarding modules. See tests and explanation in the changes. ``````@rustbot`````` label +L-non_local_definitions Fixes *(after beta-backport)* rust-lang#132427 cc ``````@leighmcculloch`````` r? ``````@jieyouxu``````
[beta] backports - rustdoc: skip stability inheritance for some item kinds rust-lang#132481 - Avoid use imports in thread_local_inner! in static rust-lang#132101 - Also treat `impl` definition parent as transparent regarding modules rust-lang#132453 - Revert "Avoid nested replacement ranges" from rust-lang#129346. rust-lang#132587 r? cuviper
[beta] backports - rustdoc: skip stability inheritance for some item kinds rust-lang#132481 - Avoid use imports in thread_local_inner! in static rust-lang#132101 - Also treat `impl` definition parent as transparent regarding modules rust-lang#132453 - Revert "Avoid nested replacement ranges" from rust-lang#129346. rust-lang#132587 r? cuviper
This PR changes the
non_local_definitions
lint logic to also considerimpl
definition parent as transparent regarding modules.See tests and explanation in the changes.
@rustbot label +L-non_local_definitions
Fixes (after beta-backport) #132427
cc @leighmcculloch
r? @jieyouxu