rust/src/test
Dylan DPC a0dcbdf7fd
Rollup merge of #84486 - Smittyvb:else-if-let-hir-pretty-print, r=petrochenkov
Handle pretty printing of `else if let` clauses without ICEing

When pretty printing the HIR of `if ... {} else if let ... {}` clauses, this displays it the `else if let` part as `match` it gets desugared to, the same way normal `if let` statements are currently displayed, instead of ICEing.

```rust
pub fn main() {
    if true {
        // 1
    } else if let a = 1 {
        // 2
    } else {
        // 3
    }
}
```

now gets desugared (via `rustc -Zunpretty=hir,typed src/x.rs`) to:

```rust
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
pub fn main() ({
                   (if (true as bool)
                       ({
                            // 1
                        } as
                           ()) else {match (1 as i32) {
                                         a => {
                                             // 2
                                         }
                                         _ => {
                                             // 3
                                         }
                                     }} as ())
                    } as ())
```

For comparison, this code gets HIR prettyprinted the same way before and after this change:

```rust
pub fn main() {
    if let a = 1 {
        // 2
    } else {
        // 3
    }
}
```
turns into
```rust
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
pub fn main() ({
                   (match (1 as i32) {
                        a => {
                            // 2
                        }
                        _ => {
                            // 3
                        }
                    } as ())
               } as ())
```

This closes #82329. It closes #84434 as well, due to having the same root cause.
2021-04-25 23:15:12 +02:00
..
assembly Allow using -C force-unwind-tables=no when panic=unwind 2021-04-11 22:32:40 +08:00
auxiliary
codegen Update wasm test assertions 2021-04-23 08:59:49 -07:00
codegen-units Remove redundant ignore-tidy-linelength annotations 2021-04-03 22:30:20 +02:00
debuginfo Auto merge of #83799 - crlf0710:stablize_non_ascii_idents, r=Manishearth 2021-04-18 23:28:43 +00:00
incremental Mark has_global_allocator query as eval_always 2021-04-16 16:28:54 -04:00
mir-opt Only generate dummy assign when instrumenting coverage 2021-04-18 12:09:14 -07:00
pretty Update test/pretty output for edition preludes. 2021-02-25 13:43:11 +01:00
run-make rustc: Add a new wasm ABI 2021-04-08 08:03:18 -07:00
run-make-fulldeps Auto merge of #84323 - richkadel:uncovered-functions, r=tmandry 2021-04-20 08:33:51 +00:00
run-pass-valgrind Update tests for extern block linting 2021-01-13 07:49:16 -05:00
rustdoc Rollup merge of #84320 - jsha:details-implementors, r=Manishearth,Nemo157,GuillaumeGomez 2021-04-24 12:17:03 +09:00
rustdoc-gui improve wording 2021-04-23 18:13:06 +02:00
rustdoc-js Add test for primitive search 2021-02-01 15:56:51 +01:00
rustdoc-js-std Add search index test for primitive types 2021-01-27 10:05:06 +01:00
rustdoc-json Rename span to source 2021-03-24 19:44:23 +00:00
rustdoc-ui Revert "rustdoc: Hide #text in doc-tests" 2021-04-24 11:54:44 +01:00
rustfix
ui Rollup merge of #84486 - Smittyvb:else-if-let-hir-pretty-print, r=petrochenkov 2021-04-25 23:15:12 +02:00
ui-fulldeps Fix fulldeps tests. 2021-03-30 23:51:15 +02:00
COMPILER_TESTS.md