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

'pub use' does something different than 'export', can't be used cross-crate sometimes #3489

Closed
graydon opened this issue Sep 13, 2012 · 6 comments
Milestone

Comments

@graydon
Copy link
Contributor

graydon commented Sep 13, 2012

The following minimal case can't be used from another crate:

use a::foo;
pub use foo;

mod a {
    type foo = int;
}

If I change the pub use to export it works. So something about the way the exports get written is different. This is blocking #2006.

@ghost ghost assigned pcwalton Sep 13, 2012
@nikomatsakis
Copy link
Contributor

I had always envisioned this being written pub use a::foo, and use foo (whether or not it is public) being a syntax error (using a single identifier does... nothing?). Does that work? It seems much clearer written that way.

@graydon
Copy link
Contributor Author

graydon commented Sep 18, 2012

No, same result.

@ghost ghost assigned catamorphism Sep 18, 2012
@graydon
Copy link
Contributor Author

graydon commented Sep 19, 2012

Note that this only happens cross-crate. Inside a single file everything's ok:

mod quux {

    use a::Foo;
    pub use Foo;

    mod a {
        type Foo = int;
    }
}

fn main() {
    let _x : quux::Foo = 10;
}

@catamorphism
Copy link
Contributor

This looked simple but is vexingly complicated. Adding pub use things as exports breaks random other exports elsewhere, because the whole pub qualifier was only half-finished anyway. I'm on PTO for the rest of the week, so not sure if I'll finish this.

@ghost ghost assigned graydon Sep 25, 2012
@catamorphism
Copy link
Contributor

Reassigning to @graydon since my understanding is that he mostly fixed it.

@graydon
Copy link
Contributor Author

graydon commented Sep 27, 2012

This is fixed now.

@graydon graydon closed this as completed Sep 27, 2012
@graydon graydon removed their assignment Jun 16, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 14, 2020
…atthiaskrgr

single_match_else - single expr/stmt else block corner case

One approach to fix rust-lang#3489.
See discussion in the issue.

changelog: single_match_else - single expr/stmt else block corner case fix
RalfJung pushed a commit to RalfJung/rust that referenced this issue Apr 20, 2024
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

4 participants