-
Notifications
You must be signed in to change notification settings - Fork 13k
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 float ICE #90927
Fix float ICE #90927
Conversation
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
Should i create a sub-directory for my test, because the CI errors because there are 1001 files in the parser test directory but only 1000 files are allowed in a single directory? |
@estebank what do you think is the best solution? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with moving the test to src/ext/test-float-parse
. After all, it is testing the parser.
error: expected at least one digit in exponent | ||
--> $DIR/issue-90728.rs:2:7 | ||
| | ||
LL | a.5.2E+ | ||
| ^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error in particular could likely be more actionable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you be a bit more precise about that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean using a span_suggestion_verbose
(and SourceMap::next_point(Span)
) to produce something like the following (just a rough draft, doesn't have to look like this exactly):
error: expected at least one digit in exponent
--> $DIR/issue-90728.rs:2:7
|
LL | a.5.2E+
| -----^ expected a number here
| |
| this numeric literal is incomplete
help: write a valid exponent
|
LL | a.5.2E+1
| +
This is similar to what we do on missing `;` or `,` in statements or between `fn` args.
error: unexpected token: `5.2E+` | ||
--> $DIR/issue-90728.rs:2:7 | ||
| | ||
LL | a.5.2E+ | ||
| ^^^^^ | ||
|
||
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `5.2E+` | ||
--> $DIR/issue-90728.rs:2:7 | ||
| | ||
LL | a.5.2E+ | ||
| ^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we could recover more gracefully after encountering it ^_^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean like spitting out no errors afterwards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, but that doesn't have to be addressed in this PR.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Looks like it's caused by tidy checking that file with stage0. Probably the easiest thing to do is to do a tidy ignore with a FIXME to remove it after bootstrap is updated. |
Okay, how would I do that? |
I think maybe |
The test appears to be in src/etc which is why tidy complained - src/test is not fmt checked currently. I'm not sure we run tests in src/etc at all, so maybe it was accidentally moved into that directory? Or, if not, the appropriate fix is to adjust rustfmt.toml at the root and ignore the right directory for this test. |
there was |
This comment has been minimized.
This comment has been minimized.
How was src/etc/test-float-parse/src/bin/issue-90728.stderr generated? As far as I can tell, CI does not run test-float-parse tests... It seems like this test probably belongs under the UI test directory (src/test/ui). |
I did put it into src/test/ui/parser/ but it errored because there were already 1000 tests inside the directory which is why i had to move it in the first place |
Okay, let's just move this as a test case in |
But my test is supposed to fail while the float literals stuff is supposed to compile. Also i will squash my commits once this test issue is resolved. |
Okay...so new plan. Let's make an |
You can just make an exception in tidy (or bump the limit) -- that'll temporarily resolve the problem to let this PR proceed.
|
Yeah, I guess a tidy exception is fine. |
Where can I bump that limit? and should i bump it to 1001 or to something else? |
That would be rust/src/tools/tidy/src/ui_tests.rs Line 26 in b6f580a
|
You would have to make a new one. And probably just use 1001 as a limit. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I had to pull the changes from master because there were some changes made to the test limits and now if i try to build the compiler i get the following ICE: https://pastebin.com/VpX3QZZC @jackh726 |
Maybe try to We weren't shouldn't be increasing the test limit - the fact that we've hit it means that we're already past the point of the directory being "unwieldy". A proper solution would be either moving tests into subdirectories (like issues, but others maybe) or to combine related tests (this can be tricky and there hasn't really been a push for this). Another thing to think about (not for this PR), would be to have tidy issue a warning at some lower threshold than the 1000 for errors. In theory, the noise might prompt a contributor to organize tests a bit. |
02ebda8
to
aa88fbd
Compare
This comment has been minimized.
This comment has been minimized.
aa88fbd
to
7909efd
Compare
Co-authored-by: Esteban Kuber <[email protected]>
a678e54
to
5f6059d
Compare
@jackh726 i think this should be ready to be merged. |
Its helpful that PRs prior to this had to handle the parser test limit 🤣 @bors r+ rollup |
📌 Commit 5f6059d has been approved by |
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#89741 (Mark `Arc::from_inner` / `Rc::from_inner` as unsafe) - rust-lang#90927 (Fix float ICE) - rust-lang#90994 (Fix ICE `rust-lang#90993`: add missing call to cancel) - rust-lang#91018 (Adopt let_else in more places in rustc_mir_build) - rust-lang#91022 (Suggest `await` in more situations where infer types are involved) - rust-lang#91088 (Revert "require full validity when determining the discriminant of a value") Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This fixes #90728