Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jul 19, 2014

Implements RFC #168.

@huonw
Copy link
Contributor

huonw commented Jul 19, 2014

Cool!

Tests I would like to see:

  • use foo::mod; without the {} (should have a nice, custom error message, if it's an error)
  • checking that pub use correctly reexports the module.
  • foo::{mod} (i.e. nothing else in the import list)
  • what do use self::{mod} and use super::{mod} do? (at the very least, they shouldn't ICE...)

@ghost
Copy link
Author

ghost commented Jul 19, 2014

@huonw I added more tests and a nicer diagnostic for foo::mod.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make sure that something like this still doesn't work?

use foo::bar::{mod, Bar};

mod foo {
    mod bar { pub type Bar = int; }
}

fn main() {}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a great call.

use foo::bar::{mod};

should definitely fail to compile if bar is private. I added a test.

@alexcrichton
Copy link
Member

Awesome work @jakub-!

@ghost
Copy link
Author

ghost commented Jul 20, 2014

@alexcrichton Thanks for the review. I addressed your comments.

bors added a commit that referenced this pull request Jul 20, 2014
@bors bors closed this Jul 20, 2014
@bors bors merged commit 4b9bc2e into rust-lang:master Jul 20, 2014
@ghost ghost deleted the use-mod branch August 18, 2014 18:19
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

Successfully merging this pull request may close these issues.

3 participants