Tracking issue for core::hint::must_use · Issue #94745 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@dtolnay

Description

@dtolnay

Feature gate: #![feature(hint_must_use)]

This is a tracking issue for the function core::hint::must_use

Public API

// core::hint

#[must_use] pub const fn must_use(value: T) -> T { value }

Steps / History

Unresolved Questions

#[must_use]
{
some_expr
}
This feels more native, and might behave slightly better in some subtle edge cases—type inference may not always 'see through' the identity function in terms of whether unsize coercions occur before or after the call, whereas through a block that isn't an issue.
Blocked on Tracking issue for stmt_expr_attributes: Add attributes to expressions, etc. #15701.