Skip to content

Commit

Permalink
Use was_invoked_from_cargo method instead of hand-written one
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Feb 29, 2024
1 parent bb48688 commit b0365e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/non_local_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,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(),
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/lint/non_local_definitions.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ check-pass
//@ edition:2021
//@ aux-build:non_local_macro.rs
//@ rustc-env:CARGO=/usr/bin/cargo
//@ rustc-env:CARGO_CRATE_NAME=non_local_def

#![feature(inline_const)]

Expand Down

0 comments on commit b0365e1

Please sign in to comment.