rustdoc: Methods from Deref<Target = T<U>> is imprecise (contains false positives) · Issue #24686 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

@ghost

Description

@ghost

use std::ops::Deref;

pub struct Foo(T); impl Foo { pub fn get_i32(&self) -> i32 { self.0 } } impl Foo { pub fn get_u32(&self) -> u32 { self.0 } } pub struct Bar(Foo); impl Deref for Bar { type Target = Foo; fn deref(&self) -> &Foo { &self.0 } }

The Methods from Deref for Bar will contain both get_i32 and get_u32, but should only contain get_i32.

Image