rust/tests/ui/rfcs
bors f2348fb29a Auto merge of #119122 - matthewjasper:if-let-guard-scoping, r=TaKO8Ki
Give temporaries in if let guards correct scopes

Temporaries in if-let guards have scopes that escape the match arm, this causes problems because the drops might be for temporaries that are not storage live. This PR changes the scope of temporaries in if-let guards to be limited to the arm:

```rust
_ if let Some(s) = std::convert::identity(&Some(String::new())) => {}
//                Temporary for Some(String::new()) is dropped here ^
```

We also now deduplicate temporaries between copies of the guard created for or-patterns:

```rust
// Only create a single Some(String::new()) temporary variable
_ | _ if let Some(s) = std::convert::identity(&Some(String::new())) => {}
```

This changes MIR building to pass around `ExprId`s rather than `Expr`s so that we have a way to index different expressions.

cc #51114
Closes #116079
2023-12-25 04:06:58 +00:00
..
rfc-0000-never_patterns Satisfy tidy 2023-12-03 12:25:46 +01:00
rfc-0107-bind-by-move-pattern-guards
rfc-1014-stdout-existential-crisis
rfc-1445-restrict-constants-in-patterns Show number in error message even for one error 2023-11-24 19:15:52 +01:00
rfc-1623-static Add print_trait_sugared 2023-12-05 17:15:46 +00:00
rfc-1717-dllimport Show number in error message even for one error 2023-11-24 19:15:52 +01:00
rfc-1789-as-cell
rfc-1857-stabilize-drop-order
rfc-1937-termination-trait Manual find replace updates 2023-11-24 21:04:51 +01:00
rfc-2005-default-binding-mode recurse into refs when comparing tys for diagnostics 2023-12-07 23:00:46 -05:00
rfc-2008-non-exhaustive Auto merge of #117611 - Nadrieril:linear-pass-take-4, r=cjgillot 2023-11-26 00:14:14 +00:00
rfc-2027-object-safe-for-dispatch update use of feature flags 2023-12-14 15:22:37 +01:00
rfc-2091-track-caller Show number in error message even for one error 2023-11-24 19:15:52 +01:00
rfc-2093-infer-outlives Show number in error message even for one error 2023-11-24 19:15:52 +01:00
rfc-2126-crate-paths Show number in error message even for one error 2023-11-24 19:15:52 +01:00
rfc-2126-extern-absolute-paths Show number in error message even for one error 2023-11-24 19:15:52 +01:00
rfc-2151-raw-identifiers
rfc-2175-or-if-while-let
rfc-2294-if-let-guard Give temporaries in if let guards correct scopes 2023-12-21 13:35:56 +00:00
rfc-2302-self-struct-ctor
rfc-2306-convert-id
rfc-2361-dbg-macro blessed 2023-12-12 18:12:57 +08:00
rfc-2396-target_feature-11 thir-unsafeck: print list of missing target features when calling a function with target features outside an unsafe block 2023-11-28 20:37:02 +01:00
rfc-2397-do-not-recommend Show number in error message even for one error 2023-11-24 19:15:52 +01:00
rfc-2421-unreserve-pure-offsetof-sizeof-alignof
rfc-2457-non-ascii-idents Show number in error message even for one error 2023-11-24 19:15:52 +01:00
rfc-2497-if-let-chains Suggest let or == on typo'd let-chain 2023-11-28 18:07:52 +00:00
rfc-2528-type-changing-struct-update recurse into refs when comparing tys for diagnostics 2023-12-07 23:00:46 -05:00
rfc-2565-param-attrs Add spacing information to delimiters. 2023-12-11 09:36:40 +11:00
rfc-2627-raw-dylib Manual find replace updates 2023-11-24 21:04:51 +01:00
rfc-2632-const-trait-impl add a test for ICE #112822 2023-12-23 15:09:55 +00:00
rfc-3348-c-string-literals Tweak the no-nuls.rs test. 2023-12-09 09:30:32 +11:00