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

stabilize #[must_use] for functions and must-use comparison operators (RFC 1940) #48925

Merged
merged 2 commits into from
May 1, 2018

Commits on Apr 29, 2018

  1. in which the fn-must-use codepath is prevented from panicking on closure

    The must-use lint needs the DefId of called functions and method
    receivers in order to look for a `#[must_use]` attribute, but this would
    ICE (!) if a called function was actually a closure (with a non-unit
    return value). Instead, let's be specific that we want a `Def::Fn`,
    rather than blithely assuming that we can get the DefId of a qpath.
    
    Supporting must-use closures doesn't seem like a priority, but could
    conceivably be added in the future if desired (conditional on the
    statement and expression attributes (rust-lang#15701) story being amicable).
    zackmdavis committed Apr 29, 2018
    Configuration menu
    Copy the full SHA
    c659fab View commit details
    Browse the repository at this point in the history
  2. stabilize #[must_use] for functions and must-use operators

    This is in the matter of RFC 1940 and tracking issue rust-lang#43302.
    zackmdavis committed Apr 29, 2018
    Configuration menu
    Copy the full SHA
    3dbdccc View commit details
    Browse the repository at this point in the history