gcc/rust/ChangeLog:
* expand/rust-expand-visitor.cc (ExpandVisitor::visit): Correctly visit the generic args
of a generic type path segment.
gcc/testsuite/ChangeLog:
* rust/compile/issue-2015.rs: New test.
void
ExpandVisitor::visit (AST::TypePathSegmentGeneric &segment)
-{}
+{
+ expand_generic_args (segment.get_generic_args ());
+}
void
ExpandVisitor::visit (AST::TypePathSegmentFunction &segment)
--- /dev/null
+// { dg-additional-options "-frust-compile-until=lowering" }
+
+macro_rules! impl_foo {
+ () => { impl Foo }
+}
+
+pub trait Foo {}
+
+pub trait Bar {
+ type Baz;
+}
+
+pub fn foo(_value: impl Bar<Baz = impl_foo!()>) -> i32 {
+ 15
+}
+
+pub fn bar(_value: impl Bar<Baz = impl Foo>) -> i32 {
+ 16
+}