1 //@aux-build:proc_macros.rs
3 #![allow(clippy::return_self_not_must_use, clippy::useless_vec)]
4 #![warn(clippy::deref_addrof)]
6 extern crate proc_macros;
7 use proc_macros::inline_macros;
9 fn get_number() -> usize {
13 fn get_reference(n: &usize) -> &usize {
17 #[allow(clippy::double_parens)]
18 #[allow(unused_variables, unused_parens)]
27 let b = *get_reference(&a);
29 let bytes: Vec<usize> = vec![1, 2, 3, 4];
30 let b = bytes[1..2][0];
32 //This produces a suggestion of 'let b = (a);' which
33 //will trigger the 'unused_parens' lint
45 let _ = unsafe { *core::ptr::addr_of!(a) };
48 #[derive(Copy, Clone)]
52 pub fn f(&self) -> &Self {
53 inline!($(@expr self))
55 #[allow(unused_mut)] // mut will be unused, once the macro is fixed
56 pub fn f_mut(mut self) -> Self {
57 inline!($(@expr self))