We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f32bb95 commit 7c21492Copy full SHA for 7c21492
compiler/rustc_lint/src/non_local_def.rs
@@ -81,7 +81,7 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions {
81
if let Some(def_id) = oexpn.macro_def_id
82
&& let ExpnKind::Macro(macro_kind, macro_name) = oexpn.kind
83
&& def_id.krate != LOCAL_CRATE
84
- && std::env::var_os("CARGO").is_some()
+ && rustc_session::utils::was_invoked_from_cargo()
85
{
86
Some(NonLocalDefinitionsCargoUpdateNote {
87
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
0 commit comments