Skip to content

Commit b0365e1

Browse files
committed
Use was_invoked_from_cargo method instead of hand-written one
1 parent bb48688 commit b0365e1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_lint/src/non_local_def.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions {
8282
if let Some(def_id) = oexpn.macro_def_id
8383
&& let ExpnKind::Macro(macro_kind, macro_name) = oexpn.kind
8484
&& def_id.krate != LOCAL_CRATE
85-
&& std::env::var_os("CARGO").is_some()
85+
&& rustc_session::utils::was_invoked_from_cargo()
8686
{
8787
Some(NonLocalDefinitionsCargoUpdateNote {
8888
macro_kind: macro_kind.descr(),

tests/ui/lint/non_local_definitions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ check-pass
22
//@ edition:2021
33
//@ aux-build:non_local_macro.rs
4-
//@ rustc-env:CARGO=/usr/bin/cargo
4+
//@ rustc-env:CARGO_CRATE_NAME=non_local_def
55

66
#![feature(inline_const)]
77

0 commit comments

Comments
 (0)