about summary refs log tree commit diff
path: root/compiler/rustc_lint
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2024-02-29 21:02:47 +0100
committerUrgau <urgau@numericable.fr>2024-03-07 07:54:15 +0100
commit98dbe9abac8e02f9a60393ae2eb2ca448c69e7d4 (patch)
tree1a15d68a142f3aa6e08120f47394eb210628e5bf /compiler/rustc_lint
parent6c4eadd74746eaa21c6da1756c440b1fdabf0729 (diff)
downloadrust-98dbe9abac8e02f9a60393ae2eb2ca448c69e7d4.tar.gz
rust-98dbe9abac8e02f9a60393ae2eb2ca448c69e7d4.zip
Use was_invoked_from_cargo method instead of hand-written one
Diffstat (limited to 'compiler/rustc_lint')
-rw-r--r--compiler/rustc_lint/src/non_local_def.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/non_local_def.rs b/compiler/rustc_lint/src/non_local_def.rs
index 1ae1c72b6e8..7c4d92d3ce0 100644
--- a/compiler/rustc_lint/src/non_local_def.rs
+++ b/compiler/rustc_lint/src/non_local_def.rs
@@ -83,7 +83,7 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions {
             if let Some(def_id) = oexpn.macro_def_id
                 && let ExpnKind::Macro(macro_kind, macro_name) = oexpn.kind
                 && def_id.krate != LOCAL_CRATE
-                && std::env::var_os("CARGO").is_some()
+                && rustc_session::utils::was_invoked_from_cargo()
             {
                 Some(NonLocalDefinitionsCargoUpdateNote {
                     macro_kind: macro_kind.descr(),