about summary refs log tree commit diff
path: root/tests/ui/traits/next-solver/normalize/normalize-place-elem.rs
blob: 9a600875bb9af3e8d858ecae283827e830391e71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//@ check-pass
//@ compile-flags: -Znext-solver

// Regression test for <https://github.com/rust-lang/trait-system-refactor-initiative/issues/221>.
// Ensure that we normalize after applying projection elems in MIR typeck.

use std::marker::PhantomData;

#[derive(Copy, Clone)]
struct Span;

trait AstKind {
    type Inner;
}

struct WithSpan;
impl AstKind for WithSpan {
    type Inner
        = (i32,);
}

struct Expr<'a> { f: &'a <WithSpan as AstKind>::Inner }

impl Expr<'_> {
    fn span(self) {
        match self {
            Self { f: (n,) } => {},
        }
    }
}

fn main() {}