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

One more possibly bad import check #6633

Closed
steveklabnik opened this issue May 20, 2013 · 1 comment
Closed

One more possibly bad import check #6633

steveklabnik opened this issue May 20, 2013 · 1 comment

Comments

@steveklabnik
Copy link
Member

compile_and_link: x86_64-apple-darwin/stage2/lib/rustc/x86_64-apple-darwin/lib/librustc.dylib
/Users/steve/src/rust/src/librustc/driver/driver.rs:33:0: 33:17 warning: unused import [-W unused-imports (default)]
/Users/steve/src/rust/src/librustc/driver/driver.rs:33 use std::getopts;
                                                       ^~~~~~~~~~~~~~~~~

When removed:

Users/steve/src/rust/src/librustc/driver/driver.rs:528:39: 528:55 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:528                              matches: &getopts::Matches,
                                                                                               ^~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:528:39: 528:55 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:528                              matches: &getopts::Matches,
                                                                                               ^~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:528:39: 528:55 error: use of undeclared type name `getopts::Matches`
/Users/steve/src/rust/src/librustc/driver/driver.rs:528                              matches: &getopts::Matches,
                                                                                               ^~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:552:32: 552:49 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:552         let flags = vec::append(getopts::opt_strs(matches, level_short),
                                                                                        ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:552:32: 552:49 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:552         let flags = vec::append(getopts::opt_strs(matches, level_short),
                                                                                        ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:552:32: 552:49 error: unresolved name: `getopts::opt_strs`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:552         let flags = vec::append(getopts::opt_strs(matches, level_short),
                                                                                        ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:553:32: 553:49 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:553                                 getopts::opt_strs(matches, level_name));
                                                                                        ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:553:32: 553:49 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:553                                 getopts::opt_strs(matches, level_name));
                                                                                        ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:553:32: 553:49 error: unresolved name: `getopts::opt_strs`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:553                                 getopts::opt_strs(matches, level_name));
                                                                                        ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:569:22: 569:39 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:569     let debug_flags = getopts::opt_strs(matches, ~"Z");
                                                                              ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:569:22: 569:39 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:569     let debug_flags = getopts::opt_strs(matches, ~"Z");
                                                                              ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:569:22: 569:39 error: unresolved name: `getopts::opt_strs`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:569     let debug_flags = getopts::opt_strs(matches, ~"Z");
                                                                              ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:601:22: 601:44 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:601     let sysroot_opt = getopts::opt_maybe_str(matches, ~"sysroot");
                                                                              ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:601:22: 601:44 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:601     let sysroot_opt = getopts::opt_maybe_str(matches, ~"sysroot");
                                                                              ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:601:22: 601:44 error: unresolved name: `getopts::opt_maybe_str`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:601     let sysroot_opt = getopts::opt_maybe_str(matches, ~"sysroot");
                                                                              ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:603:21: 603:43 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:603     let target_opt = getopts::opt_maybe_str(matches, ~"target");
                                                                             ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:603:21: 603:43 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:603     let target_opt = getopts::opt_maybe_str(matches, ~"target");
                                                                             ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:603:21: 603:43 error: unresolved name: `getopts::opt_maybe_str`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:603     let target_opt = getopts::opt_maybe_str(matches, ~"target");
                                                                             ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:604:29: 604:51 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:604     let target_feature_opt = getopts::opt_maybe_str(matches, ~"target-feature");
                                                                                     ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:604:29: 604:51 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:604     let target_feature_opt = getopts::opt_maybe_str(matches, ~"target-feature");
                                                                                     ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:604:29: 604:51 error: unresolved name: `getopts::opt_maybe_str`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:604     let target_feature_opt = getopts::opt_maybe_str(matches, ~"target-feature");
                                                                                     ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:605:21: 605:41 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:605     let save_temps = getopts::opt_present(matches, ~"save-temps");
                                                                             ^~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:605:21: 605:41 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:605     let save_temps = getopts::opt_present(matches, ~"save-temps");
                                                                             ^~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:605:21: 605:41 error: unresolved name: `getopts::opt_present`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:605     let save_temps = getopts::opt_present(matches, ~"save-temps");
                                                                             ^~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:615:18: 615:34 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:615             match getopts::opt_str(matches, ~"opt-level") {
                                                                          ^~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:615:18: 615:34 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:615             match getopts::opt_str(matches, ~"opt-level") {
                                                                          ^~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:615:18: 615:34 error: unresolved name: `getopts::opt_str`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:615             match getopts::opt_str(matches, ~"opt-level") {
                                                                          ^~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:643:32: 643:49 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:643     let addl_lib_search_paths = getopts::opt_strs(matches, ~"L").map(|s| Path(*s));
                                                                                        ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:643:32: 643:49 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:643     let addl_lib_search_paths = getopts::opt_strs(matches, ~"L").map(|s| Path(*s));
                                                                                        ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:643:32: 643:49 error: unresolved name: `getopts::opt_strs`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:643     let addl_lib_search_paths = getopts::opt_strs(matches, ~"L").map(|s| Path(*s));
                                                                                        ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:644:17: 644:39 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:644     let linker = getopts::opt_maybe_str(matches, ~"linker");
                                                                         ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:644:17: 644:39 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:644     let linker = getopts::opt_maybe_str(matches, ~"linker");
                                                                         ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:644:17: 644:39 error: unresolved name: `getopts::opt_maybe_str`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:644     let linker = getopts::opt_maybe_str(matches, ~"linker");
                                                                         ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:645:22: 645:39 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:645     let linker_args = getopts::opt_strs(matches, ~"link-args").flat_map( |a| {
                                                                              ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:645:22: 645:39 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:645     let linker_args = getopts::opt_strs(matches, ~"link-args").flat_map( |a| {
                                                                              ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:645:22: 645:39 error: unresolved name: `getopts::opt_strs`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:645     let linker_args = getopts::opt_strs(matches, ~"link-args").flat_map( |a| {
                                                                              ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:653:29: 653:46 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:653     let cfg = parse_cfgspecs(getopts::opt_strs(matches, ~"cfg"), demitter);
                                                                                     ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:653:29: 653:46 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:653     let cfg = parse_cfgspecs(getopts::opt_strs(matches, ~"cfg"), demitter);
                                                                                     ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:653:29: 653:46 error: unresolved name: `getopts::opt_strs`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:653     let cfg = parse_cfgspecs(getopts::opt_strs(matches, ~"cfg"), demitter);
                                                                                     ^~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:655:29: 655:51 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:655     let android_cross_path = getopts::opt_maybe_str(
                                                                                     ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:655:29: 655:51 error: use of undeclared module `getopts`
/Users/steve/src/rust/src/librustc/driver/driver.rs:655     let android_cross_path = getopts::opt_maybe_str(
                                                                                     ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:655:29: 655:51 error: unresolved name: `getopts::opt_maybe_str`.
/Users/steve/src/rust/src/librustc/driver/driver.rs:655     let android_cross_path = getopts::opt_maybe_str(
                                                                                     ^~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:742:24: 742:49 error: unresolved name
/Users/steve/src/rust/src/librustc/driver/driver.rs:742 pub fn optgroups() -> ~[getopts::groups::OptGroup] {
                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:742:24: 742:49 error: use of undeclared module `getopts::groups`
/Users/steve/src/rust/src/librustc/driver/driver.rs:742 pub fn optgroups() -> ~[getopts::groups::OptGroup] {
                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/steve/src/rust/src/librustc/driver/driver.rs:742:24: 742:49 error: use of undeclared type name `getopts::groups::OptGroup`
/Users/steve/src/rust/src/librustc/driver/driver.rs:742 pub fn optgroups() -> ~[getopts::groups::OptGroup] {
                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 45 previous errors

After a snapshot is made, and this and #6630 are resolved, the build has no more warnings. 🤘

@alexcrichton
Copy link
Member

This is definitely a bug. Much smaller test than all of rustc (although still not tiny)

use foo::name::name; // should be unused
use foo::name;       // warning emits here instead

pub mod foo {
    pub mod name {
        pub type a = int;
        pub mod name {
            pub type a = float;
        }
    }
}

fn bar() -> name::a { 1 }

fn main(){}

bors added a commit that referenced this issue May 21, 2013
Resolves #6633 and removes an unnecessary import in libcore
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 11, 2021
Fix let_underscore_drop FP

changelog: Fix let_underscore_drop false positives and negatives

Fixes rust-lang#6633
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants