Skip to content

Commit 18be556

Browse files
committed
inline_call: remove macro self->this test
To be added back later once we have a fix. See #16471 and rust-lang/rust-analyzer#16497 (comment).
1 parent 57a4542 commit 18be556

File tree

1 file changed

+0
-86
lines changed

1 file changed

+0
-86
lines changed

crates/ide-assists/src/handlers/inline_call.rs

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,92 +1792,6 @@ fn _hash2(self_: &u64, state: &mut u64) {
17921792
_write_u64(state, *inner_self_)
17931793
};
17941794
}
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-
}
18811795
"#,
18821796
)
18831797
}

0 commit comments

Comments
 (0)