]> git.lizzy.rs Git - rust.git/commit
lint: extend `#[must_use]` to handle a message.
authorHuon Wilson <dbau.pp+github@gmail.com>
Wed, 9 Jul 2014 12:02:19 +0000 (22:02 +1000)
committerHuon Wilson <dbau.pp+github@gmail.com>
Wed, 9 Jul 2014 22:05:58 +0000 (08:05 +1000)
commitb9e35a164416272a3aa3778c2ce9669dcc15c556
tree7fe2c5b5dc8d443faf22ad743bd45532088a093d
parent66e1f11ef482d90f2ea3bd284b07cd825315fadd
lint: extend `#[must_use]` to handle a message.

Similar to the stability attributes, a type annotated with `#[must_use =
"informative snippet"]` will print the normal warning message along with
"informative snippet". This allows the type author to provide some
guidance about why the type should be used.
src/librustc/lint/builtin.rs
src/test/compile-fail/unused-result.rs