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

Fix handling of parse errors when using include!(). #22054

Merged
merged 1 commit into from
Feb 8, 2015

Conversation

LeoTestard
Copy link
Contributor

Makes the compilation abort when a parse error is encountered while
trying to parse an item in an included file. The previous behaviour was
to stop processing the file when a token that can't start an item was
encountered, without producing any error. Fixes #21146.

@LeoTestard LeoTestard force-pushed the include-parse-errors branch 2 times, most recently from ded0ad0 to 2daf7ad Compare February 7, 2015 16:39
// include file for issue-21146.rs
// not supposed to be tested alone

parse_error
Copy link
Member

Choose a reason for hiding this comment

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

We have auxiliary directories (or something along those lines) for stuff like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't know that. Fixed, thanks.

Makes the compilation abort when a parse error is encountered while
trying to parse an item in an included file. The previous behaviour was
to stop processing the file when a token that can't start an item was
encountered, without producing any error. Fixes rust-lang#21146.
@LeoTestard LeoTestard force-pushed the include-parse-errors branch from 2daf7ad to 8f2ab66 Compare February 7, 2015 18:14
@alexcrichton
Copy link
Member

@bors: r+ 8f2ab66

Thanks!

@alexcrichton alexcrichton self-assigned this Feb 8, 2015
bors added a commit that referenced this pull request Feb 8, 2015
Makes the compilation abort when a parse error is encountered while
trying to parse an item in an included file. The previous behaviour was
to stop processing the file when a token that can't start an item was
encountered, without producing any error. Fixes #21146.
@bors
Copy link
Contributor

bors commented Feb 8, 2015

⌛ Testing commit 8f2ab66 with merge bfdcd34...

@Manishearth
Copy link
Member

Perhaps the test should be placed in the newly created parse-fail?

Or we can move it later as a rollup. Either works.

@bors bors merged commit 8f2ab66 into rust-lang:master Feb 8, 2015
@emberian
Copy link
Member

emberian commented Feb 8, 2015

Thank you so much <3

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.

include!'d source, when encountering a parse error, does not report-and-abort.
6 participants