diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2024-10-02 16:35:37 -0300 | 
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2025-03-06 17:58:32 -0300 | 
| commit | 05c516446a0f6105ce695da00d5cf5a0eb54e808 (patch) | |
| tree | d83371138f5b6dc54c0b7122227b209c68cac931 /compiler/rustc_lint/src/dangling.rs | |
| parent | 0cf8dbc96c7c3c454779fe59e8e7019a3e37d5b6 (diff) | |
| download | rust-05c516446a0f6105ce695da00d5cf5a0eb54e808.tar.gz rust-05c516446a0f6105ce695da00d5cf5a0eb54e808.zip  | |
Implement .use keyword as an alias of clone
Diffstat (limited to 'compiler/rustc_lint/src/dangling.rs')
| -rw-r--r-- | compiler/rustc_lint/src/dangling.rs | 5 | 
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/dangling.rs b/compiler/rustc_lint/src/dangling.rs index fd6b3e90ada..91c7922638d 100644 --- a/compiler/rustc_lint/src/dangling.rs +++ b/compiler/rustc_lint/src/dangling.rs @@ -159,7 +159,10 @@ fn is_temporary_rvalue(expr: &Expr<'_>) -> bool { ExprKind::Path(..) => false, // Calls return rvalues. - ExprKind::Call(..) | ExprKind::MethodCall(..) | ExprKind::Binary(..) => true, + ExprKind::Call(..) + | ExprKind::MethodCall(..) + | ExprKind::Use(..) + | ExprKind::Binary(..) => true, // Inner blocks are rvalues. ExprKind::If(..) | ExprKind::Loop(..) | ExprKind::Match(..) | ExprKind::Block(..) => true,  | 
