]> git.lizzy.rs Git - rust.git/blob - tests/ui/macros/type-macros-simple.rs
Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726
[rust.git] / tests / ui / macros / type-macros-simple.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(unused_variables)]
4 macro_rules! Tuple {
5     { $A:ty,$B:ty } => { ($A, $B) }
6 }
7
8 fn main() {
9     let x: Tuple!(i32, i32) = (1, 2);
10 }
11
12 fn issue_36540() {
13     let i32 = 0;
14     macro_rules! m { () => { i32 } }
15     struct S<T = m!()>(m!(), T) where T: Trait<m!()>;
16
17     let x: m!() = m!();
18     std::cell::Cell::<m!()>::new(m!());
19     impl<T> std::ops::Index<m!()> for dyn Trait<(m!(), T)>
20         where T: Trait<m!()>
21     {
22         type Output = m!();
23         fn index(&self, i: m!()) -> &m!() {
24             unimplemented!()
25         }
26     }
27 }
28
29 trait Trait<T> {}
30 impl Trait<i32> for i32 {}