gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_expr):
split LEFT_SHIFT before null_denotation.
gcc/testsuite/ChangeLog:
* rust/compile/complex_qualified_path_in_expr.rs : New test.
Signed-off-by: Mahmoud Mohamed <mahadelr19@gmail.com>
|| id == RIGHT_SQUARE)
return nullptr;
}
+
+ if (current_token->get_id () == LEFT_SHIFT)
+ {
+ lexer.split_current_token (LEFT_ANGLE, LEFT_ANGLE);
+ current_token = lexer.peek_token ();
+ }
+
lexer.skip_token ();
// parse null denotation (unary part of expression)
--- /dev/null
+struct S; // { dg-warning "struct is never constructed" "" { target *-*-* } .-1 }
+impl S {
+ fn f() -> i32 { return 0; }
+ // { dg-warning "associated function is never used" "" { target *-*-* } .-1 }
+}
+
+trait T1 {
+ type A;
+ fn f() -> i32 { return 0; }
+}
+
+impl T1 for S {
+ type A = S;
+}
+
+trait T2 {
+ type B;
+ fn f() -> i32 { return 0; }
+}
+
+impl T2 for S {
+ type B = S;
+}
+
+trait T3 {
+ fn f() -> i32 { return 0; }
+}
+
+impl T3 for S {}
+
+fn main() {
+ let _ = <<S as T1>::A as T2>::f();
+ let _ = <<<S as T1>::A as T2>::B as T3>::f();
+}