Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 23dcf45

Browse files
committedFeb 24, 2025
rustdoc: add known-bug test for issue rust-lang#24686
1 parent 617aad8 commit 23dcf45

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//@ known-bug
2+
#![crate_name = "foo"]
3+
4+
// test for https://github.com/rust-lang/rust/issues/24686
5+
use std::ops::Deref;
6+
7+
pub struct Foo<T>(T);
8+
impl Foo<i32> {
9+
pub fn get_i32(&self) -> i32 { self.0 }
10+
}
11+
impl Foo<u32> {
12+
pub fn get_u32(&self) -> u32 { self.0 }
13+
}
14+
//@ has foo/struct.Bar.html
15+
//@ has - '//a[@href="#method.get_i32"]' 'get_i32'
16+
//@ !has - '//a[@href="#method.get_u32"]' 'get_u32'
17+
pub struct Bar(Foo<i32>);
18+
impl Deref for Bar {
19+
type Target = Foo<i32>;
20+
fn deref(&self) -> &Foo<i32> {
21+
&self.0
22+
}
23+
}

0 commit comments

Comments
 (0)
Failed to load comments.