Run rustfix on first UI test

This commit is contained in:
Philipp Hansch 2018-12-09 16:18:16 +01:00
parent bd74fdce22
commit 2ccfd52f5d
No known key found for this signature in database
GPG key ID: B6FA06A6E0E2665B
3 changed files with 27 additions and 3 deletions

View file

@ -0,0 +1,23 @@
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// run-rustfix
#![feature(stmt_expr_attributes)]
struct Outer {
inner: u32,
}
#[deny(clippy::ref_in_deref)]
fn main() {
let outer = Outer { inner: 0 };
let inner = outer.inner.inner;
}

View file

@ -7,7 +7,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(tool_attributes)]
// run-rustfix
#![feature(stmt_expr_attributes)]
struct Outer {

View file

@ -1,11 +1,11 @@
error: Creating a reference that is immediately dereferenced.
--> $DIR/unnecessary_ref.rs:20:17
--> $DIR/unnecessary_ref.rs:21:17
|
LL | let inner = (&outer).inner;
| ^^^^^^^^ help: try this: `outer.inner`
|
note: lint level defined here
--> $DIR/unnecessary_ref.rs:17:8
--> $DIR/unnecessary_ref.rs:18:8
|
LL | #[deny(clippy::ref_in_deref)]
| ^^^^^^^^^^^^^^^^^^^^