Use was_invoked_from_cargo method instead of hand-written one
This commit is contained in:
parent
6c4eadd747
commit
98dbe9abac
2 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions {
|
||||||
if let Some(def_id) = oexpn.macro_def_id
|
if let Some(def_id) = oexpn.macro_def_id
|
||||||
&& let ExpnKind::Macro(macro_kind, macro_name) = oexpn.kind
|
&& let ExpnKind::Macro(macro_kind, macro_name) = oexpn.kind
|
||||||
&& def_id.krate != LOCAL_CRATE
|
&& def_id.krate != LOCAL_CRATE
|
||||||
&& std::env::var_os("CARGO").is_some()
|
&& rustc_session::utils::was_invoked_from_cargo()
|
||||||
{
|
{
|
||||||
Some(NonLocalDefinitionsCargoUpdateNote {
|
Some(NonLocalDefinitionsCargoUpdateNote {
|
||||||
macro_kind: macro_kind.descr(),
|
macro_kind: macro_kind.descr(),
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//@ check-pass
|
//@ check-pass
|
||||||
//@ edition:2021
|
//@ edition:2021
|
||||||
//@ aux-build:non_local_macro.rs
|
//@ aux-build:non_local_macro.rs
|
||||||
//@ rustc-env:CARGO=/usr/bin/cargo
|
//@ rustc-env:CARGO_CRATE_NAME=non_local_def
|
||||||
|
|
||||||
#![feature(inline_const)]
|
#![feature(inline_const)]
|
||||||
#![warn(non_local_definitions)]
|
#![warn(non_local_definitions)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue