Stream: general

Topic: #55516 why doesn't `write!` report unused Result anymore


Jake Goulding (Oct 30 2018 at 20:13, on Zulip):
fn main() {
    use std::fmt::Write;
    let mut example = String::new();
    write!(&mut example, "{}", 42);
}

This compiles with no warnings.

pnkfelix (Oct 30 2018 at 20:22, on Zulip):

hmm I wonder if that's related to what I observed in #54288

Jake Goulding (Oct 30 2018 at 20:24, on Zulip):

@pnkfelix tbh, I'm mildly freaking out cause... flagging unused Results feels like A Big Thing.

pnkfelix (Oct 30 2018 at 20:24, on Zulip):

yep

pnkfelix (Oct 30 2018 at 20:25, on Zulip):

manually expanding it works ...

pnkfelix (Oct 30 2018 at 20:26, on Zulip):

i.e. this:

fn main() {
    use std::fmt::Write;
    let mut example = String::new();
    (&mut example).write_fmt(format_args!("{}", 42));
}

flags the unused must use lint

Jake Goulding (Oct 30 2018 at 20:26, on Zulip):

And it's not all Results, so the whole universe isn't falling.

pnkfelix (Oct 30 2018 at 20:26, on Zulip):

and the macro itself is pretty trivial

pnkfelix (Oct 30 2018 at 20:26, on Zulip):

which means I suppose its something with macro expansion, mrrrrh

pnkfelix (Oct 30 2018 at 20:27, on Zulip):

well I'll file a ticket in any case. :)

Jake Goulding (Oct 30 2018 at 20:28, on Zulip):

I got it ;-)

Jake Goulding (Oct 30 2018 at 20:28, on Zulip):

I'm doing a quick release bisection to see when it occurred

Jake Goulding (Oct 30 2018 at 20:28, on Zulip):

@pnkfelix ^

pnkfelix (Oct 30 2018 at 20:30, on Zulip):

filed as #55516

pnkfelix (Oct 30 2018 at 20:31, on Zulip):

ugh so many typos!

Last update: Nov 22 2019 at 00:55UTC