| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
WalkthroughAdded a Dependabot ignore rule for Cargo deps matching ruff_*; bumped lexical-parse-float from 1.0.4 to 1.0.6 in compiler/literal/Cargo.toml; replaced a guarded build() call with build_unchecked() when constructing the lexical number format in compiler/literal/src/float.rs. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller as parse_inner caller
participant Builder as NumberFormatBuilder
participant Parser as lexical parse routine
Note over Caller,Builder: Before
Caller->>Builder: build() (validates)
Builder-->>Caller: Result<Format, Error> (may Err)
alt valid
Caller->>Parser: parse_with_format(format)
Parser-->>Caller: Result<f64, ParseError>
else invalid
Builder-->>Caller: Error
end
Note over Caller,Builder: After (changed)
Caller->>Builder: build_unchecked() (no validation)
Builder-->>Caller: Format (assumed valid)
Caller->>Parser: parse_with_format(format)
Parser-->>Caller: Result<f64, ParseError or UB-like behavior if format invalid)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1).github/dependabot.yml (1)📜 Review details9-10: Fix typo in comment.
Please correct “dealling” → “dealing” to keep the comment polished.
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📥 CommitsReviewing files that changed from the base of the PR and between 3a6fda4 and e26f313.
⛔ Files ignored due to path filters (1)
Sorry, something went wrong.
| const PYTHON_STRING: u128 = NumberFormatBuilder::rebuild(PYTHON3_LITERAL) | ||
| .no_special(false) | ||
| .build(); | ||
| .build_unchecked(); |
There was a problem hiding this comment.
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review detailsConfiguration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📥 CommitsReviewing files that changed from the base of the PR and between e26f313 and a8c36ad.
📒 Files selected for processing (3)📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.rs: Format Rust code with the default rustfmt style (run cargo fmt)
Run clippy and fix any warnings or lints introduced by your changes
Follow Rust best practices for error handling and memory management
Files:
Sorry, something went wrong.
| hexf-parse = "0.2.1" | ||
| is-macro.workspace = true | ||
| lexical-parse-float = { version = "1.0.4", features = ["format"] } | ||
| lexical-parse-float = { version = "1.0.6", features = ["format"] } |
There was a problem hiding this comment.
⚠️ Potential issue | 🔴 Critical
🧩 Analysis chainVerify the dependency version and check for security advisories.
Ensure that version 1.0.6 of lexical-parse-float exists and is free from known vulnerabilities.
🏁 Script executed:
#!/bin/bash
# Check for security advisories for lexical-parse-float
gh api graphql -f query='
{
securityVulnerabilities(first: 5, ecosystem: CARGO, package: "lexical-parse-float") {
nodes {
advisory {
summary
severity
publishedAt
}
vulnerableVersionRange
firstPatchedVersion {
identifier
}
}
}
}'Length of output: 477
🌐 Web query:
What is the latest version of lexical-parse-float crate on crates.io?
💡 Result:
The latest version is 1.0.5 (published Jan 10, 2025). [1][2]
Sources:
Use the published crate version (v1.0.5)
In compiler/literal/Cargo.toml (line 16), change
lexical-parse-float = { version = "1.0.6", features = ["format"] }to
lexical-parse-float = { version = "1.0.5", features = ["format"] }(1.0.6 is not published on crates.io)
🤖 Prompt for AI AgentsIn compiler/literal/Cargo.toml around line 16, the dependency specifies lexical-parse-float version "1.0.6" which is not published; change the version to "1.0.5" while keeping the features = ["format"] entry unchanged so the crate resolves from crates.io.
Sorry, something went wrong.
| const PYTHON_STRING: u128 = NumberFormatBuilder::rebuild(PYTHON3_LITERAL) | ||
| .no_special(false) | ||
| .build(); | ||
| .build_unchecked(); |
There was a problem hiding this comment.
⚠️ Potential issue | 🔴 Critical
🧩 Analysis chainJustify the use of build_unchecked() and verify it's necessary.
The change from build() to build_unchecked() removes runtime validation of the format configuration. While this is likely safe since the format is based on the predefined PYTHON3_LITERAL with a minor modification, this needs justification.
Possible reasons for this change:
Please verify:
Consider adding a comment explaining why build_unchecked() is safe here, unless this is already documented elsewhere.
🏁 Script executed:
#!/bin/bash
# Check if build() method exists and is const-compatible in lexical-parse-float 1.0.6
# Search for NumberFormatBuilder documentation or usage examples
rg -n -C3 'NumberFormatBuilder.*build\(' --type rustLength of output: 512
🌐 Web query:
Does lexical-parse-float 1.0.6 support const build() method on NumberFormatBuilder, or does it require build_unchecked() for const contexts?
💡 Result:
You can use the const build() method — NumberFormatBuilder::build is a const fn, so you do not need build_unchecked() for const contexts. [1][2]
Sources:
Replace build_unchecked() with build()
File: compiler/literal/src/float.rs:21
NumberFormatBuilder::build() is a const fn and performs validation; using build_unchecked() bypasses these checks unnecessarily. Update to .build().
In compiler/literal/src/float.rs around lines 19 to 21, the NumberFormatBuilder call uses .build_unchecked() which bypasses validation; replace that call with .build() since NumberFormatBuilder::build() is a const fn that performs the necessary checks. Update the chained call to call .build() instead of .build_unchecked(), keeping the same surrounding code and ensuring the constant assignment remains valid.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Explained in .github/dependabot.yml the motivation for this.
Closes #6183
Closes #6184
Summary by CodeRabbit