From 48af94c080d37a5396dd4452c21cd8006f38fba4 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Sun, 11 Dec 2022 19:11:41 -0800 Subject: [PATCH 01/14] Operand::extract_field: only cast llval if it's a pointer and replace bitcast w/ pointercast. --- compiler/rustc_codegen_ssa/src/mir/operand.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/mir/operand.rs b/compiler/rustc_codegen_ssa/src/mir/operand.rs index b37797fef4c..957ec8629fa 100644 --- a/compiler/rustc_codegen_ssa/src/mir/operand.rs +++ b/compiler/rustc_codegen_ssa/src/mir/operand.rs @@ -2,6 +2,7 @@ use super::place::PlaceRef; use super::{FunctionCx, LocalRef}; use crate::base; +use crate::common::TypeKind; use crate::glue; use crate::traits::*; use crate::MemFlags; @@ -240,15 +241,24 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { // Bools in union fields needs to be truncated. *llval = bx.to_immediate(*llval, field); // HACK(eddyb) have to bitcast pointers until LLVM removes pointee types. - *llval = bx.bitcast(*llval, bx.cx().immediate_backend_type(field)); + let ty = bx.cx().immediate_backend_type(field); + if bx.type_kind(ty) == TypeKind::Pointer { + *llval = bx.pointercast(*llval, ty); + } } (OperandValue::Pair(a, b), Abi::ScalarPair(a_abi, b_abi)) => { // Bools in union fields needs to be truncated. *a = bx.to_immediate_scalar(*a, a_abi); *b = bx.to_immediate_scalar(*b, b_abi); // HACK(eddyb) have to bitcast pointers until LLVM removes pointee types. - *a = bx.bitcast(*a, bx.cx().scalar_pair_element_backend_type(field, 0, true)); - *b = bx.bitcast(*b, bx.cx().scalar_pair_element_backend_type(field, 1, true)); + let a_ty = bx.cx().scalar_pair_element_backend_type(field, 0, true); + let b_ty = bx.cx().scalar_pair_element_backend_type(field, 1, true); + if bx.type_kind(a_ty) == TypeKind::Pointer { + *a = bx.pointercast(*a, a_ty); + } + if bx.type_kind(b_ty) == TypeKind::Pointer { + *b = bx.pointercast(*b, b_ty); + } } (OperandValue::Pair(..), _) => bug!(), (OperandValue::Ref(..), _) => bug!(), From 75f3fafa72a4149e730d17e755c3ad96aa40ad9a Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Sun, 11 Dec 2022 19:21:51 -0800 Subject: [PATCH 02/14] Add test. --- src/test/ui/simd/issue-105439.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/test/ui/simd/issue-105439.rs diff --git a/src/test/ui/simd/issue-105439.rs b/src/test/ui/simd/issue-105439.rs new file mode 100644 index 00000000000..3376449598c --- /dev/null +++ b/src/test/ui/simd/issue-105439.rs @@ -0,0 +1,14 @@ +// This is used to ICE with MIR inlining enabled due to an invalid bitcast. +// run-pass +// compile-flags: -O -Zmir-opt-level=3 +#![feature(portable_simd)] + +use std::simd::Simd; + +fn main() { + let a = Simd::from_array([0, 4, 1, 5]); + let b = Simd::from_array([2, 6, 3, 7]); + let (x, y) = a.deinterleave(b); + assert_eq!(x.to_array(), [0, 1, 2, 3]); + assert_eq!(y.to_array(), [4, 5, 6, 7]); +} From af69cc0ea0698d47b281e6b5da78d4794dc5df04 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Mon, 12 Dec 2022 15:52:02 -0800 Subject: [PATCH 03/14] Make test more targeted. --- src/test/ui/simd/issue-105439.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/test/ui/simd/issue-105439.rs b/src/test/ui/simd/issue-105439.rs index 3376449598c..f3291f1bffe 100644 --- a/src/test/ui/simd/issue-105439.rs +++ b/src/test/ui/simd/issue-105439.rs @@ -1,14 +1,16 @@ -// This is used to ICE with MIR inlining enabled due to an invalid bitcast. -// run-pass -// compile-flags: -O -Zmir-opt-level=3 -#![feature(portable_simd)] +// build-pass -use std::simd::Simd; +#![crate_type = "lib"] -fn main() { - let a = Simd::from_array([0, 4, 1, 5]); - let b = Simd::from_array([2, 6, 3, 7]); - let (x, y) = a.deinterleave(b); - assert_eq!(x.to_array(), [0, 1, 2, 3]); - assert_eq!(y.to_array(), [4, 5, 6, 7]); +#![feature(repr_simd)] +#![feature(platform_intrinsics)] + +#[allow(non_camel_case_types)] +#[derive(Clone, Copy)] +#[repr(simd)] +pub struct i32x4([i32; 4]); + +pub fn f(a: i32x4) -> [i32; 4] { + let b = a; + b.0 } From 6a5ee110276aa0f24e569c15d10172e3fc40752f Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Thu, 15 Dec 2022 23:18:25 -0800 Subject: [PATCH 04/14] Don't bitcast aggregate field. --- compiler/rustc_codegen_ssa/src/mir/operand.rs | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_codegen_ssa/src/mir/operand.rs b/compiler/rustc_codegen_ssa/src/mir/operand.rs index 957ec8629fa..7623daeb96f 100644 --- a/compiler/rustc_codegen_ssa/src/mir/operand.rs +++ b/compiler/rustc_codegen_ssa/src/mir/operand.rs @@ -237,13 +237,18 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { }; match (&mut val, field.abi) { - (OperandValue::Immediate(llval), _) => { + ( + OperandValue::Immediate(llval), + Abi::Scalar(_) | Abi::ScalarPair(..) | Abi::Vector { .. }, + ) => { // Bools in union fields needs to be truncated. *llval = bx.to_immediate(*llval, field); // HACK(eddyb) have to bitcast pointers until LLVM removes pointee types. let ty = bx.cx().immediate_backend_type(field); if bx.type_kind(ty) == TypeKind::Pointer { *llval = bx.pointercast(*llval, ty); + } else { + *llval = bx.bitcast(*llval, ty); } } (OperandValue::Pair(a, b), Abi::ScalarPair(a_abi, b_abi)) => { @@ -255,11 +260,31 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { let b_ty = bx.cx().scalar_pair_element_backend_type(field, 1, true); if bx.type_kind(a_ty) == TypeKind::Pointer { *a = bx.pointercast(*a, a_ty); + } else { + *a = bx.bitcast(*a, a_ty); } if bx.type_kind(b_ty) == TypeKind::Pointer { *b = bx.pointercast(*b, b_ty); + } else { + *b = bx.bitcast(*b, b_ty); } } + // Newtype vector of array, e.g. #[repr(simd)] struct S([i32; 4]); + (OperandValue::Immediate(llval), Abi::Aggregate { sized: true }) => { + assert!(matches!(self.layout.abi, Abi::Vector { .. })); + + let llty = bx.cx().backend_type(self.layout); + let llfield_ty = bx.cx().backend_type(field); + + // Can't bitcast an aggregate, so round trip through memory. + let lltemp = bx.alloca(llfield_ty, field.align.abi); + let llptr = bx.pointercast(lltemp, bx.cx().type_ptr_to(llty)); + bx.store(*llval, llptr, field.align.abi); + *llval = bx.load(llfield_ty, lltemp, field.align.abi); + } + (OperandValue::Immediate(_), Abi::Uninhabited | Abi::Aggregate { sized: false }) => { + bug!() + } (OperandValue::Pair(..), _) => bug!(), (OperandValue::Ref(..), _) => bug!(), } From 2942121736a389d4779c3b1ec908aee2d5151c73 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Fri, 5 May 2023 14:43:20 -0700 Subject: [PATCH 05/14] Update test location. --- {src/test => tests}/ui/simd/issue-105439.rs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {src/test => tests}/ui/simd/issue-105439.rs (100%) diff --git a/src/test/ui/simd/issue-105439.rs b/tests/ui/simd/issue-105439.rs similarity index 100% rename from src/test/ui/simd/issue-105439.rs rename to tests/ui/simd/issue-105439.rs From 7b1eedaae81326567e0439d058546d93f9e7f73a Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Fri, 5 May 2023 14:58:52 -0700 Subject: [PATCH 06/14] Switch test back to run-pass. --- tests/ui/simd/issue-105439.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tests/ui/simd/issue-105439.rs b/tests/ui/simd/issue-105439.rs index f3291f1bffe..35ca76e989b 100644 --- a/tests/ui/simd/issue-105439.rs +++ b/tests/ui/simd/issue-105439.rs @@ -1,6 +1,5 @@ -// build-pass - -#![crate_type = "lib"] +// run-pass +// compile-flags: -O -Zverify-llvm-ir #![feature(repr_simd)] #![feature(platform_intrinsics)] @@ -8,9 +7,19 @@ #[allow(non_camel_case_types)] #[derive(Clone, Copy)] #[repr(simd)] -pub struct i32x4([i32; 4]); +struct i32x4([i32; 4]); -pub fn f(a: i32x4) -> [i32; 4] { - let b = a; - b.0 +extern "platform-intrinsic" { + pub(crate) fn simd_add(x: T, y: T) -> T; +} + +#[inline(always)] +fn to_array(a: i32x4) -> [i32; 4] { + a.0 +} + +fn main() { + let a = i32x4([1, 2, 3, 4]); + let b = unsafe { simd_add(a, a) }; + assert_eq!(to_array(b), [2, 4, 6, 8]); } From c7c042ad31766a6f70a2c850457f086cf6a03153 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Fri, 5 May 2023 15:13:18 -0700 Subject: [PATCH 07/14] Address review comments. Remove bitcasts in OperandRef::extract_field; only pointercasts should be needed. --- compiler/rustc_codegen_ssa/src/mir/operand.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/mir/operand.rs b/compiler/rustc_codegen_ssa/src/mir/operand.rs index 7623daeb96f..9efbb34b515 100644 --- a/compiler/rustc_codegen_ssa/src/mir/operand.rs +++ b/compiler/rustc_codegen_ssa/src/mir/operand.rs @@ -247,8 +247,6 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { let ty = bx.cx().immediate_backend_type(field); if bx.type_kind(ty) == TypeKind::Pointer { *llval = bx.pointercast(*llval, ty); - } else { - *llval = bx.bitcast(*llval, ty); } } (OperandValue::Pair(a, b), Abi::ScalarPair(a_abi, b_abi)) => { @@ -260,13 +258,9 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { let b_ty = bx.cx().scalar_pair_element_backend_type(field, 1, true); if bx.type_kind(a_ty) == TypeKind::Pointer { *a = bx.pointercast(*a, a_ty); - } else { - *a = bx.bitcast(*a, a_ty); } if bx.type_kind(b_ty) == TypeKind::Pointer { *b = bx.pointercast(*b, b_ty); - } else { - *b = bx.bitcast(*b, b_ty); } } // Newtype vector of array, e.g. #[repr(simd)] struct S([i32; 4]); From 7e3b93417c620072169a061e7f3c975705723d30 Mon Sep 17 00:00:00 2001 From: Lukas Markeffsky <@> Date: Sat, 6 May 2023 13:28:38 +0200 Subject: [PATCH 08/14] clean up transmutes in core --- library/core/src/mem/maybe_uninit.rs | 4 ++-- library/core/src/tuple.rs | 18 +++++++----------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/library/core/src/mem/maybe_uninit.rs b/library/core/src/mem/maybe_uninit.rs index 2588b7d2bef..d09a24b4b1d 100644 --- a/library/core/src/mem/maybe_uninit.rs +++ b/library/core/src/mem/maybe_uninit.rs @@ -1287,7 +1287,7 @@ impl MaybeUninit<[T; N]> { #[inline] pub const fn transpose(self) -> [MaybeUninit; N] { // SAFETY: T and MaybeUninit have the same layout - unsafe { super::transmute_copy(&ManuallyDrop::new(self)) } + unsafe { intrinsics::transmute_unchecked(self) } } } @@ -1307,6 +1307,6 @@ impl [MaybeUninit; N] { #[inline] pub const fn transpose(self) -> MaybeUninit<[T; N]> { // SAFETY: T and MaybeUninit have the same layout - unsafe { super::transmute_copy(&ManuallyDrop::new(self)) } + unsafe { intrinsics::transmute_unchecked(self) } } } diff --git a/library/core/src/tuple.rs b/library/core/src/tuple.rs index 2a8403c85a4..172e5fccb61 100644 --- a/library/core/src/tuple.rs +++ b/library/core/src/tuple.rs @@ -1,7 +1,6 @@ // See src/libstd/primitive_docs.rs for documentation. use crate::cmp::Ordering::{self, *}; -use crate::mem::transmute; // Recursive macro for implementing n-ary tuple functions and operations // @@ -142,16 +141,13 @@ macro_rules! maybe_tuple_doc { #[inline] const fn ordering_is_some(c: Option, x: Ordering) -> bool { // FIXME: Just use `==` once that's const-stable on `Option`s. - // This isn't using `match` because that optimizes worse due to - // making a two-step check (`Some` *then* the inner value). - - // SAFETY: There's no public guarantee for `Option`, - // but we're core so we know that it's definitely a byte. - unsafe { - let c: i8 = transmute(c); - let x: i8 = transmute(Some(x)); - c == x - } + // This is mapping `None` to 2 and then doing the comparison afterwards + // because it optimizes better (`None::` is represented as 2). + x as i8 + == match c { + Some(c) => c as i8, + None => 2, + } } // Constructs an expression that performs a lexical ordering using method `$rel`. From b2acf3ea640bd46c4a12ee80c702ec95d3f87f16 Mon Sep 17 00:00:00 2001 From: Astroide <65875137+Astroide@users.noreply.github.com> Date: Sat, 6 May 2023 12:42:52 -0400 Subject: [PATCH 09/14] rustc --explain E0726 - grammar fixing (it's => its + add a `the` where it felt right to do so) --- compiler/rustc_error_codes/src/error_codes/E0726.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0726.md b/compiler/rustc_error_codes/src/error_codes/E0726.md index e3794327f2d..8941849065e 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0726.md +++ b/compiler/rustc_error_codes/src/error_codes/E0726.md @@ -25,8 +25,8 @@ block_on(future); Specify desired lifetime of parameter `content` or indicate the anonymous lifetime like `content: Content<'_>`. The anonymous lifetime tells the Rust -compiler that `content` is only needed until create function is done with -it's execution. +compiler that `content` is only needed until the create function is done with +its execution. The `implicit elision` meaning the omission of suggested lifetime that is `pub async fn create<'a>(content: Content<'a>) {}` is not allowed here as From 05414b0f01445a1fa4e2fc540e7d318b118d10a3 Mon Sep 17 00:00:00 2001 From: Matt Hammerly Date: Sat, 6 May 2023 13:10:37 -0700 Subject: [PATCH 10/14] update Rust Unstable Book docs for `--extern force` --- src/doc/unstable-book/src/compiler-flags/extern-options.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/doc/unstable-book/src/compiler-flags/extern-options.md b/src/doc/unstable-book/src/compiler-flags/extern-options.md index dfc1de77be4..087b37dd8de 100644 --- a/src/doc/unstable-book/src/compiler-flags/extern-options.md +++ b/src/doc/unstable-book/src/compiler-flags/extern-options.md @@ -4,6 +4,7 @@ * Tracking issue for `noprelude`: [#98398](https://github.com/rust-lang/rust/issues/98398) * Tracking issue for `priv`: [#98399](https://github.com/rust-lang/rust/issues/98399) * Tracking issue for `nounused`: [#98400](https://github.com/rust-lang/rust/issues/98400) +* Tracking issue for `force`: [#111302](https://github.com/rust-lang/rust/issues/111302) The behavior of the `--extern` flag can be modified with `noprelude`, `priv` or `nounused` options. @@ -25,3 +26,4 @@ To use multiple options, separate them with a comma: This is used by the [build-std project](https://github.com/rust-lang/wg-cargo-std-aware/) to simulate compatibility with sysroot-only crates. * `priv`: Mark the crate as a private dependency for the [`exported_private_dependencies`](../../rustc/lints/listing/warn-by-default.html#exported-private-dependencies) lint. * `nounused`: Suppress [`unused-crate-dependencies`](../../rustc/lints/listing/allowed-by-default.html#unused-crate-dependencies) warnings for the crate. +* `force`: Resolve the crate as if it is used, even if it is not used. This can be used to satisfy compilation session requirements like the presence of an allocator or panic handler. From faa797e7e7bd75fd7dfd5a08fe8cf7bf82e02fd8 Mon Sep 17 00:00:00 2001 From: Flying-Toast <38232168+Flying-Toast@users.noreply.github.com> Date: Sat, 6 May 2023 14:12:00 -0400 Subject: [PATCH 11/14] Emit while_true lint spanning the entire loop condition The lint that suggests `loop {}` instead of `while true {}` has functionality to 'pierce' parenthesis in cases like `while (true) {}`. In these cases, the emitted span only went to the hi of the `true` itself, not spanning the entire loop condition. Before: ``` warning: denote infinite loops with `loop { ... }` --> /tmp/foobar.rs:2:5 | 2 | while ((((((true)))))) {} | ^^^^^^^^^^^^^^^^ help: use `loop` | = note: `#[warn(while_true)]` on by default ``` After: ``` warning: denote infinite loops with `loop { ... }` --> /tmp/foobar.rs:2:5 | 2 | while ((((((true)))))) {} | ^^^^^^^^^^^^^^^^^^^^^^ help: use `loop` | = note: `#[warn(while_true)]` on by default ``` --- compiler/rustc_lint/src/builtin.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index aeb791901bd..87c77a173b3 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -116,8 +116,7 @@ impl EarlyLintPass for WhileTrue { #[inline] fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) { if let ast::ExprKind::While(cond, _, label) = &e.kind - && let cond = pierce_parens(cond) - && let ast::ExprKind::Lit(token_lit) = cond.kind + && let ast::ExprKind::Lit(token_lit) = pierce_parens(cond).kind && let token::Lit { kind: token::Bool, symbol: kw::True, .. } = token_lit && !cond.span.from_expansion() { From ec7fcdc959872d7ba9e1d20fa598a3f95678885b Mon Sep 17 00:00:00 2001 From: John Bobbo Date: Sat, 6 May 2023 14:42:07 -0700 Subject: [PATCH 12/14] Remove unneeded calls to `mem::forget` and `mem::replace` in `Option::get_or_insert_with`. --- library/core/src/option.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/core/src/option.rs b/library/core/src/option.rs index c38c68e1d58..ec1ef3cf43d 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -1641,10 +1641,8 @@ impl Option { where F: FnOnce() -> T, { - if let None = *self { - // the compiler isn't smart enough to know that we are not dropping a `T` - // here and wants us to ensure `T` can be dropped at compile time. - mem::forget(mem::replace(self, Some(f()))) + if let None = self { + *self = Some(f()); } // SAFETY: a `None` variant for `self` would have been replaced by a `Some` From fd005b06bb3a9517e7275c99dfbbf7d29b6a3f94 Mon Sep 17 00:00:00 2001 From: James Dietz Date: Wed, 3 May 2023 13:37:37 -0400 Subject: [PATCH 13/14] delete whitelist and add checks to check_item() for missing_docs add test and bless --- compiler/rustc_lint/src/builtin.rs | 29 +++----------- tests/ui/lint/lint-missing-doc.rs | 3 ++ tests/ui/lint/lint-missing-doc.stderr | 56 +++++++++++++++------------ 3 files changed, 39 insertions(+), 49 deletions(-) diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 01052698850..95dfec14fd7 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -547,32 +547,13 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc { } fn check_item(&mut self, cx: &LateContext<'_>, it: &hir::Item<'_>) { - match it.kind { - hir::ItemKind::Trait(..) => { - // Issue #11592: traits are always considered exported, even when private. - if cx.tcx.visibility(it.owner_id) - == ty::Visibility::Restricted( - cx.tcx.parent_module_from_def_id(it.owner_id.def_id).to_def_id(), - ) - { - return; - } - } - hir::ItemKind::TyAlias(..) - | hir::ItemKind::Fn(..) - | hir::ItemKind::Macro(..) - | hir::ItemKind::Mod(..) - | hir::ItemKind::Enum(..) - | hir::ItemKind::Struct(..) - | hir::ItemKind::Union(..) - | hir::ItemKind::Const(..) - | hir::ItemKind::Static(..) => {} - - _ => return, - }; + // Previously the Impl and Use types have been excluded from missing docs, + // so we will continue to exclude them for compatibility + if let hir::ItemKind::Impl(..) | hir::ItemKind::Use(..) = it.kind { + return; + } let (article, desc) = cx.tcx.article_and_description(it.owner_id.to_def_id()); - self.check_missing_docs_attrs(cx, it.owner_id.def_id, article, desc); } diff --git a/tests/ui/lint/lint-missing-doc.rs b/tests/ui/lint/lint-missing-doc.rs index 4a234d2651a..e4c9f8f559b 100644 --- a/tests/ui/lint/lint-missing-doc.rs +++ b/tests/ui/lint/lint-missing-doc.rs @@ -3,6 +3,7 @@ #![deny(missing_docs)] #![allow(dead_code)] #![feature(associated_type_defaults, extern_types)] +#![feature(trait_alias)] //! Some garbage docs for the crate here #![doc="More garbage"] @@ -202,4 +203,6 @@ extern "C" { //~^ ERROR: missing documentation for a foreign type } +pub trait T = Sync; //~ ERROR: missing documentation for a trait alias + fn main() {} diff --git a/tests/ui/lint/lint-missing-doc.stderr b/tests/ui/lint/lint-missing-doc.stderr index 733d062a08b..c94bd3b8dfb 100644 --- a/tests/ui/lint/lint-missing-doc.stderr +++ b/tests/ui/lint/lint-missing-doc.stderr @@ -1,5 +1,5 @@ error: missing documentation for a type alias - --> $DIR/lint-missing-doc.rs:11:1 + --> $DIR/lint-missing-doc.rs:12:1 | LL | pub type PubTypedef = String; | ^^^^^^^^^^^^^^^^^^^ @@ -11,142 +11,148 @@ LL | #![deny(missing_docs)] | ^^^^^^^^^^^^ error: missing documentation for a struct - --> $DIR/lint-missing-doc.rs:18:1 + --> $DIR/lint-missing-doc.rs:19:1 | LL | pub struct PubFoo { | ^^^^^^^^^^^^^^^^^ error: missing documentation for a struct field - --> $DIR/lint-missing-doc.rs:19:5 + --> $DIR/lint-missing-doc.rs:20:5 | LL | pub a: isize, | ^^^^^^^^^^^^ error: missing documentation for a module - --> $DIR/lint-missing-doc.rs:30:1 + --> $DIR/lint-missing-doc.rs:31:1 | LL | pub mod pub_module_no_dox {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a function - --> $DIR/lint-missing-doc.rs:34:1 + --> $DIR/lint-missing-doc.rs:35:1 | LL | pub fn foo2() {} | ^^^^^^^^^^^^^ error: missing documentation for a trait - --> $DIR/lint-missing-doc.rs:52:1 + --> $DIR/lint-missing-doc.rs:53:1 | LL | pub trait C { | ^^^^^^^^^^^ error: missing documentation for a method - --> $DIR/lint-missing-doc.rs:53:5 + --> $DIR/lint-missing-doc.rs:54:5 | LL | fn foo(&self); | ^^^^^^^^^^^^^^ error: missing documentation for a method - --> $DIR/lint-missing-doc.rs:54:5 + --> $DIR/lint-missing-doc.rs:55:5 | LL | fn foo_with_impl(&self) {} | ^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for an associated function - --> $DIR/lint-missing-doc.rs:55:5 + --> $DIR/lint-missing-doc.rs:56:5 | LL | fn foo_no_self(); | ^^^^^^^^^^^^^^^^^ error: missing documentation for an associated function - --> $DIR/lint-missing-doc.rs:56:5 + --> $DIR/lint-missing-doc.rs:57:5 | LL | fn foo_no_self_with_impl() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for an associated type - --> $DIR/lint-missing-doc.rs:66:5 + --> $DIR/lint-missing-doc.rs:67:5 | LL | type AssociatedType; | ^^^^^^^^^^^^^^^^^^^ error: missing documentation for an associated type - --> $DIR/lint-missing-doc.rs:67:5 + --> $DIR/lint-missing-doc.rs:68:5 | LL | type AssociatedTypeDef = Self; | ^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for an associated function - --> $DIR/lint-missing-doc.rs:83:5 + --> $DIR/lint-missing-doc.rs:84:5 | LL | pub fn foo() {} | ^^^^^^^^^^^^ error: missing documentation for an enum - --> $DIR/lint-missing-doc.rs:120:1 + --> $DIR/lint-missing-doc.rs:121:1 | LL | pub enum PubBaz { | ^^^^^^^^^^^^^^^ error: missing documentation for a variant - --> $DIR/lint-missing-doc.rs:121:5 + --> $DIR/lint-missing-doc.rs:122:5 | LL | PubBazA { | ^^^^^^^ error: missing documentation for a struct field - --> $DIR/lint-missing-doc.rs:122:9 + --> $DIR/lint-missing-doc.rs:123:9 | LL | a: isize, | ^^^^^^^^ error: missing documentation for a constant - --> $DIR/lint-missing-doc.rs:153:1 + --> $DIR/lint-missing-doc.rs:154:1 | LL | pub const FOO4: u32 = 0; | ^^^^^^^^^^^^^^^^^^^ error: missing documentation for a static - --> $DIR/lint-missing-doc.rs:163:1 + --> $DIR/lint-missing-doc.rs:164:1 | LL | pub static BAR4: u32 = 0; | ^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a function - --> $DIR/lint-missing-doc.rs:169:5 + --> $DIR/lint-missing-doc.rs:170:5 | LL | pub fn undocumented1() {} | ^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a function - --> $DIR/lint-missing-doc.rs:170:5 + --> $DIR/lint-missing-doc.rs:171:5 | LL | pub fn undocumented2() {} | ^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a function - --> $DIR/lint-missing-doc.rs:176:9 + --> $DIR/lint-missing-doc.rs:177:9 | LL | pub fn also_undocumented1() {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a function - --> $DIR/lint-missing-doc.rs:191:5 + --> $DIR/lint-missing-doc.rs:192:5 | LL | pub fn extern_fn_undocumented(f: f32) -> f32; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a static - --> $DIR/lint-missing-doc.rs:196:5 + --> $DIR/lint-missing-doc.rs:197:5 | LL | pub static EXTERN_STATIC_UNDOCUMENTED: u8; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: missing documentation for a foreign type - --> $DIR/lint-missing-doc.rs:201:5 + --> $DIR/lint-missing-doc.rs:202:5 | LL | pub type ExternTyUndocumented; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 24 previous errors +error: missing documentation for a trait alias + --> $DIR/lint-missing-doc.rs:206:1 + | +LL | pub trait T = Sync; + | ^^^^^^^^^^^ + +error: aborting due to 25 previous errors From d6ef6e0080848e710c8dc655041dbd5ccaa9f3c1 Mon Sep 17 00:00:00 2001 From: Astroide <65875137+Astroide@users.noreply.github.com> Date: Sat, 6 May 2023 19:39:08 -0400 Subject: [PATCH 14/14] Update compiler/rustc_error_codes/src/error_codes/E0726.md Co-authored-by: Michael Goulet --- compiler/rustc_error_codes/src/error_codes/E0726.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0726.md b/compiler/rustc_error_codes/src/error_codes/E0726.md index 8941849065e..a721e746ecd 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0726.md +++ b/compiler/rustc_error_codes/src/error_codes/E0726.md @@ -25,7 +25,7 @@ block_on(future); Specify desired lifetime of parameter `content` or indicate the anonymous lifetime like `content: Content<'_>`. The anonymous lifetime tells the Rust -compiler that `content` is only needed until the create function is done with +compiler that `content` is only needed until the `create` function is done with its execution. The `implicit elision` meaning the omission of suggested lifetime that is