Skip to content

Add #[warn_unused_result] attribute for functions #2965

Description

@bblum

Just like __attribute__((warn_unused_result)) in C.

One thing this would be really useful for is to help people distinguish functional-style vs in-place-style data structure update functions. I could have saved some time during ICFP (#2928) 'cause I was using vec::append as though it were vec::push_all.

Marking this I-completion because I care a lot about it. Feel free to debate its importance.

Activity

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-attributesArea: Attributes (`#[…]`, `#![…]`)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions