False Positive for rust-lang/rust#83583

The deprecation lint proc_macro_derive_resolution_fallback is intended to catch proc macro generated code that refers to items from parent modules that should not be in scope:

The deprecation lint proc_macro_derive_resolution_fallback is intended to catch proc macro generated code that refers to items from parent modules that should not be in scope:

struct Outer {}

mod generated {
    struct Dummy {
        inner: Outer,
    }
}

The lint works for this case, and a proc macro can add a use super::*; line to make this code valid:

struct Outer {}

mod generated {
    use super::*;

    struct Dummy {
        inner: Outer,
    }
}

However, if the same corrected proc macro runs inside a fn body the lint will still be triggered, incorrectly:

fn item() {
    struct Inner {}

    mod generated {
        use super::*;

        struct Dummy {
            inner: Inner,
        }
    }
}
warning: cannot find type `Inner` in this scope
  --> src\lib.rs:12:12
   |
12 |     struct Inner {}
   |            ^^^^^ names from parent modules are not accessible without an explicit import
   |
   = note: `#[warn(proc_macro_derive_resolution_fallback)]` on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>

See foo-derive/src/lib.rs for the proc macro implementation and src/lib.rs for usage. This warning can be reproduced with

cargo check

Information - Updated Nov 16, 2021

Stars: 0
Forks: 0
Issues: 0

JIT-compiler for the programming language Dora implemented in Rust

Use the specific nightly version listed in the Ruby and therefore a Ruby interpreter needs to be installed on your system (e

JIT-compiler for the programming language Dora implemented in Rust

compiler-builtins

Porting compiler-rt intrinsics to Rust

compiler-builtins

Rust compiler toolkit for WebAssembly apps in the WasmEdge Runtime

Developers: Getting started with the Tencent Serverless Functions for AI inference, or WasmEdge Runtime

Rust compiler toolkit for WebAssembly apps in the WasmEdge Runtime

An experimental x86_64 bootloader that works on both BIOS and UEFI systems

Rust compiler with the llvm-tools-preview component, which can be installed through rustup component add llvm-tools-preview

An experimental x86_64 bootloader that works on both BIOS and UEFI systems

vue template compiler in Rust

code generation and ast parsing in the same data structure

vue template compiler in Rust

An optimising compiler for brainfuck

bfc is an industrial grade compiler for

An optimising compiler for brainfuck

A fancy compiler diagnostics crate

examples/ for more examples

A fancy compiler diagnostics crate

vue template compiler in Rust

code generation and ast parsing in the same data structure

vue template compiler in Rust

An experimental x86_64 bootloader that works on both BIOS and UEFI systems

Rust compiler with the llvm-tools-preview component, which can be installed through rustup component add llvm-tools-preview

An experimental x86_64 bootloader that works on both BIOS and UEFI systems

compiler-builtins

Porting compiler-rt intrinsics to Rust

compiler-builtins
Facebook Instagram Twitter GitHub Dribbble
Privacy