rust/tests/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
660 B
Rust
Raw Normal View History

2021-12-10 10:55:36 -06:00
//! Test case for [#78160].
//!
//! A SomeTrait that is implemented for `&mut T` should not be marked as
//! "notable" for return values that are `&T`.
//!
//! [#78160]: https://github.com/rust-lang/rust/issues/78160
#![feature(rustdoc_internals)]
#[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_ref_t/fn.fn_no_matches.html
// @!has - '//code[@class="content"]' "impl<'_, I> Iterator for &'_ mut I"
pub fn fn_no_matches<'a, T: Iterator + 'a>() -> &'a T {
loop {}
}