Skip to content

rustdoc: Add regression test for Iterator as notable trait on &mut T #91748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/test/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//! Test case for [#80737].
//!
//! A SomeTrait that is implemented for `&mut T where T: SomeTrait`
//! should not be marked as "notable" for return values that do not
//! have bounds on the trait itself.
//!
//! [#80737]: https://github.com/rust-lang/rust/issues/80737

#![feature(rustdoc_internals)]
#![no_std]

#[doc(primitive = "reference")]
/// Some useless docs, wouhou!
///
/// We need to put this in here, because notable traits
/// that are implemented on foreign types don't show up.
mod reference {}

// @has doc_notable_trait_mut_t_is_not_an_iterator/fn.fn_no_matches.html
// @!has - '//code[@class="content"]' 'Iterator'
pub fn fn_no_matches<'a, T: 'a>() -> &'a mut T {
panic!()
}