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

unused qualifications #9

Merged
merged 3 commits into from
Jan 26, 2018
Merged

unused qualifications #9

merged 3 commits into from
Jan 26, 2018

Conversation

Pzixel
Copy link
Contributor

@Pzixel Pzixel commented Jan 26, 2018

This code won't work on 0.1.43:

#![deny(trivial_numeric_casts)]
#![deny(unused_qualifications)]
extern crate num;
#[macro_use]
extern crate num_derive;
use num::ToPrimitive;

#[derive(ToPrimitive)]
pub enum SomeEnum {
    A = 1
}

fn main() {
    println!("{}", SomeEnum::A.to_i64().unwrap())
}

This is an attempt to fix it

@cuviper
Copy link
Member

cuviper commented Jan 26, 2018

Wow, you're tough on your code -- that lint is default-allow!

The change is fine, but can you also exercise the "deny" in a test?

@Pzixel
Copy link
Contributor Author

Pzixel commented Jan 26, 2018

Ok, I'm going to add tests.

@cuviper
Copy link
Member

cuviper commented Jan 26, 2018

Great, thanks, and I've extended this for FromPrimitive too.

bors r+

bors bot added a commit that referenced this pull request Jan 26, 2018
9: unused qualifications r=cuviper a=Pzixel

This code won't work on 0.1.43:
```rust
#![deny(trivial_numeric_casts)]
#![deny(unused_qualifications)]
extern crate num;
#[macro_use]
extern crate num_derive;
use num::ToPrimitive;

#[derive(ToPrimitive)]
pub enum SomeEnum {
    A = 1
}

fn main() {
    println!("{}", SomeEnum::A.to_i64().unwrap())
}
```
This is an attempt to fix it
@bors
Copy link
Contributor

bors bot commented Jan 26, 2018

Build succeeded

@bors bors bot merged commit 13e8c1f into rust-num:master Jan 26, 2018
@cuviper
Copy link
Member

cuviper commented Jan 26, 2018

Published!

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.

2 participants