Only show notable traits if both types are the same
Checking only their DefId doesn't work because all slices have the same fake DefId. Fixes #91347
This commit is contained in:
parent
6db0a0e9a4
commit
85ba6c7b34
3 changed files with 67 additions and 1 deletions
20
src/test/rustdoc/doc-notable_trait-slice.rs
Normal file
20
src/test/rustdoc/doc-notable_trait-slice.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
#![feature(doc_notable_trait)]
|
||||
|
||||
#[doc(notable_trait)]
|
||||
pub trait SomeTrait {}
|
||||
|
||||
pub struct SomeStruct;
|
||||
pub struct OtherStruct;
|
||||
impl SomeTrait for &[SomeStruct] {}
|
||||
|
||||
// @has doc_notable_trait_slice/fn.bare_fn_matches.html
|
||||
// @has - '//code[@class="content"]' 'impl SomeTrait for &[SomeStruct]'
|
||||
pub fn bare_fn_matches() -> &'static [SomeStruct] {
|
||||
&[]
|
||||
}
|
||||
|
||||
// @has doc_notable_trait_slice/fn.bare_fn_no_matches.html
|
||||
// @!has - '//code[@class="content"]' 'impl SomeTrait for &[SomeStruct]'
|
||||
pub fn bare_fn_no_matches() -> &'static [OtherStruct] {
|
||||
&[]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue