Open
Description
I am getting an unexpected dead_code
warning from inside a procedural macro's output. This warning did not appear in the previous version of the Rust Compiler. This is not present in the changelog for 1.64, so I do not believe it to be an expected change.
Code
I tried this code:
#[pin_project(project = Merge2Proj)]
#[derive(Debug)]
pub struct Merge2
{
// struct contents...
}
// impl that only makes use of Merge2Proj::project...
I expected to see this happen: I expected the code to compile without warnings, as was true for the previous compiler version.
Instead, this happened: I get a dead_code
warning from inside the pin_project
macro expansion, telling me that Merge2Proj::project_ref
is unused. This warning is impossible for me to remove, as I have no need for project_ref
and there is no way to tell pin_project
to not generate it.
Version it worked on
It most recently worked on: 1.63
Version with regression
rustc --version --verbose
:
rustc 1.64.0 (a55dd71d5 2022-09-19)
binary: rustc
commit-hash: a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52
commit-date: 2022-09-19
host: x86_64-pc-windows-msvc
release: 1.64.0
LLVM version: 14.0.6
Metadata
Metadata
Assignees
Labels
Area: Lints (warnings about flaws in source code) such as unused_mut.Category: This is a bug.Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Lint: dead_codeMedium priorityRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.