Only count nested returns when the outer return is reachable

This narrows the definition of nested returns such that only when the
outer return has a chance of being executed (due to the inner return
being conditional) do we mark the function as having nested returns.

Fixes #19684
This commit is contained in:
James Miller 2014-12-16 12:21:08 +13:00
parent 22a9f250b5
commit eee209d9e2
5 changed files with 99 additions and 44 deletions

View file

@ -472,7 +472,7 @@ pub fn list_metadata(sess: &Session, path: &Path,
/// The diagnostic emitter yielded to the procedure should be used for reporting
/// errors of the compiler.
pub fn monitor<F:FnOnce()+Send>(f: F) {
static STACK_SIZE: uint = 32000000; // 32MB
static STACK_SIZE: uint = 8 * 1024 * 1024; // 8MB
let (tx, rx) = channel();
let w = io::ChanWriter::new(tx);