Skip to content

overly aggressive ambiguity errors #26187

Closed
@paulp

Description

@paulp
% cat a.rs
use std::io::error::*;
use std::thread::*;

fn main() { }

% rustc a.rs
a.rs:2:5: 2:20 error: a type named `Result` has already been imported in this module [E0251]
a.rs:2 use std::thread::*;
           ^~~~~~~~~~~~~~~

Issuing an ambiguity error about a name which is never used does more than create needless busywork and break namespace encapsulation. It means you can never add anything to a module without breaking an unknown and unknowable amount of source code in the wild when you happen to choose the same name as did some other crate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions