Skip to content

Commit

Permalink
Resolve wildcard_imports pedantic clippy lint
Browse files Browse the repository at this point in the history
    error: usage of wildcard import
     --> tests/test_size.rs:5:5
      |
    5 | use syn::*;
      |     ^^^^^^ help: try: `syn::{Expr, Item, Lit, Pat, Type}`
      |
      = note: `-D clippy::wildcard-imports` implied by `-D clippy::pedantic`
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports

    error: usage of wildcard import
       --> tests/test_precedence.rs:350:9
        |
    350 |     use syn::fold::*;
        |         ^^^^^^^^^^^^ help: try: `syn::fold::{Fold, fold_expr, fold_generic_argument, fold_generic_method_argument}`
        |
        = note: `-D clippy::wildcard-imports` implied by `-D clippy::pedantic`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports

    error: usage of wildcard import
       --> tests/test_precedence.rs:351:9
        |
    351 |     use syn::*;
        |         ^^^^^^ help: try: `syn::{Expr, ExprParen, GenericArgument, GenericMethodArgument, Pat, Stmt, Type, token}`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports

    error: usage of wildcard import
       --> tests/test_precedence.rs:427:9
        |
    427 |     use syn::fold::*;
        |         ^^^^^^^^^^^^ help: try: `syn::fold::Fold`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports

    error: usage of wildcard import
       --> tests/test_precedence.rs:429:9
        |
    429 |     use syn::*;
        |         ^^^^^^ help: try: `syn::{Expr, ExprTuple, token}`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_imports
  • Loading branch information
dtolnay committed Sep 30, 2021
1 parent 4366423 commit 37b3aaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
11 changes: 5 additions & 6 deletions tests/test_precedence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
clippy::explicit_deref_methods,
clippy::if_then_panic,
clippy::match_wildcard_for_single_variants,
clippy::too_many_lines,
clippy::wildcard_imports
clippy::too_many_lines
)]

//! The tests in this module do the following:
Expand Down Expand Up @@ -347,8 +346,8 @@ fn librustc_brackets(mut librustc_expr: P<ast::Expr>) -> Option<P<ast::Expr>> {
/// reveal the precedence of the parsed expressions, and produce a stringified
/// form of the resulting expression.
fn syn_brackets(syn_expr: syn::Expr) -> syn::Expr {
use syn::fold::*;
use syn::*;
use syn::fold::{fold_expr, fold_generic_argument, fold_generic_method_argument, Fold};
use syn::{token, Expr, ExprParen, GenericArgument, GenericMethodArgument, Pat, Stmt, Type};

struct ParenthesizeEveryExpr;
impl Fold for ParenthesizeEveryExpr {
Expand Down Expand Up @@ -424,9 +423,9 @@ fn syn_brackets(syn_expr: syn::Expr) -> syn::Expr {

/// Walk through a crate collecting all expressions we can find in it.
fn collect_exprs(file: syn::File) -> Vec<syn::Expr> {
use syn::fold::*;
use syn::fold::Fold;
use syn::punctuated::Punctuated;
use syn::*;
use syn::{token, Expr, ExprTuple};

struct CollectExprs(Vec<Expr>);
impl Fold for CollectExprs {
Expand Down
3 changes: 1 addition & 2 deletions tests/test_size.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#![cfg(target_pointer_width = "64")]
#![allow(clippy::wildcard_imports)]

use std::mem;
use syn::*;
use syn::{Expr, Item, Lit, Pat, Type};

#[test]
fn test_expr_size() {
Expand Down

0 comments on commit 37b3aaa

Please sign in to comment.