Skip to content

#[must_use] now suddenly warns in nightly #44213

Closed
@nox

Description

@nox
Contributor

Building Euclid on nightly now produces a gazillion of warnings that were not there before.

   Compiling euclid v0.15.1
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform2d.rs:164:5
    |
164 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform2d.rs:178:5
    |
178 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform2d.rs:194:5
    |
194 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform2d.rs:200:5
    |
200 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform2d.rs:216:5
    |
216 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform2d.rs:222:5
    |
222 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform2d.rs:244:5
    |
244 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform2d.rs:250:5
    |
250 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform2d.rs:257:5
    |
257 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform2d.rs:265:5
    |
265 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform2d.rs:274:5
    |
274 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform2d.rs:290:5
    |
290 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform3d.rs:373:5
    |
373 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform3d.rs:460:5
    |
460 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform3d.rs:466:5
    |
466 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform3d.rs:483:5
    |
483 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform3d.rs:494:5
    |
494 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform3d.rs:537:5
    |
537 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/transform3d.rs:543:5
    |
543 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/point.rs:236:5
    |
236 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/point.rs:248:5
    |
248 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/point.rs:260:5
    |
260 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/point.rs:547:5
    |
547 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/point.rs:558:5
    |
558 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/point.rs:569:5
    |
569 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/rect.rs:170:5
    |
170 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/rect.rs:195:5
    |
195 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/rect.rs:204:5
    |
204 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/rect.rs:225:5
    |
225 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/rect.rs:397:5
    |
397 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/rect.rs:406:5
    |
406 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/rect.rs:415:5
    |
415 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/vector.rs:269:5
    |
269 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/vector.rs:281:5
    |
281 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/vector.rs:293:5
    |
293 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/vector.rs:616:5
    |
616 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/vector.rs:627:5
    |
627 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable
warning: `#[must_use]` on methods is experimental (see issue #43302)
   --> /home/travis/build/servo/servo-with-rust-nightly/servo/.cargo/registry/src/6github.com-1ecc6299db9ec823/euclid-0.15.1/src/vector.rs:638:5
    |
638 |     #[must_use]
    |     ^^^^^^^^^^^
    |
    = help: add #![feature(fn_must_use)] to the crate attributes to enable

Cc @nical @SimonSapin

Activity

SimonSapin

SimonSapin commented on Aug 31, 2017

@SimonSapin
Contributor

This is #43776.

This warning shouldn’t become an error without a epoch/checkpoint since previous stable version accepted code that now warn.

Feature-gating with only a warning rather than an error is a bit pointless. I think #43776 should be reverted.

SimonSapin

SimonSapin commented on Aug 31, 2017

@SimonSapin
Contributor

Or at the very least, this should be made the kind of warning that doesn’t spam downstream users despite --cap-lints=allow.

kennytm

kennytm commented on Aug 31, 2017

@kennytm
Member

Both this and E0122 should repsect --cap-lints. There is nothing downstream can do with these warnings. But I disagree reverting #43776 entirely.

Did #43728 (#[must_use]) / #43776 (add feature gate) enter beta?

EDIT: Both did.

zackmdavis

zackmdavis commented on Aug 31, 2017

@zackmdavis
Member

Unfortunately, the "soft" feature-gate warning (which is just a .struct_span_warn) is not respecting --cap-lints=allow. I can look into this tomorrow (if no one else scoops it up today).

zackmdavis

zackmdavis commented on Sep 1, 2017

@zackmdavis
Member

Also unfortunately, it doesn't look like the feature-gate machinery already has access to the lint-cap setting. I'm having trouble deciding whether it's less terrible/hacky/inelegant/unæsthetic to add it as another argument to feature_gate::check_crate or as a field on ParseSess. 😞

kennytm

kennytm commented on Sep 1, 2017

@kennytm
Member

@zackmdavis Is it possible to switch off the can_emit_warnings field of errors::Handler when it is constructed? The driver should know the --cap-lints level while constructing the Handler.

added
A-diagnosticsArea: Messages for errors, warnings, and lints
C-bugCategory: This is a bug.
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Sep 1, 2017
added a commit that references this issue on Sep 13, 2017

Auto merge of #225 - zackmdavis:conditional_fn_must_use, r=nox

added a commit that references this issue on Sep 16, 2017
d02ceac
zackmdavis

zackmdavis commented on Sep 16, 2017

@zackmdavis
Member

Is it possible to switch off the can_emit_warnings field of errors::Handler when it is constructed?

Yes.

added a commit that references this issue on Sep 21, 2017

Auto merge of #44627 - zackmdavis:the_capgate_perogative, r=nrc

35edf7d
added a commit that references this issue on Sep 28, 2017
957846c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @kennytm@nox@shepmaster@SimonSapin@zackmdavis

        Issue actions

          #[must_use] now suddenly warns in nightly · Issue #44213 · rust-lang/rust