Skip to content

Commit

Permalink
Add pp-exact test involving where T:
Browse files Browse the repository at this point in the history
Currently fails.

    ---- [pretty] src/test/pretty/where-clauses.rs stdout ----

    error: pretty-printed source does not match expected source
    expected:
    ------------------------------------------
    // pp-exact

    fn f<'a, 'b, T>(t: T) -> isize where T: 'a, 'a: 'b, T: Eq { 0 }

    // This is legal syntax, sometimes generated by macros. `where T: $($bound+)*`
    fn zero_bounds<'a, T>() where 'a:, T: {}

    fn main() {}

    ------------------------------------------
    actual:
    ------------------------------------------
    // pp-exact

    fn f<'a, 'b, T>(t: T) -> isize where T: 'a, 'a: 'b, T: Eq { 0 }

    // This is legal syntax, sometimes generated by macros. `where T: $($bound+)*`
    fn zero_bounds<'a, T>() where 'a, T {}

    fn main() {}

    ------------------------------------------
    diff:
    ------------------------------------------
    3	fn f<'a, 'b, T>(t: T) -> isize where T: 'a, 'a: 'b, T: Eq { 0 }
    4
    5	// This is legal syntax, sometimes generated by macros. `where T: $($bound+)*`
    -	fn zero_bounds<'a, T>() where 'a:, T: {}
    +	fn zero_bounds<'a, T>() where 'a, T {}
    7
    8	fn main() {}
    9
  • Loading branch information
dtolnay committed Jun 17, 2022
1 parent 3bebee7 commit 1b8ca54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/test/pretty/where-clauses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

fn f<'a, 'b, T>(t: T) -> isize where T: 'a, 'a: 'b, T: Eq { 0 }

// This is legal syntax, sometimes generated by macros. `where T: $($bound+)*`
fn zero_bounds<'a, T>() where 'a:, T: {}

fn main() {}

0 comments on commit 1b8ca54

Please sign in to comment.