Rustup to rustc 1.40.0-nightly (7a76fe76f 2019-11-07)

This commit is contained in:
Manish Goregaokar
2019-11-07 00:34:45 -08:00
committed by flip1995
parent 43a3796379
commit 305ba73fc1
4 changed files with 27 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
use rustc::hir::{Crate, Expr, ExprKind, QPath};
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_tool_lint, impl_lint_pass};
use syntax::ast::AttrKind;
use syntax::symbol::sym;
use crate::utils::{is_entrypoint_fn, snippet, span_help_and_lint};
@@ -34,7 +35,13 @@ impl_lint_pass!(MainRecursion => [MAIN_RECURSION]);
impl LateLintPass<'_, '_> for MainRecursion {
fn check_crate(&mut self, _: &LateContext<'_, '_>, krate: &Crate) {
self.has_no_std_attr = krate.attrs.iter().any(|attr| attr.path == sym::no_std);
self.has_no_std_attr = krate.attrs.iter().any(|attr| {
if let AttrKind::Normal(ref attr) = attr.kind {
attr.path == sym::no_std
} else {
false
}
});
}
fn check_expr_post(&mut self, cx: &LateContext<'_, '_>, expr: &Expr) {