@@ -1792,92 +1792,6 @@ fn _hash2(self_: &u64, state: &mut u64) {
1792
1792
_write_u64(state, *inner_self_)
1793
1793
};
1794
1794
}
1795
- "# ,
1796
- )
1797
- }
1798
-
1799
- #[ test]
1800
- fn inline_call_with_reference_in_macro_generated_trait_impl ( ) {
1801
- check_assist (
1802
- inline_call,
1803
- r#"
1804
- trait Hash2 {
1805
- fn hash2<H: Hasher2>(&self, state: &mut H);
1806
- }
1807
-
1808
- trait Hasher2 {
1809
- fn write2_u64(&mut self, x: u64);
1810
- }
1811
- impl Hasher2 for u64 {
1812
- fn write2_u64(&mut self, x: u64) {
1813
- *self += x;
1814
- }
1815
- }
1816
-
1817
- macro_rules! impl_write {
1818
- ($(($ty:ident, $meth:ident),)*) => {$(
1819
- impl Hash2 for $ty {
1820
- #[inline]
1821
- fn hash2<H: Hasher2>(&self, state: &mut H) {
1822
- state.$meth(*self)
1823
- }
1824
- }
1825
- )*}
1826
- }
1827
-
1828
- impl_write! { (u64, write2_u64), }
1829
-
1830
- pub struct MyStruct {
1831
- value: u64,
1832
- }
1833
-
1834
- impl Hash2 for MyStruct {
1835
- fn hash2<H: Hasher2>(&self, state: &mut H) {
1836
- self.value.$0hash2(state)
1837
- }
1838
- }
1839
- "# ,
1840
- //
1841
- r#"
1842
- trait Hash2 {
1843
- fn hash2<H: Hasher2>(&self, state: &mut H);
1844
- }
1845
-
1846
- trait Hasher2 {
1847
- fn write2_u64(&mut self, x: u64);
1848
- }
1849
- impl Hasher2 for u64 {
1850
- fn write2_u64(&mut self, x: u64) {
1851
- *self += x;
1852
- }
1853
- }
1854
-
1855
- macro_rules! impl_write {
1856
- ($(($ty:ident, $meth:ident),)*) => {$(
1857
- impl Hash2 for $ty {
1858
- #[inline]
1859
- fn hash2<H: Hasher2>(&self, state: &mut H) {
1860
- state.$meth(*self)
1861
- }
1862
- }
1863
- )*}
1864
- }
1865
-
1866
- impl_write! { (u64, write2_u64), }
1867
-
1868
- pub struct MyStruct {
1869
- value: u64,
1870
- }
1871
-
1872
- impl Hash2 for MyStruct {
1873
- fn hash2<H: Hasher2>(&self, state: &mut H) {
1874
- {
1875
- let this = &self.value;
1876
- let state: &mut H = state;
1877
- state.write2_u64(*this)
1878
- }
1879
- }
1880
- }
1881
1795
"# ,
1882
1796
)
1883
1797
}
0 commit comments