rust/src/librustc/middle
Alex Crichton 9896beb5b5 Implement an unused_result lint
I attempted to implement the lint in two steps. My first attempt was a
default-warn lint about *all* unused results. While this attempt did indeed find
many possible bugs, I felt that the false-positive rate was too high to be
turned on by default for all of Rust.

My second attempt was to make unused-result a default-allow lint, but allow
certain types to opt-in to the notion of "you must use this". For example, the
Result type is now flagged with #[must_use]. This lint about "must use" types is
warn by default (it's different from unused-result).

The unused_must_use lint had a 100% hit rate in the compiler, but there's not
that many places that return Result right now. I believe that this lint is a
crucial step towards moving away from conditions for I/O (because all I/O will
return Result by default). I'm worried that this lint is a little too specific
to Result itself, but I believe that the false positive rate for the
unused_result lint is too high to make it useful when turned on by default.
2014-01-28 15:54:47 -08:00
..
borrowck Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
cfg Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
trans auto merge of #11864 : comex/rust/11352, r=alexcrichton 2014-01-28 05:11:28 -08:00
typeck auto merge of #11846 : michaelwoerister/rust/cu_name, r=pcwalton 2014-01-27 14:46:56 -08:00
astencode.rs Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
check_const.rs auto merge of #11662 : alexcrichton/rust/faster-parens, r=huonw 2014-01-20 20:06:23 -08:00
check_loop.rs libsyntax: Renamed types, traits and enum variants to CamelCase. 2014-01-09 22:25:28 +02:00
check_match.rs Remove unnecessary parentheses. 2014-01-21 22:00:18 +11:00
const_eval.rs syntax: convert ast_map to use a SmallIntMap. 2014-01-19 12:56:26 +11:00
dataflow.rs Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
dead.rs [std::vec] Rename .pop_opt() to .pop(), drop the old .pop() behavior 2014-01-21 15:48:47 -08:00
effect.rs Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
entry.rs syntax: convert ast_map to use a SmallIntMap. 2014-01-19 12:56:26 +11:00
freevars.rs Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
graph.rs Uppercase numeric constants 2014-01-25 21:38:25 +13:00
kind.rs can borrow mut in proc Fixes #10617 2014-01-27 17:06:11 -08:00
lang_items.rs rustc: remove the explicit count from the lang_item macro. 2014-01-19 14:15:57 +11:00
lint.rs Implement an unused_result lint 2014-01-28 15:54:47 -08:00
liveness.rs Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
mem_categorization.rs Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
moves.rs Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
pat_util.rs Issue #3511 - Rationalize temporary lifetimes. 2014-01-15 18:34:38 -05:00
privacy.rs Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
reachable.rs Removed all instances of XXX in preparation for relaxing of FIXME rule 2014-01-26 14:42:53 -05:00
region.rs Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
resolve_lifetime.rs librustc: Remove @ pointer patterns from the language 2014-01-13 14:45:21 -08:00
resolve.rs Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
subst.rs librustc: Remove @ pointer patterns from the language 2014-01-13 14:45:21 -08:00
ty_fold.rs Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00
ty.rs Demote self to an (almost) regular argument and remove the env param. 2014-01-27 14:31:24 +02:00