Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/test/rustdoc-json/assoc_type.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Regression test for <https://github.com/rust-lang/rust/issues/98547>.

// @has assoc_type.json
// @has - "$.index[*][?(@.name=='Trait')]"
// @has - "$.index[*][?(@.name=='AssocType')]"
// @has - "$.index[*][?(@.name=='S')]"
// @has - "$.index[*][?(@.name=='S2')]"

pub trait Trait {
type AssocType;
}

impl<T> Trait for T {
type AssocType = Self;
}

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
/// <https://github.com/rust-lang/rust/pull/98548#discussion_r908219164>
pub struct S2;