Auto merge of #5143 - flip1995:rustup, r=flip1995
Rustup to rust-lang/rust#68788 cc rust-lang/rust#68901 changelog: none
This commit is contained in:
commit
ee842df61d
@ -372,10 +372,10 @@ impl EarlyLintPass for MiscEarlyLints {
|
||||
check_unneeded_wildcard_pattern(cx, pat);
|
||||
}
|
||||
|
||||
fn check_fn(&mut self, cx: &EarlyContext<'_>, _: FnKind<'_>, decl: &FnDecl, _: Span, _: NodeId) {
|
||||
fn check_fn(&mut self, cx: &EarlyContext<'_>, fn_kind: FnKind<'_>, _: Span, _: NodeId) {
|
||||
let mut registered_names: FxHashMap<String, Span> = FxHashMap::default();
|
||||
|
||||
for arg in &decl.inputs {
|
||||
for arg in &fn_kind.decl().inputs {
|
||||
if let PatKind::Ident(_, ident, None) = arg.pat.kind {
|
||||
let arg_name = ident.to_string();
|
||||
|
||||
|
@ -352,7 +352,7 @@ impl<'a, 'tcx> Visitor<'tcx> for SimilarNamesLocalVisitor<'a, 'tcx> {
|
||||
|
||||
impl EarlyLintPass for NonExpressiveNames {
|
||||
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
|
||||
if let ItemKind::Fn(ref sig, _, ref blk) = item.kind {
|
||||
if let ItemKind::Fn(ref sig, _, Some(ref blk)) = item.kind {
|
||||
do_check(self, cx, &item.attrs, &sig.decl, blk);
|
||||
}
|
||||
}
|
||||
|
@ -235,13 +235,14 @@ impl Return {
|
||||
}
|
||||
|
||||
impl EarlyLintPass for Return {
|
||||
fn check_fn(&mut self, cx: &EarlyContext<'_>, kind: FnKind<'_>, decl: &ast::FnDecl, span: Span, _: ast::NodeId) {
|
||||
fn check_fn(&mut self, cx: &EarlyContext<'_>, kind: FnKind<'_>, span: Span, _: ast::NodeId) {
|
||||
match kind {
|
||||
FnKind::ItemFn(.., block) | FnKind::Method(.., block) => self.check_block_return(cx, block),
|
||||
FnKind::Closure(body) => self.check_final_expr(cx, body, Some(body.span), RetReplacement::Empty),
|
||||
FnKind::Fn(.., Some(block)) => self.check_block_return(cx, block),
|
||||
FnKind::Closure(_, body) => self.check_final_expr(cx, body, Some(body.span), RetReplacement::Empty),
|
||||
FnKind::Fn(.., None) => {},
|
||||
}
|
||||
if_chain! {
|
||||
if let ast::FunctionRetTy::Ty(ref ty) = decl.output;
|
||||
if let ast::FunctionRetTy::Ty(ref ty) = kind.decl().output;
|
||||
if let ast::TyKind::Tup(ref vals) = ty.kind;
|
||||
if vals.is_empty() && !ty.span.from_expansion() && get_def(span) == get_def(ty.span);
|
||||
then {
|
||||
|
@ -380,18 +380,16 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OuterExpnDataPass {
|
||||
declare_lint_pass!(ProduceIce => [PRODUCE_ICE]);
|
||||
|
||||
impl EarlyLintPass for ProduceIce {
|
||||
fn check_fn(&mut self, _: &EarlyContext<'_>, fn_kind: FnKind<'_>, _: &ast::FnDecl, _: Span, _: ast::NodeId) {
|
||||
fn check_fn(&mut self, _: &EarlyContext<'_>, fn_kind: FnKind<'_>, _: Span, _: ast::NodeId) {
|
||||
if is_trigger_fn(fn_kind) {
|
||||
panic!("Testing the ICE message");
|
||||
panic!("Would you like some help with that?");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn is_trigger_fn(fn_kind: FnKind<'_>) -> bool {
|
||||
match fn_kind {
|
||||
FnKind::ItemFn(ident, ..) | FnKind::Method(ident, ..) => {
|
||||
ident.name.as_str() == "it_looks_like_you_are_trying_to_kill_clippy"
|
||||
},
|
||||
FnKind::Fn(_, ident, ..) => ident.name.as_str() == "it_looks_like_you_are_trying_to_kill_clippy",
|
||||
FnKind::Closure(..) => false,
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
thread 'rustc' panicked at 'Testing the ICE message', clippy_lints/src/utils/internal_lints.rs
|
||||
thread 'rustc' panicked at 'Would you like some help with that?', clippy_lints/src/utils/internal_lints.rs
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
|
||||
error: internal compiler error: unexpected panic
|
||||
|
Loading…
Reference in New Issue
Block a user