Skip to content

Rules governing references to private types in public APIs not enforced in impls #28325

Closed
@nikomatsakis

Description

@nikomatsakis

This code compiles, it should not:

mod x {
pub struct Foo { x: u32 }

struct Bar { x: u32 }

impl Foo {
    pub fn foo(&self, x: Self, y: Bar) { }
}
}

fn main() { }

cc @nrc

Metadata

Metadata

Assignees

Labels

P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions