Skip to content

Add tests for expect ident but find enum or struct panic#22720

Merged
bors merged 1 commit into
rust-lang:masterfrom
edwardw:enum-struct-ident-walk-into-a-bar
Feb 24, 2015
Merged

Add tests for expect ident but find enum or struct panic#22720
bors merged 1 commit into
rust-lang:masterfrom
edwardw:enum-struct-ident-walk-into-a-bar

Conversation

@edwardw

@edwardw edwardw commented Feb 23, 2015

Copy link
Copy Markdown
Contributor

Closes #22589
Closes #22647
Closes #22665
Closes #22712

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @nick29581

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

@edwardw edwardw changed the title syntax: do not panic if find enum or struct but find ident syntax: do not panic if expect ident but find enum or struct Feb 23, 2015
Comment thread src/libsyntax/parse/parser.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit s/duo/due

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@nrc

nrc commented Feb 23, 2015

Copy link
Copy Markdown
Member

r+ with the typo fixed.

@edwardw edwardw force-pushed the enum-struct-ident-walk-into-a-bar branch from 4ce608b to 2931c21 Compare February 23, 2015 20:52
@nrc

nrc commented Feb 23, 2015

Copy link
Copy Markdown
Member

@bors r+ 2931c21

@Manishearth

Copy link
Copy Markdown
Member

When running check-stage1 on this I get the following error:

/opt/rust/src/test/parse-fail/issue-22426.rs:18:16: 18:17 error: unexpected token: `<`
/opt/rust/src/test/parse-fail/issue-22426.rs:18             Foo<T>(ref x, ref y) => {}  //~ ERROR expected identifier, found enum or struct
                                                               ^

Should I expect this to only work for check-stage2?

@edwardw

edwardw commented Feb 24, 2015

Copy link
Copy Markdown
Contributor Author

This is weird. This test in my local make check-stage1-pfail runs fine.

@Manishearth

Copy link
Copy Markdown
Member

@bors: r-

I figured it out, #22544 broke your PR. Please rebase onto master and ask me for an r+ again (I'll try to include it into the rollup if there's time). Thanks!

@bors

bors commented Feb 24, 2015

Copy link
Copy Markdown
Collaborator

🙀 again is not a valid commit SHA. Please try again with 2931c21.

@bors

bors commented Feb 24, 2015

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 2931c21 with merge 1f28313...

bors added a commit that referenced this pull request Feb 24, 2015
@Manishearth

Copy link
Copy Markdown
Member

@bors: r-

@Manishearth

Copy link
Copy Markdown
Member

dammit bors

@edwardw

edwardw commented Feb 24, 2015

Copy link
Copy Markdown
Contributor Author

I'm looking into it right now, could be some in between commits caused behavior change of the parser. And building LLVM, it will take a while.

@Manishearth

Copy link
Copy Markdown
Member

@edwardw No need to look for it, the change that broke this PR was #22544 :)

@edwardw

edwardw commented Feb 24, 2015

Copy link
Copy Markdown
Contributor Author

@Manishearth yeah, but I still need to verify it locally first. Besides I have the feeling that my patch will reduce to just bunch of tests 🚴

@edwardw edwardw force-pushed the enum-struct-ident-walk-into-a-bar branch from 2931c21 to a1396d2 Compare February 24, 2015 07:00
@edwardw

edwardw commented Feb 24, 2015

Copy link
Copy Markdown
Contributor Author

It is merely tests now.

r? @Manishearth

@edwardw edwardw changed the title syntax: do not panic if expect ident but find enum or struct Add tests for expect ident but find enum or struct panic Feb 24, 2015
@Manishearth

Copy link
Copy Markdown
Member

@bors r=nick29581 rollup

@bors

bors commented Feb 24, 2015

Copy link
Copy Markdown
Collaborator

🙀 rollup is not a valid commit SHA. Please try again with a1396d2.

@Manishearth

Copy link
Copy Markdown
Member

@bors r=nick29581 a1396d2 rollup

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 24, 2015
@bors bors merged commit a1396d2 into rust-lang:master Feb 24, 2015
@l0kod

l0kod commented Feb 25, 2015

Copy link
Copy Markdown
Contributor

Not sure it's exactly the same, but crash Rust nightly from play.rust-lang.org as well:

use std::rc::Rc;

fn main() {
    match Rc::new(1) {
        Rc<_> => {}
    }
}

@edwardw

edwardw commented Feb 25, 2015

Copy link
Copy Markdown
Contributor Author

@l0kod, playpen must've been a little bit lagged behind. Just run your code locally and rustc correctly bailed itself out:

use std::rc::Rc;

fn main() {
    match Rc::new(1) {
        Rc<_> => {}  // error: unexpected token: `<`
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

6 participants