Stream: t-compiler/wg-diagnostics

Topic: range literal error


varkor (May 01 2019 at 23:26, on Zulip):
fn main() {
    for _ in 0..256u8 {} // this is failing to warn about an overflowing literal
}

even though this err.emit() is being hit: https://github.com/rust-lang/rust/blob/9b67bd42b7cbf97f72d039afcba02f5177d0d68c/src/librustc_lint/types.rs#L102

varkor (May 01 2019 at 23:26, on Zulip):

what might cause err.emit() not to emit an error?

varkor (May 01 2019 at 23:27, on Zulip):

it seems to be related to the desugaring of the for loop

varkor (May 01 2019 at 23:27, on Zulip):

are errors that come from such spans silenced?

oli (May 02 2019 at 07:05, on Zulip):

we should never be silencing errors

oli (May 02 2019 at 07:05, on Zulip):

not sure what's going on

nagisa (May 02 2019 at 20:09, on Zulip):

Bisection is the easy way to find out.

varkor (May 02 2019 at 20:32, on Zulip):

@ehuss pointed out the likely problem: https://github.com/rust-lang/rust/issues/60459#issuecomment-488758202

varkor (May 02 2019 at 20:32, on Zulip):

errors are being cancelled when they come from expanded code

Esteban K├╝ber (May 22 2019 at 22:40, on Zulip):

That is less than ideal... We could change https://github.com/rust-lang/rust/blob/d15fc173818ccea6f8d97af13a30d454f9e4b35c/src/librustc/lint/mod.rs#L871 to be more discerning and consider for loop as false

Last update: Nov 15 2019 at 10:30UTC