1
Fork 0

Rollup merge of #108049 - clubby789:dont-suggest-unstable, r=compiler-errors

Don't suggest `#[doc(hidden)]` trait methods with matching return type

Fixes #107983, addressing the bad suggestion.
The test can probably be made more specific to this  case, but I'm unsure how.

`@rustbot` label +A-diagnostics
This commit is contained in:
Matthias Krüger 2023-02-15 21:30:58 +01:00 committed by GitHub
commit 897f56ed28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 1 deletions

View file

@ -504,7 +504,9 @@ fn foo(&self) -> Self::T { String::new() }
let methods: Vec<(Span, String)> = items
.in_definition_order()
.filter(|item| {
ty::AssocKind::Fn == item.kind && Some(item.name) != current_method_ident
ty::AssocKind::Fn == item.kind
&& Some(item.name) != current_method_ident
&& !tcx.is_doc_hidden(item.def_id)
})
.filter_map(|item| {
let method = tcx.fn_sig(item.def_id).subst_identity();