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

rustc: rename multiple imports in a list #27451

Merged
merged 1 commit into from Aug 10, 2015

Conversation

Projects
None yet
6 participants
@seanmonstar
Copy link
Contributor

seanmonstar commented Aug 1, 2015

An implementation of RFC 1219.

The RFC is not merged yet, but once merged, this could be.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Aug 1, 2015

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@@ -2430,11 +2430,11 @@ pub struct ViewListIdent {
impl Clean<ViewListIdent> for ast::PathListItem {
fn clean(&self, cx: &DocContext) -> ViewListIdent {
match self.node {
ast::PathListIdent { id, name } => ViewListIdent {
ast::PathListIdent { id, name, .. } => ViewListIdent {

This comment has been minimized.

@alexcrichton

alexcrichton Aug 3, 2015

Member

I think these cases need to be handled to show reexports correctly, this will probably need to update the ViewListIdent structures here, and can you be sure to add a rustdoc test for this?

This comment has been minimized.

@seanmonstar

seanmonstar Aug 3, 2015

Author Contributor

OH, I misunderstood what this code did. Re-exports, of course.

@@ -1656,14 +1656,14 @@ pub type Variant = Spanned<Variant_>;

#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
pub enum PathListItem_ {
PathListIdent { name: Ident, id: NodeId },
PathListMod { id: NodeId }
PathListIdent { name: Ident, rename: Option<Ident>, id: NodeId },

This comment has been minimized.

@alexcrichton

alexcrichton Aug 3, 2015

Member

Can you add some comments explaining what this rename field is for?

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Aug 3, 2015

Can you be sure to add some more exhaustive tests for this? It looks like this only includes "this will parse" tests rather than "this will resolve" tests along with tests for things like error messages (e.g. an item doesn't exist in a module).

@seanmonstar

This comment has been minimized.

Copy link
Contributor Author

seanmonstar commented Aug 3, 2015

Ah, you're right, that test doesn't test it resolved the correct item.

tests for things like error messages (e.g. an item doesn't exist in a module).

@alexcrichton I assumed those tests already exist as normal importing tests.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Aug 3, 2015

They probably do exist, but new ones should be added for this new feature. This should be as exhaustively tested as possible, basically, because although the implementation may be simple today a later refactoring will benefit from an exhaustive set of tests.

@seanmonstar seanmonstar force-pushed the seanmonstar:use-groups-as branch 6 times, most recently from 670aaf6 to e042365 Aug 3, 2015

@seanmonstar

This comment has been minimized.

Copy link
Contributor Author

seanmonstar commented Aug 6, 2015

@alexcrichton i've fixed up rustdoc and some error tests. some other specific tests you have in mind? I

@Manishearth

This comment has been minimized.

Copy link
Member

Manishearth commented Aug 6, 2015

This needs a visit_ident() in libsyntax/visit.rs

@Manishearth

This comment has been minimized.

Copy link
Member

Manishearth commented Aug 6, 2015

parser-lalr.y probably needs changing to pass tests too

@seanmonstar

This comment has been minimized.

Copy link
Contributor Author

seanmonstar commented Aug 7, 2015

@Manishearth a change in walk_item? I don't know the use of that function well; should you visit both the name and rename (if let Some(ident) = rename), or only name is rename is None?

In other words, use std::io::{Error as IoError, Read} would visit Error, IoError, and then Read?

@Manishearth

This comment has been minimized.

Copy link
Member

Manishearth commented Aug 7, 2015

Visit both. visit.rs is for AST visiting, so anything in the AST should get visited

@seanmonstar seanmonstar force-pushed the seanmonstar:use-groups-as branch from e042365 to 47d963f Aug 8, 2015

@seanmonstar

This comment has been minimized.

Copy link
Contributor Author

seanmonstar commented Aug 8, 2015

@Manishearth like so?

@Manishearth

This comment has been minimized.

Copy link
Member

Manishearth commented Aug 8, 2015

Yep!

@seanmonstar seanmonstar force-pushed the seanmonstar:use-groups-as branch from 47d963f to cfcd449 Aug 8, 2015

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Aug 10, 2015

All looks good to me, thanks @seanmonstar!

@bors: r+ cfcd449

bors added a commit that referenced this pull request Aug 10, 2015

Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichton
An implementation of [RFC 1219](rust-lang/rfcs#1219).

The RFC is not merged yet, but once merged, this could be.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Aug 10, 2015

⌛️ Testing commit cfcd449 with merge 8856927...

@bors bors merged commit cfcd449 into rust-lang:master Aug 10, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

bors added a commit that referenced this pull request Sep 15, 2015

@bluss bluss added the relnotes label Sep 15, 2015

@matklad matklad referenced this pull request Oct 29, 2015

Closed

Provide tests for Rust 1.4 #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.