2020-09-21 13:28:52 -05:00
|
|
|
error: passing `TyCtxt<'tcx>` by reference
|
2022-01-10 12:12:28 -06:00
|
|
|
--> $DIR/rustc_pass_by_value_self.rs:18:15
|
2020-09-21 13:28:52 -05:00
|
|
|
|
|
|
|
|
LL | fn by_ref(&self) {}
|
|
|
|
| ^^^^^ help: try passing by value: `TyCtxt<'tcx>`
|
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
2022-01-07 05:38:16 -06:00
|
|
|
--> $DIR/rustc_pass_by_value_self.rs:8:9
|
2020-09-21 13:28:52 -05:00
|
|
|
|
|
2022-01-07 05:38:16 -06:00
|
|
|
LL | #![deny(rustc::pass_by_value)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
2020-09-21 13:28:52 -05:00
|
|
|
|
|
|
|
error: passing `Ty<'tcx>` by reference
|
2022-01-10 12:12:28 -06:00
|
|
|
--> $DIR/rustc_pass_by_value_self.rs:30:21
|
2020-09-21 13:28:52 -05:00
|
|
|
|
|
|
|
|
LL | fn by_ref(self: &Ty<'tcx>) {}
|
|
|
|
| ^^^^^^^^^ help: try passing by value: `Ty<'tcx>`
|
|
|
|
|
2022-01-11 03:28:13 -06:00
|
|
|
error: passing `Foo` by reference
|
|
|
|
--> $DIR/rustc_pass_by_value_self.rs:37:17
|
|
|
|
|
|
|
|
|
LL | fn with_ref(&self) {}
|
|
|
|
| ^^^^^ help: try passing by value: `Foo`
|
|
|
|
|
2022-01-11 13:59:06 -06:00
|
|
|
error: passing `WithParameters<T, 1_usize>` by reference
|
|
|
|
--> $DIR/rustc_pass_by_value_self.rs:47:17
|
|
|
|
|
|
|
|
|
LL | fn with_ref(&self) {}
|
|
|
|
| ^^^^^ help: try passing by value: `WithParameters<T, 1_usize>`
|
|
|
|
|
|
|
|
error: passing `WithParameters<T, 1_usize, u8>` by reference
|
|
|
|
--> $DIR/rustc_pass_by_value_self.rs:51:17
|
|
|
|
|
|
|
|
|
LL | fn with_ref(&self) {}
|
|
|
|
| ^^^^^ help: try passing by value: `WithParameters<T, 1_usize, u8>`
|
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
2020-09-21 13:28:52 -05:00
|
|
|
|