rust/src/librustc_ast_lowering
Dylan DPC 6ded356d9c
Rollup merge of #71494 - flip1995:while_let_span, r=petrochenkov
Fix span of while (let) expressions after lowering

Credit goes to @alex-700 who found this while trying to fix a suggestion in Clippy.

While `if`, `try`, `for` and `await` expressions get the span of the original expression when desugared, `while` loops got the span of the scrutinee, which lead to weird code, when building the suggestion, that randomly worked: https://github.com/rust-lang/rust-clippy/pull/5511/files#diff-df4e9d2bf840a5f2e3b580bef73da3bcR106-R108

I'm wondering, if `DesugaringKind` should get a variant `WhileLoop` and instead of using the span of the `ast::ExprKind::While` expr directly, a new span with `self.mark_span_with_reason` should be used, like it is done with `for` loops.

There was some fallout, but I think that is acceptable. If not, I need some help to find out where this can be fixed.
2020-04-25 11:25:50 +02:00
..
Cargo.toml lowering: remove librustc dependency 2020-03-21 22:20:24 +01:00
expr.rs Use correct span on while (let) lowering 2020-04-24 00:22:34 +02:00
item.rs Rename AssocKind::Method to AssocKind::Fn 2020-04-14 07:12:07 +08:00
lib.rs Dogfood more or_patterns in the compiler 2020-04-19 07:33:58 -07:00
pat.rs Dogfood more or_patterns in the compiler 2020-04-19 07:33:58 -07:00
path.rs Tweak 'static suggestion code 2020-04-22 12:12:33 -07:00