Use LitKind::Err for malformed floats#121724
Merged
bors merged 3 commits intorust-lang:masterfrom Feb 29, 2024
Merged
Conversation
Contributor
Author
|
Best reviewed one commit at at time. |
This comment has been minimized.
This comment has been minimized.
fmease
approved these changes
Feb 28, 2024
Member
fmease
left a comment
There was a problem hiding this comment.
r=me with failing test blessed
This prevents a follow-up type error in a test, which seems fine.
- Put every literal in its own braces, rather than just some of them, for maximal error recovery. - Add a blank line between every case, for readability.
This slightly changes error messages in `float-field.rs`, but nothing of real importance.
7772605 to
840c8d3
Compare
Collaborator
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
Contributor
Author
|
I fixed the clippy test. I think the change kind of neuters it, because the path to the crash that was happening is no longer possible. But I don't think that matters much. @bors r=fmease |
Member
|
Bors? @bors r+ |
Member
|
@bors r+ |
Collaborator
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Feb 28, 2024
…, r=fmease Use `LitKind::Err` for malformed floats rust-lang#121120 changed `StringReader::cook_lexer_literal` to return `LitKind::Err` for malformed integer literals. This commit does the same for float literals, for consistency. r? `@fmease`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 29, 2024
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#110543 (Make `ReentrantLock` public) - rust-lang#121689 ([rustdoc] Prevent inclusion of whitespace character after macro_rules ident) - rust-lang#121724 (Use `LitKind::Err` for malformed floats) - rust-lang#121735 (pattern analysis: Don't panic when encountering unexpected constructor) - rust-lang#121743 (Opportunistically resolve regions when processing region outlives obligations) Failed merges: - rust-lang#121326 (Detect empty leading where clauses on type aliases) - rust-lang#121416 (Improve error messages for generics with default parameters) - rust-lang#121669 (Count stashed errors again) - rust-lang#121723 (Two diagnostic things) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 29, 2024
Rollup merge of rust-lang#121724 - nnethercote:LitKind-Err-for-floats, r=fmease Use `LitKind::Err` for malformed floats rust-lang#121120 changed `StringReader::cook_lexer_literal` to return `LitKind::Err` for malformed integer literals. This commit does the same for float literals, for consistency. r? ``@fmease``
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Mar 7, 2024
…, r=fmease Use `LitKind::Err` for malformed floats rust-lang#121120 changed `StringReader::cook_lexer_literal` to return `LitKind::Err` for malformed integer literals. This commit does the same for float literals, for consistency. r? ``@fmease``
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#121120 changed
StringReader::cook_lexer_literalto returnLitKind::Errfor malformed integer literals. This commit does the same for float literals, for consistency.r? @fmease