-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
fn generated by macro exported from crate loses global #![allow(non_snake_case)] #58502
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Given a
barlibrary crate with a global#![allow(non_snake_case)]and a macro that generates functions with a given name, with or without a local#[allow(non_snake_case)]:If that crate is used by another crate to generate non-snake-case-named functions:
Then nightly rustc since 2019-01-15 (
rustc 1.33.0-nightly (03acbd71c 2019-01-14)) will warn that functions generated by the macro without the local#[allow(non_snake_case)]should have a snake case name:Whereas nightly rustc on 2019-01-14 (
rustc 1.33.0-nightly (2fadb0a16 2019-01-13)) doesn't emit this warning.Here's the comparison between the two nightly builds. To my untrained eye, @euclio's 7c0d145 (
improve non_snake_case diagnostics) and @bors's 1d029c6 (Auto merge of #57387 - euclio:nonstandard-style-suggestions) look potentially related.Note: I can't reproduce if the macro is in a module within the same crate that uses it, only if it's exported from a different crate (thus complicating the reduction of the test case to a single code snippet).