Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded prelude imports in libcore tests #66894

Merged
merged 1 commit into from
Dec 1, 2019

Commits on Nov 30, 2019

  1. Remove unneeded prelude imports in libcore tests

    These three lines are from c82da7a in
    2015.
    
    They cause problems when applying rustfmt to the codebase, because
    reordering wildcard imports can trigger new unused import warnings.
    
    As a minimized example, the following program compiles successfully:
    
        #![deny(unused_imports)]
    
        use std::fmt::Debug;
        use std::marker::Send;
    
        pub mod repro {
            use std::prelude::v1::*;
            use super::*;
    
            pub type D = dyn Debug;
            pub type S = dyn Send;
        }
    
        pub type S = dyn Send;
    
    but putting it through rustfmt produces a program that fails to compile:
    
        #![deny(unused_imports)]
    
        use std::fmt::Debug;
        use std::marker::Send;
    
        pub mod repro {
            use super::*;
            use std::prelude::v1::*;
    
            pub type D = dyn Debug;
            pub type S = dyn Send;
        }
    
        pub type S = dyn Send;
    
    The error is:
    
        error: unused import: `std::prelude::v1::*`
         --> src/main.rs:8:9
          |
        8 |     use std::prelude::v1::*;
          |         ^^^^^^^^^^^^^^^^^^^
    dtolnay committed Nov 30, 2019
    Configuration menu
    Copy the full SHA
    f34990e View commit details
    Browse the repository at this point in the history