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