mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-23 13:13:17 +00:00
cargo fmt
This commit is contained in:
parent
aed001b8d4
commit
d0d7c5e922
@ -1,8 +1,7 @@
|
|||||||
|
use crate::utils::{is_entrypoint_fn, span_lint};
|
||||||
use rustc::hir;
|
use rustc::hir;
|
||||||
use rustc::hir::intravisit::FnKind;
|
use rustc::hir::intravisit::FnKind;
|
||||||
use rustc::hir::{Body, Constness, FnDecl};
|
use rustc::hir::{Body, Constness, FnDecl};
|
||||||
// use rustc::mir::*;
|
|
||||||
use crate::utils::{is_entrypoint_fn, span_lint};
|
|
||||||
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
|
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
|
||||||
use rustc::{declare_tool_lint, lint_array};
|
use rustc::{declare_tool_lint, lint_array};
|
||||||
use rustc_mir::transform::qualify_min_const_fn::is_min_const_fn;
|
use rustc_mir::transform::qualify_min_const_fn::is_min_const_fn;
|
||||||
|
@ -3,7 +3,7 @@ use if_chain::if_chain;
|
|||||||
use matches::matches;
|
use matches::matches;
|
||||||
use rustc::hir;
|
use rustc::hir;
|
||||||
use rustc::hir::def::Def;
|
use rustc::hir::def::Def;
|
||||||
use rustc::hir::def_id::{DefId, LOCAL_CRATE, CRATE_DEF_INDEX};
|
use rustc::hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
|
||||||
use rustc::hir::intravisit::{NestedVisitorMap, Visitor};
|
use rustc::hir::intravisit::{NestedVisitorMap, Visitor};
|
||||||
use rustc::hir::Node;
|
use rustc::hir::Node;
|
||||||
use rustc::hir::*;
|
use rustc::hir::*;
|
||||||
@ -353,7 +353,7 @@ pub fn method_chain_args<'a>(expr: &'a Expr, methods: &[&str]) -> Option<Vec<&'a
|
|||||||
/// Returns true if the provided `def_id` is an entrypoint to a program
|
/// Returns true if the provided `def_id` is an entrypoint to a program
|
||||||
pub fn is_entrypoint_fn(cx: &LateContext<'_, '_>, def_id: DefId) -> bool {
|
pub fn is_entrypoint_fn(cx: &LateContext<'_, '_>, def_id: DefId) -> bool {
|
||||||
if let Some((entry_fn_def_id, _)) = cx.tcx.entry_fn(LOCAL_CRATE) {
|
if let Some((entry_fn_def_id, _)) = cx.tcx.entry_fn(LOCAL_CRATE) {
|
||||||
return def_id == entry_fn_def_id
|
return def_id == entry_fn_def_id;
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user