LARGE_ASSIGNMENTS in rustc_lint_defs::builtin - Rust
Description: The `large_assignments` lint detects when objects of large types are being moved around.

Skip to main content

## LARGE_ASSIGNMENTS

# Static LARGE_ASSIGNMENTS

Source

    pub static LARGE_ASSIGNMENTS: &Lint

Expand description

The `large_assignments` lint detects when objects of large types are being moved around.

#### §Example

ⓘ

    let x = [0; 50000];
    let y = x;

produces:

    warning: moving a large value
      --> $DIR/move-large.rs:1:3
      let y = x;
              - Copied large value here

#### §Explanation

When using a large type in a plain assignment or in a function argument, idiomatic code can be inefficient. Ideally appropriate optimizations would resolve this, but such optimizations are only done in a best-effort manner. This lint will trigger on all sites of large moves and thus allow the user to resolve them in code.