We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c4eadd commit 98dbe9aCopy full SHA for 98dbe9a
compiler/rustc_lint/src/non_local_def.rs
@@ -83,7 +83,7 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions {
83
if let Some(def_id) = oexpn.macro_def_id
84
&& let ExpnKind::Macro(macro_kind, macro_name) = oexpn.kind
85
&& def_id.krate != LOCAL_CRATE
86
- && std::env::var_os("CARGO").is_some()
+ && rustc_session::utils::was_invoked_from_cargo()
87
{
88
Some(NonLocalDefinitionsCargoUpdateNote {
89
macro_kind: macro_kind.descr(),
tests/ui/lint/non_local_definitions.rs
@@ -1,7 +1,7 @@
1
//@ check-pass
2
//@ edition:2021
3
//@ aux-build:non_local_macro.rs
4
-//@ rustc-env:CARGO=/usr/bin/cargo
+//@ rustc-env:CARGO_CRATE_NAME=non_local_def
5
6
#![feature(inline_const)]
7
#![warn(non_local_definitions)]
0 commit comments