Auto merge of #36555 - jseyfried:issue_36540, r=eddyb

Visit and fold macro invocations in the same order

Fixes #36540.
r? @nrc
This commit is contained in:
bors 2016-09-18 04:11:51 -07:00 committed by GitHub
commit 22d15eaca9
3 changed files with 55 additions and 58 deletions

View file

@ -15,3 +15,22 @@ macro_rules! Tuple {
fn main() {
let x: Tuple!(i32, i32) = (1, 2);
}
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!());
impl<T = m!()> std::ops::Index<m!()> for Trait<(m!(), T)>
where T: Trait<m!()>
{
type Output = m!();
fn index(&self, i: m!()) -> &m!() {
unimplemented!()
}
}
}
trait Trait<T> {}