Skip to content

Commit c7e4ae0

Browse files
committed
Add regression test.
1 parent 2cee9ec commit c7e4ae0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/test/run-pass/type-macros-simple.rs

+19
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,22 @@ macro_rules! Tuple {
1515
fn main() {
1616
let x: Tuple!(i32, i32) = (1, 2);
1717
}
18+
19+
fn issue_36540() {
20+
let i32 = 0;
21+
macro_rules! m { () => { i32 } }
22+
struct S<T = m!()>(m!(), T) where T: Trait<m!()>;
23+
24+
let x: m!() = m!();
25+
std::cell::Cell::<m!()>::new(m!());
26+
impl<T = m!()> std::ops::Index<m!()> for Trait<(m!(), T)>
27+
where T: Trait<m!()>
28+
{
29+
type Output = m!();
30+
fn index(&self, i: m!()) -> &m!() {
31+
unimplemented!()
32+
}
33+
}
34+
}
35+
36+
trait Trait<T> {}

0 commit comments

Comments
 (0)