Skip to content

float support added for mistyped_literal_suffixes lint #3353

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

Merged
merged 15 commits into from
Nov 5, 2018

Conversation

Zaechus
Copy link
Contributor

@Zaechus Zaechus commented Oct 23, 2018

I implemented the mistyped_literal_suffixes lint for float literals.

#![allow(unused_variables)]

fn main() {
    let x = 1E2_32;
    let x = 75.22_64;
}

Given the above, the additional check suggests the variables to be written as let x = 1E2_f32 and let x = 75.22_f64.

Fixes #3167

@Zaechus
Copy link
Contributor Author

Zaechus commented Oct 23, 2018

Anything I need to modify?

@phansch phansch added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 27, 2018
@Zaechus Zaechus closed this Nov 1, 2018
@Zaechus Zaechus reopened this Nov 1, 2018
@Zaechus Zaechus closed this Nov 1, 2018
@Zaechus Zaechus reopened this Nov 1, 2018
@Zaechus Zaechus closed this Nov 2, 2018
@Zaechus Zaechus reopened this Nov 2, 2018
@Zaechus
Copy link
Contributor Author

Zaechus commented Nov 3, 2018

Any additional changes needed @mikerite ?

@ghost
Copy link

ghost commented Nov 4, 2018

Nope, looks good to me.

@ghost
Copy link

ghost commented Nov 4, 2018

bors r+

bors bot added a commit that referenced this pull request Nov 4, 2018
3353: float support added for mistyped_literal_suffixes lint r=mikerite a=Maxgy

I implemented the mistyped_literal_suffixes lint for float literals.

```
#![allow(unused_variables)]

fn main() {
    let x = 1E2_32;
    let x = 75.22_64;
}
```
Given the above, the additional check suggests the variables to be written as `let x = 1E2_f32` and `let x = 75.22_f64`.

Fixes #3167 

Co-authored-by: Maxwell Anderson <[email protected]>
@bors
Copy link
Contributor

bors bot commented Nov 4, 2018

Build failed

@ghost
Copy link

ghost commented Nov 4, 2018

Looks like a new lint is being triggered.
https://travis-ci.org/rust-lang-nursery/rust-clippy/jobs/450401580#L1105

@Zaechus
Copy link
Contributor Author

Zaechus commented Nov 4, 2018

Alright, I changed the two faulty occurrences of into_iter() to iter(), so I think it'll work now, @mikerite .

@ghost
Copy link

ghost commented Nov 5, 2018

bors r+

bors bot added a commit that referenced this pull request Nov 5, 2018
3353: float support added for mistyped_literal_suffixes lint r=mikerite a=Maxgy

I implemented the mistyped_literal_suffixes lint for float literals.

```
#![allow(unused_variables)]

fn main() {
    let x = 1E2_32;
    let x = 75.22_64;
}
```
Given the above, the additional check suggests the variables to be written as `let x = 1E2_f32` and `let x = 75.22_f64`.

Fixes #3167 

Co-authored-by: Maxwell Anderson <[email protected]>
@bors
Copy link
Contributor

bors bot commented Nov 5, 2018

@bors bors bot merged commit 3e0de17 into rust-lang:master Nov 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mistyped_literal_suffixes false negative
2 participants