diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-12 07:45:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-12 07:45:28 +0100 |
| commit | 5dec0139f9452acbb3d5cd05ddfa54944f22a5c9 (patch) | |
| tree | c9ebb1e37ce4ec3a8db8cad0c422801a2355d861 /src | |
| parent | 0f3a4c77c489f36a973f00ee07ab37caa7c6b32e (diff) | |
| parent | 17206cbf54c0964c467246b1c031cf451fd0f68e (diff) | |
| download | rust-5dec0139f9452acbb3d5cd05ddfa54944f22a5c9.tar.gz rust-5dec0139f9452acbb3d5cd05ddfa54944f22a5c9.zip | |
Rollup merge of #91748 - notriddle:notriddle/doc-notable_trait-mut_t_is_not_an_iterator, r=Mark-Simulacrum
rustdoc: Add regression test for Iterator as notable trait on &mut T Closes #80737
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs b/src/test/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs new file mode 100644 index 00000000000..bfce46cf444 --- /dev/null +++ b/src/test/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs @@ -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!() +} |
