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

[nightly] unnecessary parentheses warning #668

Closed
SWW13 opened this issue Jan 24, 2018 · 2 comments
Closed

[nightly] unnecessary parentheses warning #668

SWW13 opened this issue Jan 24, 2018 · 2 comments
Milestone

Comments

@SWW13
Copy link

SWW13 commented Jan 24, 2018

Recent nightly versions give warnings when using named!() and do_parse!():

named!(pub parse_string <String>, do_parse!(
    value: map_res!(take_until!("\x00"), |value: &[u8]| String::from_utf8(value.to_vec())) >>
    tag!(b"\x00") >>
    (value)
));
warning: unnecessary parentheses around function argument
   |
13 | / named!(pub parse_string <String>, do_parse!(
14 | |     value: map_res!(take_until!("\x00"), |value: &[u8]| String::from_utf8(value.to_vec())) >>
15 | |     tag!(b"\x00") >>
16 | |     (value)
17 | | ));
   | |___^ help: remove these parentheses
   |
   = note: #[warn(unused_parens)] on by default
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

rustc --version --verbose:

rustc 1.25.0-nightly (4e3901d35 2018-01-23)
binary: rustc
commit-hash: 4e3901d35f6a8652f67111e7272263c9e62ab3e1
commit-date: 2018-01-23
host: x86_64-unknown-linux-gnu
release: 1.25.0-nightly
LLVM version: 4.0
@Geal
Copy link
Collaborator

Geal commented Feb 3, 2018

Hi!

apparently, this is fixed in recent rust nightlies, but just in case, I removed the warning case in 98eb710

@Geal Geal added this to the 4.0 milestone Feb 3, 2018
@Geal Geal closed this as completed Feb 3, 2018
@kamarkiewicz
Copy link
Contributor

kamarkiewicz commented Feb 4, 2018

I'm still encountering these warnings using nom from current master (dd33867)
Tested on rustc 1.25.0-nightly (3d292b793 2018-02-03)
Examples: https://travis-ci.org/kamarkiewicz/parsip/jobs/337208273#L837

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

No branches or pull requests

3 participants