File tree 1 file changed +12
-1
lines changed
compiler/rustc_middle/src
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -321,9 +321,13 @@ pub enum ExprKind<'tcx> {
321
321
Cast {
322
322
source : ExprId ,
323
323
} ,
324
+ /// Forces its contents to be treated as a value expression, not a place
325
+ /// expression. This is inserted in some places where an operation would
326
+ /// otherwise be erased completely (e.g. some no-op casts), but we still
327
+ /// need to ensure that its operand is treated as a value and not a place.
324
328
Use {
325
329
source : ExprId ,
326
- } , // Use a lexpr to get a vexpr.
330
+ } ,
327
331
/// A coercion from `!` to any type.
328
332
NeverToAny {
329
333
source : ExprId ,
@@ -338,6 +342,13 @@ pub enum ExprKind<'tcx> {
338
342
Loop {
339
343
body : ExprId ,
340
344
} ,
345
+ /// Special expression representing the `let` part of an `if let` or similar construct
346
+ /// (including `if let` guards in match arms, and let-chains formed by `&&`).
347
+ ///
348
+ /// This isn't considered a real expression in surface Rust syntax, so it can
349
+ /// only appear in specific situations, such as within the condition of an `if`.
350
+ ///
351
+ /// (Not to be confused with [`StmtKind::Let`], which is a normal `let` statement.)
341
352
Let {
342
353
expr : ExprId ,
343
354
pat : Box < Pat < ' tcx > > ,
You can’t perform that action at this time.
0 commit comments