]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_update.rs
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / needless_update.rs
1 #![feature(tool_lints)]
2
3
4 #![warn(clippy::needless_update)]
5 #![allow(clippy::no_effect)]
6
7 struct S {
8     pub a: i32,
9     pub b: i32,
10 }
11
12 fn main() {
13     let base = S { a: 0, b: 0 };
14     S { ..base }; // no error
15     S { a: 1, ..base }; // no error
16     S { a: 1, b: 1, ..base };
17 }