Auto merge of #106833 - JohnTitor:rollup-z8398jk, r=JohnTitor

Rollup of 13 pull requests

Successful merges:

 - #104965 (reword Option::as_ref and Option::map examples)
 - #105172 (Added error documentation for write_fmt)
 - #106605 (rustdoc: fix outdated lint section of the book)
 - #106670 (Check compiler docs in PR CI)
 - #106692 (mv binary_heap.rs binary_heap/mod.rs)
 - #106693 (rustdoc: rename CSS rustdoc-toggle -> toggle and toggle -> settings-toggle)
 - #106707 (Remove duplicate sha-1 dependency)
 - #106762 (Add `AtomicPtr::as_mut_ptr`)
 - #106766 (Remove dead code in rustdoc stripper)
 - #106775 (Remove stale reference to the test suite location)
 - #106799 (Stop having unused lifetimes on some `impl`s)
 - #106816 (Update `rental` hack to work with remapped paths.)
 - #106819 (rustdoc: remove unnecessary DOM class `h1.fqn`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2023-01-14 05:51:55 +00:00
commit c0b8735959
50 changed files with 487 additions and 235 deletions

View File

@ -3014,9 +3014,9 @@ dependencies = [
[[package]]
name = "pest"
version = "2.3.0"
version = "2.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b0560d531d1febc25a3c9398a62a71256c0178f2e3443baedd9ad4bb8c9deb4"
checksum = "0f6e86fb9e7026527a0d46bc308b841d73170ef8f443e1807f6ef88526a816d4"
dependencies = [
"thiserror",
"ucd-trie",
@ -3024,9 +3024,9 @@ dependencies = [
[[package]]
name = "pest_derive"
version = "2.3.0"
version = "2.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "905708f7f674518498c1f8d644481440f476d39ca6ecae83319bba7c6c12da91"
checksum = "96504449aa860c8dcde14f9fba5c58dc6658688ca1fe363589d6327b8662c603"
dependencies = [
"pest",
"pest_generator",
@ -3034,9 +3034,9 @@ dependencies = [
[[package]]
name = "pest_generator"
version = "2.3.0"
version = "2.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5803d8284a629cc999094ecd630f55e91b561a1d1ba75e233b00ae13b91a69ad"
checksum = "798e0220d1111ae63d66cb66a5dcb3fc2d986d520b98e49e1852bfdb11d7c5e7"
dependencies = [
"pest",
"pest_meta",
@ -3047,13 +3047,13 @@ dependencies = [
[[package]]
name = "pest_meta"
version = "2.3.0"
version = "2.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1538eb784f07615c6d9a8ab061089c6c54a344c5b4301db51990ca1c241e8c04"
checksum = "984298b75898e30a843e278a9f2452c31e349a073a0ce6fd950a12a74464e065"
dependencies = [
"once_cell",
"pest",
"sha-1",
"sha1",
]
[[package]]
@ -4685,7 +4685,7 @@ dependencies = [
"rustc_macros",
"rustc_serialize",
"scoped-tls",
"sha-1",
"sha1",
"sha2",
"tracing",
"unicode-width",
@ -5094,17 +5094,6 @@ dependencies = [
"serde",
]
[[package]]
name = "sha-1"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f"
dependencies = [
"cfg-if",
"cpufeatures",
"digest",
]
[[package]]
name = "sha1"
version = "0.10.5"
@ -5540,18 +5529,18 @@ checksum = "ceb05e71730d396f960f8f3901cdb41be2d339b303e9d7d3a07c5ff0536e671b"
[[package]]
name = "thiserror"
version = "1.0.33"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d0a539a918745651435ac7db7a18761589a94cd7e94cd56999f828bf73c8a57"
checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.33"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c251e90f708e16c49a16f4917dc2131e75222b72edfa9cb7f7c58ae56aae0c09"
checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
dependencies = [
"proc-macro2",
"quote",
@ -5832,9 +5821,9 @@ dependencies = [
[[package]]
name = "ucd-trie"
version = "0.1.3"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81"
[[package]]
name = "ui_test"

View File

@ -31,11 +31,11 @@ use rustc_span::edition::Edition;
use rustc_span::hygiene::{AstPass, ExpnData, ExpnKind, LocalExpnId};
use rustc_span::source_map::SourceMap;
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::{BytePos, FileName, RealFileName, Span, DUMMY_SP};
use rustc_span::{BytePos, FileName, Span, DUMMY_SP};
use smallvec::{smallvec, SmallVec};
use std::iter;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::rc::Rc;
pub(crate) use rustc_span::hygiene::MacroKind;
@ -1423,8 +1423,10 @@ fn pretty_printing_compatibility_hack(item: &Item, sess: &ParseSess) -> bool {
if let [variant] = &*enum_def.variants {
if variant.ident.name == sym::Input {
let filename = sess.source_map().span_to_filename(item.ident.span);
if let FileName::Real(RealFileName::LocalPath(path)) = filename {
if let Some(c) = path
if let FileName::Real(real) = filename {
if let Some(c) = real
.local_path()
.unwrap_or(Path::new(""))
.components()
.flat_map(|c| c.as_os_str().to_str())
.find(|c| c.starts_with("rental") || c.starts_with("allsorts-rental"))

View File

@ -15,6 +15,6 @@ scoped-tls = "1.0"
unicode-width = "0.1.4"
cfg-if = "1.0"
tracing = "0.1"
sha1 = { package = "sha-1", version = "0.10.0" }
sha1 = "0.10.0"
sha2 = "0.10.1"
md5 = { package = "md-5", version = "0.10.0" }

View File

@ -174,6 +174,11 @@ pub trait Write {
/// This method should generally not be invoked manually, but rather through
/// the [`write!`] macro itself.
///
/// # Errors
///
/// This function will return an instance of [`Error`] on error. Please see
/// [write_str](Write::write_str) for details.
///
/// # Examples
///
/// ```

View File

@ -652,13 +652,14 @@ impl<T> Option<T> {
///
/// # Examples
///
/// Converts an <code>Option<[String]></code> into an <code>Option<[usize]></code>, preserving
/// the original. The [`map`] method takes the `self` argument by value, consuming the original,
/// so this technique uses `as_ref` to first take an `Option` to a reference
/// to the value inside the original.
/// Calculates the length of an <code>Option<[String]></code> as an <code>Option<[usize]></code>
/// without moving the [`String`]. The [`map`] method takes the `self` argument by value,
/// consuming the original, so this technique uses `as_ref` to first take an `Option` to a
/// reference to the value inside the original.
///
/// [`map`]: Option::map
/// [String]: ../../std/string/struct.String.html "String"
/// [`String`]: ../../std/string/struct.String.html "String"
///
/// ```
/// let text: Option<String> = Some("Hello, world!".to_string());
@ -946,8 +947,8 @@ impl<T> Option<T> {
///
/// # Examples
///
/// Converts an <code>Option<[String]></code> into an <code>Option<[usize]></code>, consuming
/// the original:
/// Calculates the length of an <code>Option<[String]></code> as an
/// <code>Option<[usize]></code>, consuming the original:
///
/// [String]: ../../std/string/struct.String.html "String"
/// ```

View File

@ -1786,6 +1786,42 @@ impl<T> AtomicPtr<T> {
// SAFETY: data races are prevented by atomic intrinsics.
unsafe { atomic_xor(self.p.get(), core::ptr::invalid_mut(val), order).cast() }
}
/// Returns a mutable pointer to the underlying pointer.
///
/// Doing non-atomic reads and writes on the resulting integer can be a data race.
/// This method is mostly useful for FFI, where the function signature may use
/// `*mut *mut T` instead of `&AtomicPtr<T>`.
///
/// Returning an `*mut` pointer from a shared reference to this atomic is safe because the
/// atomic types work with interior mutability. All modifications of an atomic change the value
/// through a shared reference, and can do so safely as long as they use atomic operations. Any
/// use of the returned raw pointer requires an `unsafe` block and still has to uphold the same
/// restriction: operations on it must be atomic.
///
/// # Examples
///
/// ```ignore (extern-declaration)
/// #![feature(atomic_mut_ptr)]
//// use std::sync::atomic::AtomicPtr;
///
/// extern "C" {
/// fn my_atomic_op(arg: *mut *mut u32);
/// }
///
/// let mut value = 17;
/// let atomic = AtomicPtr::new(&mut value);
///
/// // SAFETY: Safe as long as `my_atomic_op` is atomic.
/// unsafe {
/// my_atomic_op(atomic.as_mut_ptr());
/// }
/// ```
#[inline]
#[unstable(feature = "atomic_mut_ptr", reason = "recently added", issue = "66893")]
pub fn as_mut_ptr(&self) -> *mut *mut T {
self.p.get()
}
}
#[cfg(target_has_atomic_load_store = "8")]
@ -2678,9 +2714,9 @@ macro_rules! atomic_int {
#[doc = concat!(" fn my_atomic_op(arg: *mut ", stringify!($int_type), ");")]
/// }
///
#[doc = concat!("let mut atomic = ", stringify!($atomic_type), "::new(1);")]
#[doc = concat!("let atomic = ", stringify!($atomic_type), "::new(1);")]
///
// SAFETY: Safe as long as `my_atomic_op` is atomic.
/// // SAFETY: Safe as long as `my_atomic_op` is atomic.
/// unsafe {
/// my_atomic_op(atomic.as_mut_ptr());
/// }

View File

@ -3177,9 +3177,9 @@ impl<'a> IntoIterator for &'a Path {
}
macro_rules! impl_cmp {
($lhs:ty, $rhs: ty) => {
(<$($life:lifetime),*> $lhs:ty, $rhs: ty) => {
#[stable(feature = "partialeq_path", since = "1.6.0")]
impl<'a, 'b> PartialEq<$rhs> for $lhs {
impl<$($life),*> PartialEq<$rhs> for $lhs {
#[inline]
fn eq(&self, other: &$rhs) -> bool {
<Path as PartialEq>::eq(self, other)
@ -3187,7 +3187,7 @@ macro_rules! impl_cmp {
}
#[stable(feature = "partialeq_path", since = "1.6.0")]
impl<'a, 'b> PartialEq<$lhs> for $rhs {
impl<$($life),*> PartialEq<$lhs> for $rhs {
#[inline]
fn eq(&self, other: &$lhs) -> bool {
<Path as PartialEq>::eq(self, other)
@ -3195,7 +3195,7 @@ macro_rules! impl_cmp {
}
#[stable(feature = "cmp_path", since = "1.8.0")]
impl<'a, 'b> PartialOrd<$rhs> for $lhs {
impl<$($life),*> PartialOrd<$rhs> for $lhs {
#[inline]
fn partial_cmp(&self, other: &$rhs) -> Option<cmp::Ordering> {
<Path as PartialOrd>::partial_cmp(self, other)
@ -3203,7 +3203,7 @@ macro_rules! impl_cmp {
}
#[stable(feature = "cmp_path", since = "1.8.0")]
impl<'a, 'b> PartialOrd<$lhs> for $rhs {
impl<$($life),*> PartialOrd<$lhs> for $rhs {
#[inline]
fn partial_cmp(&self, other: &$lhs) -> Option<cmp::Ordering> {
<Path as PartialOrd>::partial_cmp(self, other)
@ -3212,16 +3212,16 @@ macro_rules! impl_cmp {
};
}
impl_cmp!(PathBuf, Path);
impl_cmp!(PathBuf, &'a Path);
impl_cmp!(Cow<'a, Path>, Path);
impl_cmp!(Cow<'a, Path>, &'b Path);
impl_cmp!(Cow<'a, Path>, PathBuf);
impl_cmp!(<> PathBuf, Path);
impl_cmp!(<'a> PathBuf, &'a Path);
impl_cmp!(<'a> Cow<'a, Path>, Path);
impl_cmp!(<'a, 'b> Cow<'a, Path>, &'b Path);
impl_cmp!(<'a> Cow<'a, Path>, PathBuf);
macro_rules! impl_cmp_os_str {
($lhs:ty, $rhs: ty) => {
(<$($life:lifetime),*> $lhs:ty, $rhs: ty) => {
#[stable(feature = "cmp_path", since = "1.8.0")]
impl<'a, 'b> PartialEq<$rhs> for $lhs {
impl<$($life),*> PartialEq<$rhs> for $lhs {
#[inline]
fn eq(&self, other: &$rhs) -> bool {
<Path as PartialEq>::eq(self, other.as_ref())
@ -3229,7 +3229,7 @@ macro_rules! impl_cmp_os_str {
}
#[stable(feature = "cmp_path", since = "1.8.0")]
impl<'a, 'b> PartialEq<$lhs> for $rhs {
impl<$($life),*> PartialEq<$lhs> for $rhs {
#[inline]
fn eq(&self, other: &$lhs) -> bool {
<Path as PartialEq>::eq(self.as_ref(), other)
@ -3237,7 +3237,7 @@ macro_rules! impl_cmp_os_str {
}
#[stable(feature = "cmp_path", since = "1.8.0")]
impl<'a, 'b> PartialOrd<$rhs> for $lhs {
impl<$($life),*> PartialOrd<$rhs> for $lhs {
#[inline]
fn partial_cmp(&self, other: &$rhs) -> Option<cmp::Ordering> {
<Path as PartialOrd>::partial_cmp(self, other.as_ref())
@ -3245,7 +3245,7 @@ macro_rules! impl_cmp_os_str {
}
#[stable(feature = "cmp_path", since = "1.8.0")]
impl<'a, 'b> PartialOrd<$lhs> for $rhs {
impl<$($life),*> PartialOrd<$lhs> for $rhs {
#[inline]
fn partial_cmp(&self, other: &$lhs) -> Option<cmp::Ordering> {
<Path as PartialOrd>::partial_cmp(self.as_ref(), other)
@ -3254,20 +3254,20 @@ macro_rules! impl_cmp_os_str {
};
}
impl_cmp_os_str!(PathBuf, OsStr);
impl_cmp_os_str!(PathBuf, &'a OsStr);
impl_cmp_os_str!(PathBuf, Cow<'a, OsStr>);
impl_cmp_os_str!(PathBuf, OsString);
impl_cmp_os_str!(Path, OsStr);
impl_cmp_os_str!(Path, &'a OsStr);
impl_cmp_os_str!(Path, Cow<'a, OsStr>);
impl_cmp_os_str!(Path, OsString);
impl_cmp_os_str!(&'a Path, OsStr);
impl_cmp_os_str!(&'a Path, Cow<'b, OsStr>);
impl_cmp_os_str!(&'a Path, OsString);
impl_cmp_os_str!(Cow<'a, Path>, OsStr);
impl_cmp_os_str!(Cow<'a, Path>, &'b OsStr);
impl_cmp_os_str!(Cow<'a, Path>, OsString);
impl_cmp_os_str!(<> PathBuf, OsStr);
impl_cmp_os_str!(<'a> PathBuf, &'a OsStr);
impl_cmp_os_str!(<'a> PathBuf, Cow<'a, OsStr>);
impl_cmp_os_str!(<> PathBuf, OsString);
impl_cmp_os_str!(<> Path, OsStr);
impl_cmp_os_str!(<'a> Path, &'a OsStr);
impl_cmp_os_str!(<'a> Path, Cow<'a, OsStr>);
impl_cmp_os_str!(<> Path, OsString);
impl_cmp_os_str!(<'a> &'a Path, OsStr);
impl_cmp_os_str!(<'a, 'b> &'a Path, Cow<'b, OsStr>);
impl_cmp_os_str!(<'a> &'a Path, OsString);
impl_cmp_os_str!(<'a> Cow<'a, Path>, OsStr);
impl_cmp_os_str!(<'a, 'b> Cow<'a, Path>, &'b OsStr);
impl_cmp_os_str!(<'a> Cow<'a, Path>, OsString);
#[stable(since = "1.7.0", feature = "strip_prefix")]
impl fmt::Display for StripPrefixError {

View File

@ -1,8 +1,7 @@
This directory contains the source code of the rust project, including:
This directory contains some source code for the Rust project, including:
- The test suite
- The bootstrapping build system
- Various submodules for tools, like cargo, etc.
- Various submodules for tools, like cargo, tidy, etc.
For more information on how various parts of the compiler work, see the [rustc dev guide].

View File

@ -45,6 +45,7 @@ ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \
python3 ../x.py test --stage 0 src/tools/compiletest && \
python3 ../x.py test --stage 0 core alloc std test proc_macro && \
# Build both public and internal documentation.
RUSTDOCFLAGS=\"--document-private-items --document-hidden-items\" python3 ../x.py doc --stage 0 compiler && \
RUSTDOCFLAGS=\"--document-private-items --document-hidden-items\" python3 ../x.py doc --stage 0 library/test && \
/scripts/validate-toolstate.sh && \
/scripts/validate-error-codes.sh && \

View File

@ -261,7 +261,7 @@ typo mistakes for some common attributes.
## `invalid_html_tags`
This lint is **allowed by default** and is **nightly-only**. It detects unclosed
This lint **warns by default**. It detects unclosed
or invalid HTML tags. For example:
```rust

View File

@ -639,7 +639,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
write!(
buf,
"<div class=\"main-heading\">\
<h1 class=\"fqn\">Rustdoc settings</h1>\
<h1>Rustdoc settings</h1>\
<span class=\"out-of-band\">\
<a id=\"back\" href=\"javascript:void(0)\" onclick=\"history.back();\">\
Back\
@ -677,7 +677,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
write!(
buf,
"<div class=\"main-heading\">\
<h1 class=\"fqn\">Rustdoc help</h1>\
<h1>Rustdoc help</h1>\
<span class=\"out-of-band\">\
<a id=\"back\" href=\"javascript:void(0)\" onclick=\"history.back();\">\
Back\

View File

@ -364,7 +364,7 @@ impl AllTypes {
}
}
f.write_str("<h1 class=\"fqn\">List of all items</h1>");
f.write_str("<h1>List of all items</h1>");
// Note: print_entries does not escape the title, because we know the current set of titles
// doesn't require escaping.
print_entries(f, &self.structs, ItemSection::Structs);
@ -394,7 +394,7 @@ fn scrape_examples_help(shared: &SharedContext<'_>) -> String {
let mut ids = IdMap::default();
format!(
"<div class=\"main-heading\">\
<h1 class=\"fqn\">About scraped examples</h1>\
<h1>About scraped examples</h1>\
</div>\
<div>{}</div>",
Markdown {
@ -513,7 +513,7 @@ fn document_full_inner(
debug!("Doc block: =====\n{}\n=====", s);
if is_collapsible {
w.write_str(
"<details class=\"rustdoc-toggle top-doc\" open>\
"<details class=\"toggle top-doc\" open>\
<summary class=\"hideme\">\
<span>Expand description</span>\
</summary>",
@ -1514,7 +1514,7 @@ fn render_impl(
let toggled = !doc_buffer.is_empty();
if toggled {
let method_toggle_class = if item_type.is_method() { " method-toggle" } else { "" };
write!(w, "<details class=\"rustdoc-toggle{}\" open><summary>", method_toggle_class);
write!(w, "<details class=\"toggle{}\" open><summary>", method_toggle_class);
}
match &*item.kind {
clean::MethodItem(..) | clean::TyMethodItem(_) => {
@ -1730,7 +1730,7 @@ fn render_impl(
close_tags.insert_str(0, "</details>");
write!(
w,
"<details class=\"rustdoc-toggle implementors-toggle\"{}>",
"<details class=\"toggle implementors-toggle\"{}>",
if rendering_params.toggle_open_by_default { " open" } else { "" }
);
write!(w, "<summary>")
@ -2999,7 +2999,7 @@ fn render_call_locations(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Ite
if it.peek().is_some() {
write!(
w,
"<details class=\"rustdoc-toggle more-examples-toggle\">\
"<details class=\"toggle more-examples-toggle\">\
<summary class=\"hideme\">\
<span>More examples</span>\
</summary>\

View File

@ -204,7 +204,7 @@ fn should_hide_fields(n_fields: usize) -> bool {
fn toggle_open(w: &mut Buffer, text: impl fmt::Display) {
write!(
w,
"<details class=\"rustdoc-toggle type-contents-toggle\">\
"<details class=\"toggle type-contents-toggle\">\
<summary class=\"hideme\">\
<span>Show {}</span>\
</summary>",
@ -733,7 +733,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
let toggled = !content.is_empty();
if toggled {
let method_toggle_class = if item_type.is_method() { " method-toggle" } else { "" };
write!(w, "<details class=\"rustdoc-toggle{method_toggle_class}\" open><summary>");
write!(w, "<details class=\"toggle{method_toggle_class}\" open><summary>");
}
write!(w, "<section id=\"{}\" class=\"method has-srclink\">", id);
render_rightside(w, cx, m, t, RenderMode::Normal);
@ -1840,7 +1840,7 @@ fn document_non_exhaustive(w: &mut Buffer, item: &clean::Item) {
if item.is_non_exhaustive() {
write!(
w,
"<details class=\"rustdoc-toggle non-exhaustive\">\
"<details class=\"toggle non-exhaustive\">\
<summary class=\"hideme\"><span>{}</span></summary>\
<div class=\"docblock\">",
{

View File

@ -345,7 +345,7 @@ if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
};
let content = format!(
"<h1 class=\"fqn\">List of all crates</h1><ul class=\"all-items\">{}</ul>",
"<h1>List of all crates</h1><ul class=\"all-items\">{}</ul>",
krates
.iter()
.map(|s| {

View File

@ -139,7 +139,7 @@ h1, h2, h3, h4 {
.docblock > h6:first-child {
margin-top: 0;
}
h1.fqn {
.main-heading h1 {
margin: 0;
padding: 0;
flex-grow: 1;
@ -317,7 +317,7 @@ main {
margin-right: auto;
}
details:not(.rustdoc-toggle) summary {
details:not(.toggle) summary {
margin-bottom: .6em;
}
@ -1401,7 +1401,7 @@ details.dir-entry a {
Unfortunately we can't yet specify contain: content or contain: strict
because the [-]/[+] toggles extend past the boundaries of the <details>
https://developer.mozilla.org/en-US/docs/Web/CSS/contain */
details.rustdoc-toggle {
details.toggle {
contain: layout;
position: relative;
}
@ -1409,26 +1409,26 @@ details.rustdoc-toggle {
/* The hideme class is used on summary tags that contain a span with
placeholder text shown only when the toggle is closed. For instance,
"Expand description" or "Show methods". */
details.rustdoc-toggle > summary.hideme {
details.toggle > summary.hideme {
cursor: pointer;
font-size: 1rem;
}
details.rustdoc-toggle > summary {
details.toggle > summary {
list-style: none;
/* focus outline is shown on `::before` instead of this */
outline: none;
}
details.rustdoc-toggle > summary::-webkit-details-marker,
details.rustdoc-toggle > summary::marker {
details.toggle > summary::-webkit-details-marker,
details.toggle > summary::marker {
display: none;
}
details.rustdoc-toggle > summary.hideme > span {
details.toggle > summary.hideme > span {
margin-left: 9px;
}
details.rustdoc-toggle > summary::before {
details.toggle > summary::before {
background: url("toggle-plus-1092eb4930d581b0.svg") no-repeat top left;
content: "";
cursor: pointer;
@ -1440,14 +1440,14 @@ details.rustdoc-toggle > summary::before {
filter: var(--toggle-filter);
}
details.rustdoc-toggle > summary.hideme > span,
details.toggle > summary.hideme > span,
.more-examples-toggle summary, .more-examples-toggle .hide-more {
color: var(--toggles-color);
}
/* Screen readers see the text version at the end the line.
Visual readers see the icon at the start of the line, but small and transparent. */
details.rustdoc-toggle > summary::after {
details.toggle > summary::after {
content: "Expand";
overflow: hidden;
width: 0;
@ -1455,17 +1455,17 @@ details.rustdoc-toggle > summary::after {
position: absolute;
}
details.rustdoc-toggle > summary.hideme::after {
details.toggle > summary.hideme::after {
/* "hideme" toggles already have a description when they're contracted */
content: "";
}
details.rustdoc-toggle > summary:focus::before,
details.rustdoc-toggle > summary:hover::before {
details.toggle > summary:focus::before,
details.toggle > summary:hover::before {
opacity: 1;
}
details.rustdoc-toggle > summary:focus-visible::before {
details.toggle > summary:focus-visible::before {
/* The SVG is black, and gets turned white using a filter in the dark themes.
Do the same with the outline.
The dotted 1px style is copied from Firefox's focus ring style.
@ -1478,17 +1478,17 @@ details.non-exhaustive {
margin-bottom: 8px;
}
details.rustdoc-toggle > summary.hideme::before {
details.toggle > summary.hideme::before {
position: relative;
}
details.rustdoc-toggle > summary:not(.hideme)::before {
details.toggle > summary:not(.hideme)::before {
position: absolute;
left: -24px;
top: 4px;
}
.impl-items > details.rustdoc-toggle > summary:not(.hideme)::before {
.impl-items > details.toggle > summary:not(.hideme)::before {
position: absolute;
left: -24px;
}
@ -1498,19 +1498,19 @@ details.rustdoc-toggle > summary:not(.hideme)::before {
affect the layout of the items to its right. To do that, we use
absolute positioning. Note that we also set position: relative
on the parent <details> to make this work properly. */
details.rustdoc-toggle[open] > summary.hideme {
details.toggle[open] > summary.hideme {
position: absolute;
}
details.rustdoc-toggle[open] > summary.hideme > span {
details.toggle[open] > summary.hideme > span {
display: none;
}
details.rustdoc-toggle[open] > summary::before {
details.toggle[open] > summary::before {
background: url("toggle-minus-31bbd6e4c77f5c96.svg") no-repeat top left;
}
details.rustdoc-toggle[open] > summary::after {
details.toggle[open] > summary::after {
content: "Collapse";
}
@ -1660,8 +1660,8 @@ in storage.js
display: block;
}
#main-content > details.rustdoc-toggle > summary::before,
#main-content > div > details.rustdoc-toggle > summary::before {
#main-content > details.toggle > summary::before,
#main-content > div > details.toggle > summary::before {
left: -11px;
}
@ -1715,12 +1715,12 @@ in storage.js
}
/* Position of the "[-]" element. */
details.rustdoc-toggle:not(.top-doc) > summary {
details.toggle:not(.top-doc) > summary {
margin-left: 10px;
}
.impl-items > details.rustdoc-toggle > summary:not(.hideme)::before,
#main-content > details.rustdoc-toggle:not(.top-doc) > summary::before,
#main-content > div > details.rustdoc-toggle > summary::before {
.impl-items > details.toggle > summary:not(.hideme)::before,
#main-content > details.toggle:not(.top-doc) > summary::before,
#main-content > div > details.toggle > summary::before {
left: -11px;
}
@ -1753,8 +1753,8 @@ in storage.js
@media print {
nav.sidebar, nav.sub, .out-of-band, a.srclink, #copy-path,
details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle > summary::before,
details.rustdoc-toggle.top-doc > summary {
details.toggle[open] > summary::before, details.toggle > summary::before,
details.toggle.top-doc > summary {
display: none;
}
@ -1796,24 +1796,24 @@ in storage.js
.impl,
#implementors-list > .docblock,
.impl-items > section,
.impl-items > .rustdoc-toggle > summary,
.impl-items > .toggle > summary,
.methods > section,
.methods > .rustdoc-toggle > summary
.methods > .toggle > summary
{
margin-bottom: 0.75em;
}
.variants > .docblock,
.implementors-toggle > .docblock,
.impl-items > .rustdoc-toggle[open]:not(:last-child),
.methods > .rustdoc-toggle[open]:not(:last-child),
.impl-items > .toggle[open]:not(:last-child),
.methods > .toggle[open]:not(:last-child),
.implementors-toggle[open]:not(:last-child) {
margin-bottom: 2em;
}
#trait-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
#synthetic-implementations-list .impl-items > .rustdoc-toggle:not(:last-child),
#blanket-implementations-list .impl-items > .rustdoc-toggle:not(:last-child) {
#trait-implementations-list .impl-items > .toggle:not(:last-child),
#synthetic-implementations-list .impl-items > .toggle:not(:last-child),
#blanket-implementations-list .impl-items > .toggle:not(:last-child) {
margin-bottom: 1em;
}

View File

@ -9,7 +9,7 @@
}
.setting-line .radio-line input,
.setting-line .toggle input {
.setting-line .settings-toggle input {
margin-right: 0.3em;
height: 1.2rem;
width: 1.2rem;
@ -22,14 +22,14 @@
.setting-line .radio-line input {
border-radius: 50%;
}
.setting-line .toggle input:checked {
.setting-line .settings-toggle input:checked {
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">\
<path d="M7,25L17,32L33,12" fill="none" stroke="black" stroke-width="5"/>\
<path d="M7,23L17,30L33,10" fill="none" stroke="white" stroke-width="5"/></svg>');
}
.setting-line .radio-line input + span,
.setting-line .toggle span {
.setting-line .settings-toggle span {
padding-bottom: 1px;
}
@ -50,7 +50,7 @@
margin-left: 0.5em;
}
.toggle {
.settings-toggle {
position: relative;
width: 100%;
margin-right: 20px;
@ -67,11 +67,11 @@
box-shadow: inset 0 0 0 3px var(--main-background-color);
background-color: var(--settings-input-color);
}
.setting-line .toggle input:checked {
.setting-line .settings-toggle input:checked {
background-color: var(--settings-input-color);
}
.setting-line .radio-line input:focus,
.setting-line .toggle input:focus {
.setting-line .settings-toggle input:focus {
box-shadow: 0 0 1px 1px var(--settings-input-color);
}
/* In here we combine both `:focus` and `:checked` properties. */
@ -80,6 +80,6 @@
0 0 2px 2px var(--settings-input-color);
}
.setting-line .radio-line input:hover,
.setting-line .toggle input:hover {
.setting-line .settings-toggle input:hover {
border-color: var(--settings-input-color) !important;
}

View File

@ -526,7 +526,7 @@ function loadCss(cssUrl) {
}
let currentNbImpls = implementors.getElementsByClassName("impl").length;
const traitName = document.querySelector("h1.fqn > .trait").textContent;
const traitName = document.querySelector(".main-heading h1 > .trait").textContent;
const baseIdName = "impl-" + traitName + "-";
const libs = Object.getOwnPropertyNames(imp);
// We don't want to include impls from this JS file, when the HTML already has them.
@ -620,7 +620,7 @@ function loadCss(cssUrl) {
function expandAllDocs() {
const innerToggle = document.getElementById(toggleAllDocsId);
removeClass(innerToggle, "will-expand");
onEachLazy(document.getElementsByClassName("rustdoc-toggle"), e => {
onEachLazy(document.getElementsByClassName("toggle"), e => {
if (!hasClass(e, "type-contents-toggle") && !hasClass(e, "more-examples-toggle")) {
e.open = true;
}
@ -632,7 +632,7 @@ function loadCss(cssUrl) {
function collapseAllDocs() {
const innerToggle = document.getElementById(toggleAllDocsId);
addClass(innerToggle, "will-expand");
onEachLazy(document.getElementsByClassName("rustdoc-toggle"), e => {
onEachLazy(document.getElementsByClassName("toggle"), e => {
if (e.parentNode.id !== "implementations-list" ||
(!hasClass(e, "implementors-toggle") &&
!hasClass(e, "type-contents-toggle"))
@ -680,7 +680,7 @@ function loadCss(cssUrl) {
setImplementorsTogglesOpen("blanket-implementations-list", false);
}
onEachLazy(document.getElementsByClassName("rustdoc-toggle"), e => {
onEachLazy(document.getElementsByClassName("toggle"), e => {
if (!hideLargeItemContents && hasClass(e, "type-contents-toggle")) {
e.open = true;
}
@ -823,7 +823,7 @@ function loadCss(cssUrl) {
});
});
onEachLazy(document.querySelectorAll(".rustdoc-toggle > summary:not(.hideme)"), el => {
onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"), el => {
el.addEventListener("click", e => {
if (e.target.tagName !== "SUMMARY" && e.target.tagName !== "A") {
e.preventDefault();

View File

@ -150,10 +150,10 @@
});
output += "</div></div>";
} else {
// This is a toggle.
// This is a checkbox toggle.
const checked = setting["default"] === true ? " checked" : "";
output += `\
<label class="toggle">\
<label class="settings-toggle">\
<input type="checkbox" id="${js_data_name}"${checked}>\
<span class="label">${setting_name}</span>\
</label>`;

View File

@ -1,5 +1,5 @@
<div class="main-heading"> {#- -#}
<h1 class="fqn"> {#- -#}
<h1> {#- -#}
{{-typ-}}
{#- The breadcrumbs of the item path, like std::string -#}
{%- for component in path_components -%}

View File

@ -97,17 +97,7 @@ impl<'a, 'tcx> DocFolder for Stripper<'a, 'tcx> {
}
// handled in the `strip-priv-imports` pass
clean::ExternCrateItem { .. } => {}
clean::ImportItem(ref imp) => {
// Because json doesn't inline imports from private modules, we need to mark
// the imported item as retained so it's impls won't be stripped.
//
// FIXME: Is it necessary to check for json output here: See
// https://github.com/rust-lang/rust/pull/100325#discussion_r941495215
if let Some(did) = imp.source.did && self.is_json_output {
self.retained.insert(did.into());
}
}
clean::ExternCrateItem { .. } | clean::ImportItem(_) => {}
clean::ImplItem(..) => {}

View File

@ -217,7 +217,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
"serde",
"serde_derive",
"serde_json",
"sha-1",
"sha1",
"sha2",
"sharded-slab",
"smallvec",

View File

@ -2,7 +2,7 @@
define-function: (
"check-colors",
(theme, main_color, title_color, fqn_color, fqn_type_color, src_link_color, sidebar_link_color),
(theme, main_color, title_color, main_heading_color, main_heading_type_color, src_link_color, sidebar_link_color),
block {
goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
// This is needed to ensure that the text color is computed.
@ -14,8 +14,8 @@ define-function: (
reload:
assert-css: ("#toggle-all-docs", {"color": |main_color|})
assert-css: (".fqn a:nth-of-type(1)", {"color": |fqn_color|})
assert-css: (".fqn a:nth-of-type(2)", {"color": |fqn_type_color|})
assert-css: (".main-heading h1 a:nth-of-type(1)", {"color": |main_heading_color|})
assert-css: (".main-heading a:nth-of-type(2)", {"color": |main_heading_type_color|})
assert-css: (
".rightside .srclink",
{"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|},
@ -57,7 +57,7 @@ define-function: (
assert-css: ("#top-doc-prose-title", {"color": |title_color|})
assert-css: (".sidebar a", {"color": |sidebar_link_color|})
assert-css: ("h1.fqn a", {"color": |title_color|})
assert-css: (".main-heading h1 a", {"color": |title_color|})
// We move the cursor over the "Implementations" title so the anchor is displayed.
move-cursor-to: "h2#implementations"
@ -77,8 +77,8 @@ call-function: (
"theme": "ayu",
"main_color": "rgb(197, 197, 197)",
"title_color": "rgb(255, 255, 255)",
"fqn_color": "rgb(255, 255, 255)",
"fqn_type_color": "rgb(255, 160, 165)",
"main_heading_color": "rgb(255, 255, 255)",
"main_heading_type_color": "rgb(255, 160, 165)",
"src_link_color": "rgb(57, 175, 215)",
"sidebar_link_color": "rgb(83, 177, 219)",
},
@ -89,8 +89,8 @@ call-function: (
"theme": "dark",
"main_color": "rgb(221, 221, 221)",
"title_color": "rgb(221, 221, 221)",
"fqn_color": "rgb(221, 221, 221)",
"fqn_type_color": "rgb(45, 191, 184)",
"main_heading_color": "rgb(221, 221, 221)",
"main_heading_type_color": "rgb(45, 191, 184)",
"src_link_color": "rgb(210, 153, 29)",
"sidebar_link_color": "rgb(253, 191, 53)",
},
@ -101,8 +101,8 @@ call-function: (
"theme": "light",
"main_color": "rgb(0, 0, 0)",
"title_color": "rgb(0, 0, 0)",
"fqn_color": "rgb(0, 0, 0)",
"fqn_type_color": "rgb(173, 55, 138)",
"main_heading_color": "rgb(0, 0, 0)",
"main_heading_type_color": "rgb(173, 55, 138)",
"src_link_color": "rgb(56, 115, 173)",
"sidebar_link_color": "rgb(53, 109, 164)",
},

View File

@ -13,7 +13,7 @@
// 14px 0.875rem
goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
assert-css: ("h1.fqn", {"font-size": "24px"})
assert-css: (".main-heading h1", {"font-size": "24px"})
assert-css: ("h2#top-doc-prose-title", {"font-size": "22px"})
assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})
@ -52,7 +52,7 @@ assert-css: ("h6#sub-sub-heading-for-struct-impl-item-doc", {"font-size": "14px"
goto: "file://" + |DOC_PATH| + "/test_docs/enum.HeavilyDocumentedEnum.html"
assert-css: ("h1.fqn", {"font-size": "24px"})
assert-css: (".main-heading h1", {"font-size": "24px"})
assert-css: ("h2#top-doc-prose-title", {"font-size": "22px"})
assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})
@ -111,7 +111,7 @@ assert-css: ("//ul[@class='block mod']/preceding-sibling::h3", {"border-bottom-w
goto: "file://" + |DOC_PATH| + "/test_docs/union.HeavilyDocumentedUnion.html"
assert-css: ("h1.fqn", {"font-size": "24px"})
assert-css: (".main-heading h1", {"font-size": "24px"})
assert-css: ("h2#top-doc-prose-title", {"font-size": "22px"})
assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})
@ -143,7 +143,7 @@ assert-css: ("h6#sub-heading-for-union-impl-item-doc", {"border-bottom-width": "
goto: "file://" + |DOC_PATH| + "/test_docs/macro.heavily_documented_macro.html"
assert-css: ("h1.fqn", {"font-size": "24px"})
assert-css: (".main-heading h1", {"font-size": "24px"})
assert-css: ("h2#top-doc-prose-title", {"font-size": "22px"})
assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})

View File

@ -1,18 +1,18 @@
// This test ensures that the margins on methods are coherent inside an impl block.
goto: "file://" + |DOC_PATH| + "/test_docs/trait_members/struct.HasTrait.html#impl-TraitMembers-for-HasTrait"
assert-count: ("#trait-implementations-list > .rustdoc-toggle", 1)
assert-count: ("#trait-implementations-list > .toggle", 1)
compare-elements-css: (
// compare margin on type with margin on method
"#trait-implementations-list .impl-items > .rustdoc-toggle:nth-child(1) > summary",
"#trait-implementations-list .impl-items > .rustdoc-toggle:nth-child(2) > summary",
"#trait-implementations-list .impl-items > .toggle:nth-child(1) > summary",
"#trait-implementations-list .impl-items > .toggle:nth-child(2) > summary",
["margin"]
)
compare-elements-css: (
// compare margin on type with margin on method
"#trait-implementations-list .impl-items > .rustdoc-toggle:nth-child(1)",
"#trait-implementations-list .impl-items > .rustdoc-toggle:nth-child(2)",
"#trait-implementations-list .impl-items > .toggle:nth-child(1)",
"#trait-implementations-list .impl-items > .toggle:nth-child(2)",
["margin"]
)

View File

@ -3,17 +3,17 @@
// First, we check that the first page doesn't have the string we're looking for to ensure
// that the feature is changing page as expected.
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-text-false: (".fqn", "Struct test_docs::Foo")
assert-text-false: (".main-heading h1", "Struct test_docs::Foo")
// We now check that we land on the search result page if "go_to_first" isn't set.
goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=struct%3AFoo"
// Waiting for the search results to appear...
wait-for: "#search-tabs"
assert-text-false: (".fqn", "Struct test_docs::Foo")
assert-text-false: (".main-heading h1", "Struct test_docs::Foo")
// Ensure that the search results are displayed, not the "normal" content.
assert-css: ("#main-content", {"display": "none"})
// Now we can check that the feature is working as expected!
goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=struct%3AFoo&go_to_first=true"
// Waiting for the page to load...
wait-for-text: (".fqn", "Struct test_docs::Foo")
wait-for-text: (".main-heading h1", "Struct test_docs::Foo")

View File

@ -159,7 +159,7 @@ assert-text: ("#preferred-light-theme .setting-name", "Preferred light theme")
// We now check that clicking on the toggles' text is like clicking on the checkbox.
// To test it, we use the "Disable keyboard shortcuts".
local-storage: {"rustdoc-disable-shortcuts": "false"}
click: ".setting-line:last-child .toggle .label"
click: ".setting-line:last-child .settings-toggle .label"
assert-local-storage: {"rustdoc-disable-shortcuts": "true"}
// Make sure that "Disable keyboard shortcuts" actually took effect.
@ -169,7 +169,7 @@ assert-false: "#help-button .popover"
wait-for-css: ("#settings-menu .popover", {"display": "block"})
// Now turn keyboard shortcuts back on, and see if they work.
click: ".setting-line:last-child .toggle .label"
click: ".setting-line:last-child .settings-toggle .label"
assert-local-storage: {"rustdoc-disable-shortcuts": "false"}
press-key: "Escape"
press-key: "?"

View File

@ -1,15 +1,15 @@
// This test ensures that clicking on a method summary, but not on the "[-]",
// doesn't toggle the <details>.
goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
assert-attribute: (".impl-items .rustdoc-toggle", {"open": ""})
assert-attribute: (".impl-items .toggle", {"open": ""})
click: "h4.code-header" // This is the position of "pub" in "pub fn a_method"
assert-attribute: (".impl-items .rustdoc-toggle", {"open": ""})
assert-attribute: (".impl-items .toggle", {"open": ""})
click-with-offset: (
".impl-items .rustdoc-toggle summary",
".impl-items .toggle summary",
{"x": -24, "y": 8}, // This is the position of "[-]" next to that pub fn.
)
assert-attribute-false: (".impl-items .rustdoc-toggle", {"open": ""})
assert-attribute-false: (".impl-items .toggle", {"open": ""})
// Click the "Trait" part of "impl Trait" and verify it navigates.
click: "#impl-Trait-for-Foo h3 a:first-of-type"
assert-text: (".fqn", "Trait lib2::Trait")
assert-text: (".main-heading h1", "Trait lib2::Trait")

View File

@ -20,10 +20,10 @@ assert-text: ("#toggle-all-docs", "[]")
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
// We first check that everything is visible.
assert-text: ("#toggle-all-docs", "[]")
assert-attribute: ("#implementations-list details.rustdoc-toggle", {"open": ""}, ALL)
assert-attribute: ("#trait-implementations-list details.rustdoc-toggle", {"open": ""}, ALL)
assert-attribute: ("#implementations-list details.toggle", {"open": ""}, ALL)
assert-attribute: ("#trait-implementations-list details.toggle", {"open": ""}, ALL)
assert-attribute-false: (
"#blanket-implementations-list > details.rustdoc-toggle",
"#blanket-implementations-list > details.toggle",
{"open": ""},
ALL,
)
@ -32,18 +32,18 @@ assert-attribute-false: (
click: "#toggle-all-docs"
wait-for-text: ("#toggle-all-docs", "[+]")
// We check that all <details> are collapsed (except for the impl block ones).
assert-attribute-false: ("details.rustdoc-toggle:not(.implementors-toggle)", {"open": ""}, ALL)
assert-attribute-false: ("details.toggle:not(.implementors-toggle)", {"open": ""}, ALL)
assert-attribute: ("#implementations-list > details.implementors-toggle", {"open": ""})
// We now check that the other impl blocks are collapsed.
assert-attribute-false: (
"#blanket-implementations-list > details.rustdoc-toggle.implementors-toggle",
"#blanket-implementations-list > details.toggle.implementors-toggle",
{"open": ""},
ALL,
)
// We open them all again.
click: "#toggle-all-docs"
wait-for-text: ("#toggle-all-docs", "[]")
assert-attribute: ("details.rustdoc-toggle", {"open": ""}, ALL)
assert-attribute: ("details.toggle", {"open": ""}, ALL)
// Checking the toggles style.
show-text: true
@ -56,12 +56,12 @@ define-function: (
// We reload the page so the local storage settings are being used.
reload:
assert-css: ("details.rustdoc-toggle > summary::before", {
assert-css: ("details.toggle > summary::before", {
"opacity": "0.5",
"filter": |filter|,
}, ALL)
move-cursor-to: "details.rustdoc-toggle summary"
assert-css: ("details.rustdoc-toggle > summary:hover::before", {
move-cursor-to: "details.toggle summary"
assert-css: ("details.toggle > summary:hover::before", {
"opacity": "1",
"filter": |filter|,
})

View File

@ -2,4 +2,4 @@
// has all the implementations toggled open by default, so users can
// find method names in those implementations with Ctrl-F.
goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert-attribute: (".rustdoc-toggle.implementors-toggle", {"open": ""})
assert-attribute: (".toggle.implementors-toggle", {"open": ""})

View File

@ -5,7 +5,7 @@
#![crate_name = "foo"]
// @has foo/../index.html
// @has - '//h1[@class="fqn"]' 'List of all crates'
// @has - '//h1' 'List of all crates'
// @has - '//ul[@class="all-items"]//a[@href="foo/index.html"]' 'foo'
// @has - '//ul[@class="all-items"]//a[@href="all_item_types/index.html"]' 'all_item_types'
pub struct Foo;

View File

@ -5,7 +5,7 @@
// @!hasraw - '<span class="attr">#[outer]</span>'
// @hasraw - '#![inner]</span>'
// @!hasraw - '<span class="attr">#![inner]</span>'
// @snapshot 'codeblock' - '//*[@class="rustdoc-toggle top-doc"]/*[@class="docblock"]//pre/code'
// @snapshot 'codeblock' - '//*[@class="toggle top-doc"]/*[@class="docblock"]//pre/code'
/// ```no_run
/// # # space

View File

@ -7,7 +7,7 @@
// @has foo/index.html '//div[@class="sidebar-elems"]//li/a' 'Keywords'
// @has foo/index.html '//div[@class="sidebar-elems"]//li/a/@href' '#keywords'
// @has foo/keyword.match.html '//a[@class="keyword"]' 'match'
// @has foo/keyword.match.html '//h1[@class="fqn"]' 'Keyword match'
// @has foo/keyword.match.html '//h1' 'Keyword match'
// @has foo/keyword.match.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// @has foo/index.html '//a/@href' '../foo/index.html'
// @!has foo/foo/index.html

View File

@ -4,7 +4,7 @@
#![crate_name = "foo"]
// @has 'foo/fn.g.html'
// @has - '//*[@class="rustdoc-toggle top-doc"]/*[@class="docblock"]' \
// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' \
// 'outer module inner module'
mod inner_mod {

View File

@ -1,7 +1,7 @@
#![crate_name = "foo"]
// @has 'foo/struct.S1.html'
// @snapshot S1_top-doc - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]'
// @snapshot S1_top-doc - '//details[@class="toggle top-doc"]/div[@class="docblock"]'
#[doc = "Hello world!\n\n"]
/// Goodbye!
@ -9,7 +9,7 @@
pub struct S1;
// @has 'foo/struct.S2.html'
// @snapshot S2_top-doc - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]'
// @snapshot S2_top-doc - '//details[@class="toggle top-doc"]/div[@class="docblock"]'
/// Hello world!
///
@ -18,7 +18,7 @@ pub struct S1;
pub struct S2;
// @has 'foo/struct.S3.html'
// @snapshot S3_top-doc - '//details[@class="rustdoc-toggle top-doc"]/div[@class="docblock"]'
// @snapshot S3_top-doc - '//details[@class="toggle top-doc"]/div[@class="docblock"]'
/** Par 1
*/ ///
/// Par 2

View File

@ -21,14 +21,14 @@ mod c {
}
// @has 'foo/struct.Type.html'
// @has - '//*[@class="rustdoc-toggle top-doc"]/*[@class="docblock"]' 'foo 2 1'
// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'foo 2 1'
/// foo
pub use b::Type;
// @has 'foo/struct.Whatever.html'
// @has - '//*[@class="rustdoc-toggle top-doc"]/*[@class="docblock"]' 'whatever 3 2 1'
// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'whatever 3 2 1'
/// whatever
pub use c::Type as Whatever;
// @has 'foo/struct.Woof.html'
// @has - '//*[@class="rustdoc-toggle top-doc"]/*[@class="docblock"]' 'a dog 4 2 1'
// @has - '//*[@class="toggle top-doc"]/*[@class="docblock"]' 'a dog 4 2 1'
/// a dog
pub use c::Woof;

View File

@ -9,7 +9,7 @@
// @has - '//div[@class="sidebar-elems"]//li/a/@href' '#primitives'
// @has foo/primitive.reference.html
// @has - '//a[@class="primitive"]' 'reference'
// @has - '//h1[@class="fqn"]' 'Primitive Type reference'
// @has - '//h1' 'Primitive Type reference'
// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// There should be only one implementation listed.

View File

@ -4,7 +4,7 @@
#![feature(rustdoc_internals)]
// @has foo/primitive.slice.html '//a[@class="primitive"]' 'slice'
// @has - '//h1[@class="fqn"]' 'Primitive Type slice'
// @has - '//h1' 'Primitive Type slice'
// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// @has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl<T> Send for [T]where T: Send'

View File

@ -4,7 +4,7 @@
#![feature(rustdoc_internals)]
// @has foo/primitive.tuple.html '//a[@class="primitive"]' 'tuple'
// @has - '//h1[@class="fqn"]' 'Primitive Type tuple'
// @has - '//h1' 'Primitive Type tuple'
// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// @has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'Send'

View File

@ -4,7 +4,7 @@
#![feature(rustdoc_internals)]
// @has foo/primitive.unit.html '//a[@class="primitive"]' 'unit'
// @has - '//h1[@class="fqn"]' 'Primitive Type unit'
// @has - '//h1' 'Primitive Type unit'
// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// @has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl Send for ()'

View File

@ -7,7 +7,7 @@
// @has foo/index.html '//div[@class="sidebar-elems"]//li/a' 'Primitive Types'
// @has foo/index.html '//div[@class="sidebar-elems"]//li/a/@href' '#primitives'
// @has foo/primitive.i32.html '//a[@class="primitive"]' 'i32'
// @has foo/primitive.i32.html '//h1[@class="fqn"]' 'Primitive Type i32'
// @has foo/primitive.i32.html '//h1' 'Primitive Type i32'
// @has foo/primitive.i32.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// @has foo/index.html '//a/@href' '../foo/index.html'
// @!has foo/index.html '//span' '🔒'

View File

@ -4,7 +4,7 @@
// block doc comments can have their lines starting with a star.
// @has foo/fn.foo.html
// @snapshot docblock - '//*[@class="rustdoc-toggle top-doc"]//*[@class="docblock"]'
// @snapshot docblock - '//*[@class="toggle top-doc"]//*[@class="docblock"]'
/**
* a
*/

View File

@ -1,15 +1,15 @@
#![allow(unused)]
// @has 'toggle_item_contents/struct.PubStruct.html'
// @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
// @count - '//details[@class="toggle type-contents-toggle"]' 0
pub struct PubStruct {
pub a: usize,
pub b: usize,
}
// @has 'toggle_item_contents/struct.BigPubStruct.html'
// @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
// @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show 13 fields'
// @count - '//details[@class="toggle type-contents-toggle"]' 1
// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 13 fields'
pub struct BigPubStruct {
pub a: usize,
pub b: usize,
@ -27,8 +27,8 @@ pub struct BigPubStruct {
}
// @has 'toggle_item_contents/union.BigUnion.html'
// @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
// @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show 13 fields'
// @count - '//details[@class="toggle type-contents-toggle"]' 1
// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 13 fields'
pub union BigUnion {
pub a: usize,
pub b: usize,
@ -46,7 +46,7 @@ pub union BigUnion {
}
// @has 'toggle_item_contents/union.Union.html'
// @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
// @count - '//details[@class="toggle type-contents-toggle"]' 0
pub union Union {
pub a: usize,
pub b: usize,
@ -54,7 +54,7 @@ pub union Union {
}
// @has 'toggle_item_contents/struct.PrivStruct.html'
// @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
// @count - '//details[@class="toggle type-contents-toggle"]' 0
// @has - '//div[@class="item-decl"]' '/* private fields */'
pub struct PrivStruct {
a: usize,
@ -62,7 +62,7 @@ pub struct PrivStruct {
}
// @has 'toggle_item_contents/enum.Enum.html'
// @!has - '//details[@class="rustdoc-toggle type-contents-toggle"]' ''
// @!has - '//details[@class="toggle type-contents-toggle"]' ''
pub enum Enum {
A, B, C,
D {
@ -72,7 +72,7 @@ pub enum Enum {
}
// @has 'toggle_item_contents/enum.EnumStructVariant.html'
// @!has - '//details[@class="rustdoc-toggle type-contents-toggle"]' ''
// @!has - '//details[@class="toggle type-contents-toggle"]' ''
pub enum EnumStructVariant {
A, B, C,
D {
@ -81,14 +81,14 @@ pub enum EnumStructVariant {
}
// @has 'toggle_item_contents/enum.LargeEnum.html'
// @count - '//*[@class="rust enum"]//details[@class="rustdoc-toggle type-contents-toggle"]' 1
// @has - '//*[@class="rust enum"]//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show 13 variants'
// @count - '//*[@class="rust enum"]//details[@class="toggle type-contents-toggle"]' 1
// @has - '//*[@class="rust enum"]//details[@class="toggle type-contents-toggle"]' 'Show 13 variants'
pub enum LargeEnum {
A, B, C, D, E, F(u8), G, H, I, J, K, L, M
}
// @has 'toggle_item_contents/trait.Trait.html'
// @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
// @count - '//details[@class="toggle type-contents-toggle"]' 0
pub trait Trait {
type A;
#[must_use]
@ -97,8 +97,8 @@ pub trait Trait {
}
// @has 'toggle_item_contents/trait.GinormousTrait.html'
// @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
// @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show 16 associated items'
// @count - '//details[@class="toggle type-contents-toggle"]' 1
// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 16 associated items'
pub trait GinormousTrait {
type A;
type B;
@ -120,8 +120,8 @@ pub trait GinormousTrait {
}
// @has 'toggle_item_contents/trait.HugeTrait.html'
// @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
// @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show 12 associated constants and 2 methods'
// @count - '//details[@class="toggle type-contents-toggle"]' 1
// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 12 associated constants and 2 methods'
pub trait HugeTrait {
type A;
const M: usize = 1;
@ -142,8 +142,8 @@ pub trait HugeTrait {
}
// @has 'toggle_item_contents/trait.GiganticTrait.html'
// @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
// @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show 1 associated constant and 1 method'
// @count - '//details[@class="toggle type-contents-toggle"]' 1
// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 1 associated constant and 1 method'
pub trait GiganticTrait {
type A;
type B;
@ -163,8 +163,8 @@ pub trait GiganticTrait {
}
// @has 'toggle_item_contents/trait.BigTrait.html'
// @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 1
// @has - '//details[@class="rustdoc-toggle type-contents-toggle"]' 'Show 14 methods'
// @count - '//details[@class="toggle type-contents-toggle"]' 1
// @has - '//details[@class="toggle type-contents-toggle"]' 'Show 14 methods'
pub trait BigTrait {
type A;
#[must_use]

View File

@ -4,9 +4,9 @@
// summary. Struct methods with no documentation should not be wrapped.
//
// @has foo/struct.Foo.html
// @has - '//details[@class="rustdoc-toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented()'
// @has - '//details[@class="rustdoc-toggle method-toggle"]//*[@class="docblock"]' 'is_documented is documented'
// @!has - '//details[@class="rustdoc-toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented()'
// @has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented()'
// @has - '//details[@class="toggle method-toggle"]//*[@class="docblock"]' 'is_documented is documented'
// @!has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented()'
pub struct Foo {
}

View File

@ -4,14 +4,14 @@
// summary. Trait methods with no documentation should not be wrapped.
//
// @has foo/trait.Foo.html
// @has - '//details[@class="rustdoc-toggle"]//summary//h4[@class="code-header"]' 'type Item'
// @!has - '//details[@class="rustdoc-toggle"]//summary//h4[@class="code-header"]' 'type Item2'
// @has - '//details[@class="rustdoc-toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented()'
// @!has - '//details[@class="rustdoc-toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented()'
// @has - '//details[@class="rustdoc-toggle method-toggle"]//*[@class="docblock"]' 'is_documented is documented'
// @has - '//details[@class="rustdoc-toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented_optional()'
// @!has - '//details[@class="rustdoc-toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented_optional()'
// @has - '//details[@class="rustdoc-toggle method-toggle"]//*[@class="docblock"]' 'is_documented_optional is documented'
// @has - '//details[@class="toggle"]//summary//h4[@class="code-header"]' 'type Item'
// @!has - '//details[@class="toggle"]//summary//h4[@class="code-header"]' 'type Item2'
// @has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented()'
// @!has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented()'
// @has - '//details[@class="toggle method-toggle"]//*[@class="docblock"]' 'is_documented is documented'
// @has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented_optional()'
// @!has - '//details[@class="toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented_optional()'
// @has - '//details[@class="toggle method-toggle"]//*[@class="docblock"]' 'is_documented_optional is documented'
pub trait Foo {
/// is documented
type Item;

View File

@ -0,0 +1,179 @@
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
= note: `#[deny(proc_macro_back_compat)]` on by default
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
error: aborting due to 8 previous errors
Future incompatibility report: Future breakage diagnostic:
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
= note: `#[deny(proc_macro_back_compat)]` on by default
Future breakage diagnostic:
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
= note: `#[deny(proc_macro_back_compat)]` on by default
Future breakage diagnostic:
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
= note: `#[deny(proc_macro_back_compat)]` on by default
Future breakage diagnostic:
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
= note: `#[deny(proc_macro_back_compat)]` on by default
Future breakage diagnostic:
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
= note: `#[deny(proc_macro_back_compat)]` on by default
Future breakage diagnostic:
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
= note: `#[deny(proc_macro_back_compat)]` on by default
Future breakage diagnostic:
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
= note: `#[deny(proc_macro_back_compat)]` on by default
Future breakage diagnostic:
error: using an old version of `rental`
--> remapped/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
|
LL | enum ProceduralMasqueradeDummyType {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
= note: `#[deny(proc_macro_back_compat)]` on by default

View File

@ -0,0 +1,44 @@
PRINT-DERIVE INPUT (DISPLAY): enum ProceduralMasqueradeDummyType { Input, }
PRINT-DERIVE RE-COLLECTED (DISPLAY): enum ProceduralMasqueradeDummyType { Input }
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "enum",
span: remapped/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:1: 4:5 (#0),
},
Ident {
ident: "ProceduralMasqueradeDummyType",
span: remapped/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6: 4:35 (#0),
},
Group {
delimiter: Brace,
stream: TokenStream [
Ident {
ident: "Input",
span: remapped/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:13:5: 13:10 (#0),
},
],
span: remapped/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:36: 14:2 (#0),
},
]
PRINT-DERIVE INPUT (DISPLAY): enum ProceduralMasqueradeDummyType { Input, }
PRINT-DERIVE RE-COLLECTED (DISPLAY): enum ProceduralMasqueradeDummyType { Input }
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "enum",
span: remapped/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs:4:1: 4:5 (#0),
},
Ident {
ident: "ProceduralMasqueradeDummyType",
span: remapped/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6: 4:35 (#0),
},
Group {
delimiter: Brace,
stream: TokenStream [
Ident {
ident: "Input",
span: remapped/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs:13:5: 13:10 (#0),
},
],
span: remapped/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs:4:36: 14:2 (#0),
},
]

View File

@ -1,5 +1,11 @@
// aux-build:test-macros.rs
// compile-flags: -Z span-debug
// revisions: local remapped
// [remapped]compile-flags: --remap-path-prefix={{src-base}}=remapped
// The remapped paths are not normalized by compiletest.
// normalize-stdout-test: "\\(proc-macro|pretty-print-hack)" -> "/$1"
// normalize-stderr-test: "\\(proc-macro|pretty-print-hack)" -> "/$1"
#![no_std] // Don't load unnecessary hygiene information from std
extern crate std;