temporary-assignment Disallow assignments into discarded struct and tuple constructions Assigning through a freshly constructed struct or tuple updates a value discarded at the end of the statement. Instead, you SHOULD construct the intended value directly or bind it before assigning into it. - Category: suspicious - Level: warning - Fix: none - Scope: module Reported struct Point { x: int32; } function discard(): void { Point { x: 1 }.x = 2; } Accepted struct Point { x: int32; } function retain(): Point { let point = Point { x: 1 }; point.x = 2; return point; } Prior art - Clippy ยท temporaryassignment language/linter/src/rules/suspicious/temporaryassignment.rs:6