Skip to content

Commit

Permalink
Rollup merge of rust-lang#98548 - Enselic:allow-typedef-diff-for-rust…
Browse files Browse the repository at this point in the history
…doc-json, r=GuillaumeGomez

rustdoc-json: Allow Typedef to be different in sanity assert

Closes rust-lang#98547

This fix is a natural extension of rust-lang#98053.

r? `@notriddle`

(Since you reviewed the other PR.)

CC `@GuillaumeGomez`

`@rustbot` labels +A-rustdoc-json +T-rustdoc
  • Loading branch information
matthiaskrgr committed Jun 28, 2022
2 parents 00ebeb8 + 2888e76 commit 3991e73
Showing 1 changed file with 22 additions and 0 deletions.
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;

0 comments on commit 3991e73

Please sign in to comment.