Fix incorrectly spelled "variadic"
This commit is contained in:
parent
9f6dcceef0
commit
9b31323b8f
14 changed files with 23 additions and 23 deletions
|
@ -402,8 +402,8 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
|
||||||
gate_feature_post!(self, rustdoc_internals, attr.span, msg);
|
gate_feature_post!(self, rustdoc_internals, attr.span, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if nested_meta.has_name(sym::tuple_varadic) {
|
if nested_meta.has_name(sym::tuple_variadic) {
|
||||||
let msg = "`#[doc(tuple_varadic)]` is meant for internal use only";
|
let msg = "`#[doc(tuple_variadic)]` is meant for internal use only";
|
||||||
gate_feature_post!(self, rustdoc_internals, attr.span, msg);
|
gate_feature_post!(self, rustdoc_internals, attr.span, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -804,7 +804,7 @@ impl CheckAttrVisitor<'_> {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_doc_tuple_varadic(&self, meta: &NestedMetaItem, hir_id: HirId) -> bool {
|
fn check_doc_tuple_variadic(&self, meta: &NestedMetaItem, hir_id: HirId) -> bool {
|
||||||
match self.tcx.hir().find(hir_id).and_then(|node| match node {
|
match self.tcx.hir().find(hir_id).and_then(|node| match node {
|
||||||
hir::Node::Item(item) => Some(&item.kind),
|
hir::Node::Item(item) => Some(&item.kind),
|
||||||
_ => None,
|
_ => None,
|
||||||
|
@ -815,7 +815,7 @@ impl CheckAttrVisitor<'_> {
|
||||||
.sess
|
.sess
|
||||||
.struct_span_err(
|
.struct_span_err(
|
||||||
meta.span(),
|
meta.span(),
|
||||||
"`#[doc(tuple_varadic)]` can only be used on unary tuples",
|
"`#[doc(tuple_variadic)]` can only be used on unary tuples",
|
||||||
)
|
)
|
||||||
.emit();
|
.emit();
|
||||||
return false;
|
return false;
|
||||||
|
@ -1095,9 +1095,9 @@ impl CheckAttrVisitor<'_> {
|
||||||
is_valid = false
|
is_valid = false
|
||||||
}
|
}
|
||||||
|
|
||||||
sym::tuple_varadic
|
sym::tuple_variadic
|
||||||
if !self.check_attr_not_crate_level(meta, hir_id, "tuple_varadic")
|
if !self.check_attr_not_crate_level(meta, hir_id, "tuple_variadic")
|
||||||
|| !self.check_doc_tuple_varadic(meta, hir_id) =>
|
|| !self.check_doc_tuple_variadic(meta, hir_id) =>
|
||||||
{
|
{
|
||||||
is_valid = false
|
is_valid = false
|
||||||
}
|
}
|
||||||
|
@ -1156,7 +1156,7 @@ impl CheckAttrVisitor<'_> {
|
||||||
| sym::notable_trait
|
| sym::notable_trait
|
||||||
| sym::passes
|
| sym::passes
|
||||||
| sym::plugins
|
| sym::plugins
|
||||||
| sym::tuple_varadic => {}
|
| sym::tuple_variadic => {}
|
||||||
|
|
||||||
sym::test => {
|
sym::test => {
|
||||||
if !self.check_test_attr(meta, hir_id) {
|
if !self.check_test_attr(meta, hir_id) {
|
||||||
|
|
|
@ -1439,7 +1439,7 @@ symbols! {
|
||||||
tuple,
|
tuple,
|
||||||
tuple_from_req,
|
tuple_from_req,
|
||||||
tuple_indexing,
|
tuple_indexing,
|
||||||
tuple_varadic,
|
tuple_variadic,
|
||||||
two_phase,
|
two_phase,
|
||||||
ty,
|
ty,
|
||||||
type_alias_enum_variants,
|
type_alias_enum_variants,
|
||||||
|
|
|
@ -2335,7 +2335,7 @@ macro_rules! tuple {
|
||||||
|
|
||||||
macro_rules! maybe_tuple_doc {
|
macro_rules! maybe_tuple_doc {
|
||||||
($a:ident @ #[$meta:meta] $item:item) => {
|
($a:ident @ #[$meta:meta] $item:item) => {
|
||||||
#[cfg_attr(not(bootstrap), doc(tuple_varadic))]
|
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
|
||||||
#[doc = "This trait is implemented for tuples up to twelve items long."]
|
#[doc = "This trait is implemented for tuples up to twelve items long."]
|
||||||
#[$meta]
|
#[$meta]
|
||||||
$item
|
$item
|
||||||
|
|
|
@ -900,7 +900,7 @@ mod impls {
|
||||||
|
|
||||||
macro_rules! maybe_tuple_doc {
|
macro_rules! maybe_tuple_doc {
|
||||||
($a:ident @ #[$meta:meta] $item:item) => {
|
($a:ident @ #[$meta:meta] $item:item) => {
|
||||||
#[cfg_attr(not(bootstrap), doc(tuple_varadic))]
|
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
|
||||||
#[doc = "This trait is implemented for tuples up to twelve items long."]
|
#[doc = "This trait is implemented for tuples up to twelve items long."]
|
||||||
#[$meta]
|
#[$meta]
|
||||||
$item
|
$item
|
||||||
|
|
|
@ -965,7 +965,7 @@ impl<T> (T,) {}
|
||||||
// Fake impl that's only really used for docs.
|
// Fake impl that's only really used for docs.
|
||||||
#[cfg(doc)]
|
#[cfg(doc)]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(not(bootstrap), doc(tuple_varadic))]
|
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
|
||||||
/// This trait is implemented on arbitrary-length tuples.
|
/// This trait is implemented on arbitrary-length tuples.
|
||||||
impl<T: Clone> Clone for (T,) {
|
impl<T: Clone> Clone for (T,) {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
|
@ -976,7 +976,7 @@ impl<T: Clone> Clone for (T,) {
|
||||||
// Fake impl that's only really used for docs.
|
// Fake impl that's only really used for docs.
|
||||||
#[cfg(doc)]
|
#[cfg(doc)]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(not(bootstrap), doc(tuple_varadic))]
|
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
|
||||||
/// This trait is implemented on arbitrary-length tuples.
|
/// This trait is implemented on arbitrary-length tuples.
|
||||||
impl<T: Copy> Copy for (T,) {
|
impl<T: Copy> Copy for (T,) {
|
||||||
// empty
|
// empty
|
||||||
|
|
|
@ -105,7 +105,7 @@ macro_rules! tuple_impls {
|
||||||
|
|
||||||
macro_rules! maybe_tuple_doc {
|
macro_rules! maybe_tuple_doc {
|
||||||
($a:ident @ #[$meta:meta] $item:item) => {
|
($a:ident @ #[$meta:meta] $item:item) => {
|
||||||
#[cfg_attr(not(bootstrap), doc(tuple_varadic))]
|
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
|
||||||
#[doc = "This trait is implemented for tuples up to twelve items long."]
|
#[doc = "This trait is implemented for tuples up to twelve items long."]
|
||||||
#[$meta]
|
#[$meta]
|
||||||
$item
|
$item
|
||||||
|
|
|
@ -965,7 +965,7 @@ impl<T> (T,) {}
|
||||||
// Fake impl that's only really used for docs.
|
// Fake impl that's only really used for docs.
|
||||||
#[cfg(doc)]
|
#[cfg(doc)]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(not(bootstrap), doc(tuple_varadic))]
|
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
|
||||||
/// This trait is implemented on arbitrary-length tuples.
|
/// This trait is implemented on arbitrary-length tuples.
|
||||||
impl<T: Clone> Clone for (T,) {
|
impl<T: Clone> Clone for (T,) {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
|
@ -976,7 +976,7 @@ impl<T: Clone> Clone for (T,) {
|
||||||
// Fake impl that's only really used for docs.
|
// Fake impl that's only really used for docs.
|
||||||
#[cfg(doc)]
|
#[cfg(doc)]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg_attr(not(bootstrap), doc(tuple_varadic))]
|
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
|
||||||
/// This trait is implemented on arbitrary-length tuples.
|
/// This trait is implemented on arbitrary-length tuples.
|
||||||
impl<T: Copy> Copy for (T,) {
|
impl<T: Copy> Copy for (T,) {
|
||||||
// empty
|
// empty
|
||||||
|
|
|
@ -500,7 +500,7 @@ pub(crate) fn build_impl(
|
||||||
for_,
|
for_,
|
||||||
items: trait_items,
|
items: trait_items,
|
||||||
polarity,
|
polarity,
|
||||||
kind: if utils::has_doc_flag(tcx, did, sym::tuple_varadic) {
|
kind: if utils::has_doc_flag(tcx, did, sym::tuple_variadic) {
|
||||||
ImplKind::TupleVaradic
|
ImplKind::TupleVaradic
|
||||||
} else {
|
} else {
|
||||||
ImplKind::Normal
|
ImplKind::Normal
|
||||||
|
|
|
@ -1999,7 +1999,7 @@ fn clean_impl<'tcx>(
|
||||||
for_,
|
for_,
|
||||||
items,
|
items,
|
||||||
polarity: tcx.impl_polarity(def_id),
|
polarity: tcx.impl_polarity(def_id),
|
||||||
kind: if utils::has_doc_flag(tcx, def_id.to_def_id(), sym::tuple_varadic) {
|
kind: if utils::has_doc_flag(tcx, def_id.to_def_id(), sym::tuple_variadic) {
|
||||||
ImplKind::TupleVaradic
|
ImplKind::TupleVaradic
|
||||||
} else {
|
} else {
|
||||||
ImplKind::Normal
|
ImplKind::Normal
|
||||||
|
|
|
@ -2407,7 +2407,7 @@ impl ImplKind {
|
||||||
matches!(self, ImplKind::Blanket(_))
|
matches!(self, ImplKind::Blanket(_))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn is_tuple_varadic(&self) -> bool {
|
pub(crate) fn is_tuple_variadic(&self) -> bool {
|
||||||
matches!(self, ImplKind::TupleVaradic)
|
matches!(self, ImplKind::TupleVaradic)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1076,7 +1076,7 @@ impl clean::Impl {
|
||||||
|
|
||||||
if let clean::Type::Tuple(types) = &self.for_ &&
|
if let clean::Type::Tuple(types) = &self.for_ &&
|
||||||
let [clean::Type::Generic(name)] = &types[..] &&
|
let [clean::Type::Generic(name)] = &types[..] &&
|
||||||
(self.kind.is_tuple_varadic() || self.kind.is_auto()) {
|
(self.kind.is_tuple_variadic() || self.kind.is_auto()) {
|
||||||
primitive_link_fragment(f, PrimitiveType::Tuple, &format!("({name}, ...)"), "#trait-implementations-1", cx)?;
|
primitive_link_fragment(f, PrimitiveType::Tuple, &format!("({name}, ...)"), "#trait-implementations-1", cx)?;
|
||||||
} else if let Some(ty) = self.kind.as_blanket_ty() {
|
} else if let Some(ty) = self.kind.as_blanket_ty() {
|
||||||
fmt_type(ty, f, use_absolute, cx)?;
|
fmt_type(ty, f, use_absolute, cx)?;
|
||||||
|
|
|
@ -4,7 +4,7 @@ mod foo {}
|
||||||
|
|
||||||
trait Mine {}
|
trait Mine {}
|
||||||
|
|
||||||
#[doc(tuple_varadic)] //~ ERROR: `#[doc(tuple_varadic)]` is meant for internal use only
|
#[doc(tuple_variadic)] //~ ERROR: `#[doc(tuple_variadic)]` is meant for internal use only
|
||||||
impl<T> Mine for (T,) {}
|
impl<T> Mine for (T,) {}
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -7,10 +7,10 @@ LL | #[doc(keyword = "match")]
|
||||||
= note: see issue #90418 <https://github.com/rust-lang/rust/issues/90418> for more information
|
= note: see issue #90418 <https://github.com/rust-lang/rust/issues/90418> for more information
|
||||||
= help: add `#![feature(rustdoc_internals)]` to the crate attributes to enable
|
= help: add `#![feature(rustdoc_internals)]` to the crate attributes to enable
|
||||||
|
|
||||||
error[E0658]: `#[doc(tuple_varadic)]` is meant for internal use only
|
error[E0658]: `#[doc(tuple_variadic)]` is meant for internal use only
|
||||||
--> $DIR/feature-gate-rustdoc_internals.rs:7:1
|
--> $DIR/feature-gate-rustdoc_internals.rs:7:1
|
||||||
|
|
|
|
||||||
LL | #[doc(tuple_varadic)]
|
LL | #[doc(tuple_variadic)]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= note: see issue #90418 <https://github.com/rust-lang/rust/issues/90418> for more information
|
= note: see issue #90418 <https://github.com/rust-lang/rust/issues/90418> for more information
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue