From ae4b929c00fbead6a0923a07306ffde077d622ad Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Sun, 26 Jun 2022 20:22:04 +0200 Subject: [PATCH 1/2] rustdoc-json: Add assoc type ICE regression test --- src/test/rustdoc-json/assoc_type.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/test/rustdoc-json/assoc_type.rs diff --git a/src/test/rustdoc-json/assoc_type.rs b/src/test/rustdoc-json/assoc_type.rs new file mode 100644 index 0000000000000..b7e985958bcef --- /dev/null +++ b/src/test/rustdoc-json/assoc_type.rs @@ -0,0 +1,16 @@ +// Regression test for . + +// @has assoc_type.json +// @has - "$.index[*][?(@.name=='Trait')]" +// @has - "$.index[*][?(@.name=='AssocType')]" +// @has - "$.index[*][?(@.name=='S')]" + +pub trait Trait { + type AssocType; +} + +impl Trait for T { + type AssocType = Self; +} + +pub struct S; From 2888e76d06483e505bf4956a08bc24d4e7764beb Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Tue, 28 Jun 2022 11:02:14 +0200 Subject: [PATCH 2/2] test/rustdoc-json/assoc_type.rs: Maximize chance of detecting future ICEs --- src/test/rustdoc-json/assoc_type.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/rustdoc-json/assoc_type.rs b/src/test/rustdoc-json/assoc_type.rs index b7e985958bcef..716bb3d2848cc 100644 --- a/src/test/rustdoc-json/assoc_type.rs +++ b/src/test/rustdoc-json/assoc_type.rs @@ -4,6 +4,7 @@ // @has - "$.index[*][?(@.name=='Trait')]" // @has - "$.index[*][?(@.name=='AssocType')]" // @has - "$.index[*][?(@.name=='S')]" +// @has - "$.index[*][?(@.name=='S2')]" pub trait Trait { type AssocType; @@ -14,3 +15,8 @@ impl Trait for T { } pub struct S; + +/// Not needed for the #98547 ICE to occur, but added to maximize the chance of +/// getting an ICE in the future. See +/// +pub struct S2;