2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(unused_variables)]
|
2024-01-26 16:14:38 +00:00
|
|
|
#![allow(non_local_definitions)]
|
|
|
|
|
2015-08-03 20:51:23 +00:00
|
|
|
macro_rules! Tuple {
|
|
|
|
{ $A:ty,$B:ty } => { ($A, $B) }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x: Tuple!(i32, i32) = (1, 2);
|
|
|
|
}
|
2016-09-17 23:31:32 +00:00
|
|
|
|
|
|
|
fn issue_36540() {
|
|
|
|
let i32 = 0;
|
|
|
|
macro_rules! m { () => { i32 } }
|
|
|
|
struct S<T = m!()>(m!(), T) where T: Trait<m!()>;
|
|
|
|
|
|
|
|
let x: m!() = m!();
|
|
|
|
std::cell::Cell::<m!()>::new(m!());
|
2019-05-28 18:47:21 +00:00
|
|
|
impl<T> std::ops::Index<m!()> for dyn Trait<(m!(), T)>
|
2016-09-17 23:31:32 +00:00
|
|
|
where T: Trait<m!()>
|
|
|
|
{
|
|
|
|
type Output = m!();
|
|
|
|
fn index(&self, i: m!()) -> &m!() {
|
|
|
|
unimplemented!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
trait Trait<T> {}
|
2017-12-15 18:04:25 +00:00
|
|
|
impl Trait<i32> for i32 {}
|