Skip to content

use Trait::{}; acts as use Trait; #61826

Open
@petrochenkov

Description

@petrochenkov
mod m {
    pub trait Tr {
        fn method(&self) {}
    }
    
    impl<T> Tr for T {}
}

use m::Tr::{};

fn main() {
    // Expected behavior: error, `Tr` is not in scope.
    // Actual behavior: not an error.
    0u8.method();
}

The regression was introduced in c57f0a7 (Rust 1.31).

Metadata

Metadata

Assignees

Labels

A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions