Skip to content

Conversation

catamorphism
Copy link
Contributor

No description provided.

@bors bors closed this Apr 16, 2013
@bors bors merged commit 0ef3e1e into rust-lang:incoming Apr 16, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 28, 2020
Warn about explicit self-assignment

Warn about assignments where left-hand side place expression is the same
as right-hand side value expression. For example, warn about assignment in:

```rust
pub struct Event {
    id: usize,
    x: i32,
    y: i32,
}

pub fn copy_position(a: &mut Event, b: &Event) {
    a.x = b.x;
    a.y = a.y;
}
```

changelog: New lint `self_assignment`, checks for explicit self-assignments.
calebcartwright pushed a commit to calebcartwright/rust that referenced this pull request Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants