Skip to content

Commit 94a52b7

Browse files
committed
Add tests for lowering of reference types
1 parent 41da0d9 commit 94a52b7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/lowering/mod.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,27 @@ fn raw_pointers() {
509509
}
510510
}
511511
}
512+
513+
#[test]
514+
fn refs() {
515+
lowering_success! {
516+
program {
517+
trait Foo { }
518+
519+
impl<'a, T> Foo for &'a T { }
520+
impl<'b, T> Foo for &'b mut T { }
521+
}
522+
}
523+
524+
lowering_error! {
525+
program {
526+
trait Foo { }
527+
528+
impl<T> Foo for &T { }
529+
}
530+
531+
error_msg {
532+
"parse error: UnrecognizedToken { token: (36, Token(1, \"T\"), 37), expected: [\"r#\\\"\\\\\\\'([A-Za-z]|_)([A-Za-z0-9]|_)*\\\"#\"] }"
533+
}
534+
}
535+
}

0 commit comments

Comments
 (0)