about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-07-22 17:08:25 +0000
committerbors <bors@rust-lang.org>2019-07-22 17:08:25 +0000
commite649e903440bfd919bfc9db848c28df6d795a116 (patch)
treed182bd52c502a10edf0c1f8dfd172f1081685ac2 /src
parent4bc1ce7bdb7f5dc9ea07c0b630c087d8e11140e4 (diff)
parent376382aff3e8dad93b273ce7e9231ec7946edbe0 (diff)
downloadrust-e649e903440bfd919bfc9db848c28df6d795a116.tar.gz
rust-e649e903440bfd919bfc9db848c28df6d795a116.zip
Auto merge of #62873 - Centril:rollup-ncnuelj, r=Centril
Rollup of 14 pull requests

Successful merges:

 - #62709 (Test that maplike FromIter satisfies uniqueness)
 - #62713 (Stabilize <*mut _>::cast and <*const _>::cast)
 - #62746 ( do not use assume_init in std::io)
 - #62787 (Fix typo in src/libstd/net/udp.rs doc comment)
 - #62788 (normalize use of backticks in compiler messages for libcore/ptr)
 - #62799 (use const array repeat expressions for uninit_array)
 - #62810 (normalize use of backticks in compiler messages for librustc_lint)
 - #62812 (normalize use of backticks in compiler messages for librustc_metadata)
 - #62832 (normalize use of backticks in compiler messages for librustc_incremental)
 - #62845 (read: fix doc comment)
 - #62853 (normalize use of backticks in compiler messages for librustc/hir)
 - #62854 (Fix typo in Unicode character name)
 - #62858 (Change wrong variable name.)
 - #62870 (fix lexing of comments with many \r)

Failed merges:

r? @ghost
Diffstat (limited to 'src')
-rw-r--r--src/liballoc/collections/btree/map.rs8
-rw-r--r--src/liballoc/collections/btree/node.rs6
-rw-r--r--src/liballoc/lib.rs2
-rw-r--r--src/libcore/fmt/float.rs7
-rw-r--r--src/libcore/fmt/num.rs4
-rw-r--r--src/libcore/macros.rs23
-rw-r--r--src/libcore/mem/maybe_uninit.rs5
-rw-r--r--src/libcore/ptr/mod.rs4
-rw-r--r--src/libcore/ptr/unique.rs4
-rw-r--r--src/libcore/slice/sort.rs4
-rw-r--r--src/librustc/hir/def_id.rs4
-rw-r--r--src/librustc/hir/lowering.rs4
-rw-r--r--src/librustc_incremental/assert_dep_graph.rs2
-rw-r--r--src/librustc_incremental/persist/dirty_clean.rs2
-rw-r--r--src/librustc_incremental/persist/fs.rs6
-rw-r--r--src/librustc_lint/builtin.rs6
-rw-r--r--src/librustc_lint/lib.rs4
-rw-r--r--src/librustc_lint/unused.rs10
-rw-r--r--src/librustc_metadata/creader.rs6
-rw-r--r--src/librustc_metadata/error_codes.rs5
-rw-r--r--src/librustc_metadata/native_libs.rs8
-rw-r--r--src/libstd/collections/hash/map.rs4
-rw-r--r--src/libstd/collections/hash/set.rs4
-rw-r--r--src/libstd/io/mod.rs4
-rw-r--r--src/libstd/io/util.rs24
-rw-r--r--src/libstd/lib.rs3
-rw-r--r--src/libstd/net/udp.rs4
-rw-r--r--src/libstd/sync/mod.rs1
-rw-r--r--src/libstd/sys/cloudabi/mod.rs2
-rw-r--r--src/libsyntax/parse/lexer/mod.rs2
-rw-r--r--src/libsyntax/parse/lexer/unicode_chars.rs2
-rw-r--r--src/test/incremental/unchecked_dirty_clean.rs8
-rw-r--r--src/test/ui-fulldeps/plugin-attr-register-deny.stderr2
-rw-r--r--src/test/ui/allocator/two-allocators2.rs2
-rw-r--r--src/test/ui/allocator/two-allocators2.stderr2
-rw-r--r--src/test/ui/allocator/two-allocators3.rs2
-rw-r--r--src/test/ui/allocator/two-allocators3.stderr2
-rw-r--r--src/test/ui/bad/bad-extern-link-attrs.stderr4
-rw-r--r--src/test/ui/empty/empty-linkname.stderr2
-rw-r--r--src/test/ui/error-codes/E0454.stderr2
-rw-r--r--src/test/ui/error-codes/E0458.stderr2
-rw-r--r--src/test/ui/error-codes/E0459.stderr2
-rw-r--r--src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr70
-rw-r--r--src/test/ui/feature-gate/issue-49983-see-issue-0.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr6
-rw-r--r--src/test/ui/feature-gates/feature-gate-impl_trait_in_bindings.stderr4
-rw-r--r--src/test/ui/impl-trait/where-allowed.stderr2
-rw-r--r--src/test/ui/invalid/invalid-plugin-attr.stderr2
-rw-r--r--src/test/ui/issues/issue-45562.fixed2
-rw-r--r--src/test/ui/issues/issue-45562.rs2
-rw-r--r--src/test/ui/issues/issue-45562.stderr2
-rw-r--r--src/test/ui/lint/lint-misplaced-attr.stderr2
-rw-r--r--src/test/ui/lint/lint-unexported-no-mangle.rs4
-rw-r--r--src/test/ui/lint/lint-unexported-no-mangle.stderr8
-rw-r--r--src/test/ui/lint/suggestions.rs6
-rw-r--r--src/test/ui/lint/suggestions.stderr6
-rw-r--r--src/test/ui/missing/missing-allocator.stderr2
-rw-r--r--src/test/ui/missing_debug_impls.stderr4
-rw-r--r--src/test/ui/parser/several-carriage-returns-in-doc-comment.rs10
-rw-r--r--src/test/ui/parser/several-carriage-returns-in-doc-comment.stderr20
-rw-r--r--src/test/ui/rfc1717/missing-link-attr.stderr2
-rw-r--r--src/test/ui/wasm-import-module.stderr6
62 files changed, 212 insertions, 154 deletions
diff --git a/src/liballoc/collections/btree/map.rs b/src/liballoc/collections/btree/map.rs
index d466948a017..7cf779b3e72 100644
--- a/src/liballoc/collections/btree/map.rs
+++ b/src/liballoc/collections/btree/map.rs
@@ -75,10 +75,10 @@ use Entry::*;
 ///
 /// // look up the values associated with some keys.
 /// let to_find = ["Up!", "Office Space"];
-/// for book in &to_find {
-///     match movie_reviews.get(book) {
-///        Some(review) => println!("{}: {}", book, review),
-///        None => println!("{} is unreviewed.", book)
+/// for movie in &to_find {
+///     match movie_reviews.get(movie) {
+///        Some(review) => println!("{}: {}", movie, review),
+///        None => println!("{} is unreviewed.", movie)
 ///     }
 /// }
 ///
diff --git a/src/liballoc/collections/btree/node.rs b/src/liballoc/collections/btree/node.rs
index 7cf077d61d6..e067096f0c7 100644
--- a/src/liballoc/collections/btree/node.rs
+++ b/src/liballoc/collections/btree/node.rs
@@ -106,8 +106,8 @@ impl<K, V> LeafNode<K, V> {
         LeafNode {
             // As a general policy, we leave fields uninitialized if they can be, as this should
             // be both slightly faster and easier to track in Valgrind.
-            keys: uninitialized_array![_; CAPACITY],
-            vals: uninitialized_array![_; CAPACITY],
+            keys: uninit_array![_; CAPACITY],
+            vals: uninit_array![_; CAPACITY],
             parent: ptr::null(),
             parent_idx: MaybeUninit::uninit(),
             len: 0
@@ -159,7 +159,7 @@ impl<K, V> InternalNode<K, V> {
     unsafe fn new() -> Self {
         InternalNode {
             data: LeafNode::new(),
-            edges: uninitialized_array![_; 2*B],
+            edges: uninit_array![_; 2*B],
         }
     }
 }
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 2e48825e81c..dbc1f3b47c8 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -77,6 +77,7 @@
 #![feature(box_syntax)]
 #![feature(cfg_target_has_atomic)]
 #![feature(coerce_unsized)]
+#![cfg_attr(not(bootstrap), feature(const_in_array_repeat_expressions))]
 #![feature(dispatch_from_dyn)]
 #![feature(core_intrinsics)]
 #![feature(dropck_eyepatch)]
@@ -84,6 +85,7 @@
 #![feature(fmt_internals)]
 #![feature(fn_traits)]
 #![feature(fundamental)]
+#![feature(internal_uninit_const)]
 #![feature(lang_items)]
 #![feature(libc)]
 #![feature(nll)]
diff --git a/src/libcore/fmt/float.rs b/src/libcore/fmt/float.rs
index 4bd7d3b4b22..a2fff913ac7 100644
--- a/src/libcore/fmt/float.rs
+++ b/src/libcore/fmt/float.rs
@@ -12,10 +12,11 @@ fn float_to_decimal_common_exact<T>(fmt: &mut Formatter<'_>, num: &T,
     unsafe {
         let mut buf = MaybeUninit::<[u8; 1024]>::uninit(); // enough for f32 and f64
         let mut parts = MaybeUninit::<[flt2dec::Part<'_>; 4]>::uninit();
-        // FIXME(#53491): Technically, this is calling `get_mut` on an uninitialized
-        // `MaybeUninit` (here and elsewhere in this file).  Revisit this once
+        // FIXME(#53491): This is calling `get_mut` on an uninitialized
+        // `MaybeUninit` (here and elsewhere in this file). Revisit this once
         // we decided whether that is valid or not.
-        // Using `freeze` is *not enough*; `flt2dec::Part` is an enum!
+        // We can do this only because we are libstd and coupled to the compiler.
+        // (FWIW, using `freeze` would not be enough; `flt2dec::Part` is an enum!)
         let formatted = flt2dec::to_exact_fixed_str(flt2dec::strategy::grisu::format_exact,
                                                     *num, sign, precision,
                                                     false, buf.get_mut(), parts.get_mut());
diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs
index f9b4c26496c..3b5c9fbff25 100644
--- a/src/libcore/fmt/num.rs
+++ b/src/libcore/fmt/num.rs
@@ -51,7 +51,7 @@ trait GenericRadix {
         // characters for a base 2 number.
         let zero = T::zero();
         let is_nonnegative = x >= zero;
-        let mut buf = uninitialized_array![u8; 128];
+        let mut buf = [MaybeUninit::<u8>::uninit(); 128];
         let mut curr = buf.len();
         let base = T::from_u8(Self::BASE);
         if is_nonnegative {
@@ -189,7 +189,7 @@ static DEC_DIGITS_LUT: &[u8; 200] =
 macro_rules! impl_Display {
     ($($t:ident),* as $u:ident via $conv_fn:ident named $name:ident) => {
         fn $name(mut n: $u, is_nonnegative: bool, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-            let mut buf = uninitialized_array![u8; 39];
+            let mut buf = [MaybeUninit::<u8>::uninit(); 39];
             let mut curr = buf.len() as isize;
             let buf_ptr = MaybeUninit::first_ptr_mut(&mut buf);
             let lut_ptr = DEC_DIGITS_LUT.as_ptr();
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index 293a2dd9492..296bb43f9fa 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -626,20 +626,37 @@ macro_rules! todo {
 /// Creates an array of [`MaybeUninit`].
 ///
 /// This macro constructs an uninitialized array of the type `[MaybeUninit<K>; N]`.
+/// It exists solely because bootstrap does not yet support const array-init expressions.
 ///
 /// [`MaybeUninit`]: mem/union.MaybeUninit.html
+// FIXME: Remove both versions of this macro once bootstrap is 1.38.
 #[macro_export]
 #[unstable(feature = "maybe_uninit_array", issue = "53491")]
-macro_rules! uninitialized_array {
+#[cfg(bootstrap)]
+macro_rules! uninit_array {
     // This `assume_init` is safe because an array of `MaybeUninit` does not
     // require initialization.
-    // FIXME(#49147): Could be replaced by an array initializer, once those can
-    // be any const expression.
     ($t:ty; $size:expr) => (unsafe {
         MaybeUninit::<[MaybeUninit<$t>; $size]>::uninit().assume_init()
     });
 }
 
+/// Creates an array of [`MaybeUninit`].
+///
+/// This macro constructs an uninitialized array of the type `[MaybeUninit<K>; N]`.
+/// It exists solely because bootstrap does not yet support const array-init expressions.
+///
+/// [`MaybeUninit`]: mem/union.MaybeUninit.html
+// FIXME: Just inline this version of the macro once bootstrap is 1.38.
+#[macro_export]
+#[unstable(feature = "maybe_uninit_array", issue = "53491")]
+#[cfg(not(bootstrap))]
+macro_rules! uninit_array {
+    ($t:ty; $size:expr) => (
+        [MaybeUninit::<$t>::UNINIT; $size]
+    );
+}
+
 /// Built-in macros to the compiler itself.
 ///
 /// These macros do not have any corresponding definition with a `macro_rules!`
diff --git a/src/libcore/mem/maybe_uninit.rs b/src/libcore/mem/maybe_uninit.rs
index f6f7ccffdb0..2e88db8df11 100644
--- a/src/libcore/mem/maybe_uninit.rs
+++ b/src/libcore/mem/maybe_uninit.rs
@@ -252,6 +252,11 @@ impl<T> MaybeUninit<T> {
         MaybeUninit { uninit: () }
     }
 
+    /// A promotable constant, equivalent to `uninit()`.
+    #[unstable(feature = "internal_uninit_const", issue = "0",
+        reason = "hack to work around promotability")]
+    pub const UNINIT: Self = Self::uninit();
+
     /// Creates a new `MaybeUninit<T>` in an uninitialized state, with the memory being
     /// filled with `0` bytes. It depends on `T` whether that already makes for
     /// proper initialization. For example, `MaybeUninit<usize>::zeroed()` is initialized,
diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs
index df66a2978de..a7f6926de42 100644
--- a/src/libcore/ptr/mod.rs
+++ b/src/libcore/ptr/mod.rs
@@ -1043,7 +1043,7 @@ impl<T: ?Sized> *const T {
     }
 
     /// Cast to a pointer to a different type
-    #[unstable(feature = "ptr_cast", issue = "60602")]
+    #[stable(feature = "ptr_cast", since = "1.38.0")]
     #[inline]
     pub const fn cast<U>(self) -> *const U {
         self as _
@@ -1678,7 +1678,7 @@ impl<T: ?Sized> *mut T {
     }
 
     /// Cast to a pointer to a different type
-    #[unstable(feature = "ptr_cast", issue = "60602")]
+    #[stable(feature = "ptr_cast", since = "1.38.0")]
     #[inline]
     pub const fn cast<U>(self) -> *mut U {
         self as _
diff --git a/src/libcore/ptr/unique.rs b/src/libcore/ptr/unique.rs
index 5911518919e..d2517e51fc5 100644
--- a/src/libcore/ptr/unique.rs
+++ b/src/libcore/ptr/unique.rs
@@ -26,8 +26,8 @@ use crate::ptr::NonNull;
 /// Unlike `*mut T`, `Unique<T>` is covariant over `T`. This should always be correct
 /// for any type which upholds Unique's aliasing requirements.
 #[unstable(feature = "ptr_internals", issue = "0",
-           reason = "use NonNull instead and consider PhantomData<T> \
-                     (if you also use #[may_dangle]), Send, and/or Sync")]
+           reason = "use `NonNull` instead and consider `PhantomData<T>` \
+                     (if you also use `#[may_dangle]`), `Send`, and/or `Sync`")]
 #[doc(hidden)]
 #[repr(transparent)]
 #[rustc_layout_scalar_valid_range_start(1)]
diff --git a/src/libcore/slice/sort.rs b/src/libcore/slice/sort.rs
index c293b190018..2f2170f7ff1 100644
--- a/src/libcore/slice/sort.rs
+++ b/src/libcore/slice/sort.rs
@@ -216,14 +216,14 @@ fn partition_in_blocks<T, F>(v: &mut [T], pivot: &T, is_less: &mut F) -> usize
     let mut block_l = BLOCK;
     let mut start_l = ptr::null_mut();
     let mut end_l = ptr::null_mut();
-    let mut offsets_l: [MaybeUninit<u8>; BLOCK] = uninitialized_array![u8; BLOCK];
+    let mut offsets_l = [MaybeUninit::<u8>::uninit(); BLOCK];
 
     // The current block on the right side (from `r.sub(block_r)` to `r`).
     let mut r = unsafe { l.add(v.len()) };
     let mut block_r = BLOCK;
     let mut start_r = ptr::null_mut();
     let mut end_r = ptr::null_mut();
-    let mut offsets_r: [MaybeUninit<u8>; BLOCK] = uninitialized_array![u8; BLOCK];
+    let mut offsets_r = [MaybeUninit::<u8>::uninit(); BLOCK];
 
     // FIXME: When we get VLAs, try creating one array of length `min(v.len(), 2 * BLOCK)` rather
     // than two fixed-size arrays of length `BLOCK`. VLAs might be more cache-efficient.
diff --git a/src/librustc/hir/def_id.rs b/src/librustc/hir/def_id.rs
index debed38361a..057d878a0ab 100644
--- a/src/librustc/hir/def_id.rs
+++ b/src/librustc/hir/def_id.rs
@@ -69,14 +69,14 @@ impl CrateNum {
     pub fn as_usize(self) -> usize {
         match self {
             CrateNum::Index(id) => id.as_usize(),
-            _ => bug!("tried to get index of nonstandard crate {:?}", self),
+            _ => bug!("tried to get index of non-standard crate {:?}", self),
         }
     }
 
     pub fn as_u32(self) -> u32 {
         match self {
             CrateNum::Index(id) => id.as_u32(),
-            _ => bug!("tried to get index of nonstandard crate {:?}", self),
+            _ => bug!("tried to get index of non-standard crate {:?}", self),
         }
     }
 
diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs
index c228bc2cf6b..288fd2714e2 100644
--- a/src/librustc/hir/lowering.rs
+++ b/src/librustc/hir/lowering.rs
@@ -1693,8 +1693,8 @@ impl<'a> LoweringContext<'a> {
                         if pos == ImplTraitPosition::Binding &&
                             nightly_options::is_nightly_build() {
                             help!(err,
-                                  "add #![feature(impl_trait_in_bindings)] to the crate attributes \
-                                   to enable");
+                                  "add `#![feature(impl_trait_in_bindings)]` to the crate \
+                                   attributes to enable");
                         }
                         err.emit();
                         hir::TyKind::Err
diff --git a/src/librustc_incremental/assert_dep_graph.rs b/src/librustc_incremental/assert_dep_graph.rs
index ba893f5f936..07d426af6ee 100644
--- a/src/librustc_incremental/assert_dep_graph.rs
+++ b/src/librustc_incremental/assert_dep_graph.rs
@@ -190,7 +190,7 @@ fn check_paths<'tcx>(tcx: TyCtxt<'tcx>, if_this_changed: &Sources, then_this_wou
         for &(target_span, _, _, _) in then_this_would_need {
             tcx.sess.span_err(
                 target_span,
-                "no #[rustc_if_this_changed] annotation detected");
+                "no `#[rustc_if_this_changed]` annotation detected");
 
         }
         return;
diff --git a/src/librustc_incremental/persist/dirty_clean.rs b/src/librustc_incremental/persist/dirty_clean.rs
index c23bb6b47f4..aa98ebae543 100644
--- a/src/librustc_incremental/persist/dirty_clean.rs
+++ b/src/librustc_incremental/persist/dirty_clean.rs
@@ -610,7 +610,7 @@ impl FindAllAttrs<'tcx> {
         for attr in &self.found_attrs {
             if !checked_attrs.contains(&attr.id) {
                 self.tcx.sess.span_err(attr.span, &format!("found unchecked \
-                    #[rustc_dirty]/#[rustc_clean] attribute"));
+                    `#[rustc_dirty]` / `#[rustc_clean]` attribute"));
             }
         }
     }
diff --git a/src/librustc_incremental/persist/fs.rs b/src/librustc_incremental/persist/fs.rs
index 7f697b54484..0ab67af613b 100644
--- a/src/librustc_incremental/persist/fs.rs
+++ b/src/librustc_incremental/persist/fs.rs
@@ -538,7 +538,7 @@ fn find_source_directory_in_iter<I>(iter: I,
         if source_directories_already_tried.contains(&session_dir) ||
            !is_session_directory(&directory_name) ||
            !is_finalized(&directory_name) {
-            debug!("find_source_directory_in_iter - ignoring.");
+            debug!("find_source_directory_in_iter - ignoring");
             continue
         }
 
@@ -693,7 +693,7 @@ pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> {
             let timestamp = match extract_timestamp_from_session_dir(lock_file_name) {
                 Ok(timestamp) => timestamp,
                 Err(()) => {
-                    debug!("Found lock-file with malformed timestamp: {}",
+                    debug!("found lock-file with malformed timestamp: {}",
                         crate_directory.join(&lock_file_name).display());
                     // Ignore it
                     continue
@@ -746,7 +746,7 @@ pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> {
         let timestamp = match extract_timestamp_from_session_dir(directory_name) {
             Ok(timestamp) => timestamp,
             Err(()) => {
-                debug!("Found session-dir with malformed timestamp: {}",
+                debug!("found session-dir with malformed timestamp: {}",
                         crate_directory.join(directory_name).display());
                 // Ignore it
                 continue
diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs
index c9605445c24..4105e030477 100644
--- a/src/librustc_lint/builtin.rs
+++ b/src/librustc_lint/builtin.rs
@@ -591,7 +591,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDebugImplementations {
         if !self.impling_types.as_ref().unwrap().contains(&item.hir_id) {
             cx.span_lint(MISSING_DEBUG_IMPLEMENTATIONS,
                          item.span,
-                         "type does not implement `fmt::Debug`; consider adding #[derive(Debug)] \
+                         "type does not implement `fmt::Debug`; consider adding `#[derive(Debug)]` \
                           or a manual implementation")
         }
     }
@@ -867,7 +867,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidNoMangleItems {
                 if attr::contains_name(&it.attrs, sym::no_mangle) {
                     // Const items do not refer to a particular location in memory, and therefore
                     // don't have anything to attach a symbol to
-                    let msg = "const items should never be #[no_mangle]";
+                    let msg = "const items should never be `#[no_mangle]`";
                     let mut err = cx.struct_span_lint(NO_MANGLE_CONST_ITEMS, it.span, msg);
 
                     // account for "pub const" (#45562)
@@ -1358,7 +1358,7 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
 declare_lint! {
     UNNAMEABLE_TEST_ITEMS,
     Warn,
-    "detects an item that cannot be named being marked as #[test_case]",
+    "detects an item that cannot be named being marked as `#[test_case]`",
     report_in_external_macro: true
 }
 
diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs
index 82348e330f5..c7a8c2b8923 100644
--- a/src/librustc_lint/lib.rs
+++ b/src/librustc_lint/lib.rs
@@ -481,9 +481,9 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
     store.register_removed("resolve_trait_on_defaulted_unit",
         "converted into hard error, see https://github.com/rust-lang/rust/issues/48950");
     store.register_removed("private_no_mangle_fns",
-        "no longer a warning, #[no_mangle] functions always exported");
+        "no longer a warning, `#[no_mangle]` functions always exported");
     store.register_removed("private_no_mangle_statics",
-        "no longer a warning, #[no_mangle] statics always exported");
+        "no longer a warning, `#[no_mangle]` statics always exported");
     store.register_removed("bad_repr",
         "replaced with a generic attribute input check");
     store.register_removed("duplicate_matcher_binding_name",
diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs
index 2db2e0bc0da..4cccaa942b7 100644
--- a/src/librustc_lint/unused.rs
+++ b/src/librustc_lint/unused.rs
@@ -24,7 +24,7 @@ use log::debug;
 declare_lint! {
     pub UNUSED_MUST_USE,
     Warn,
-    "unused result of a type flagged as #[must_use]",
+    "unused result of a type flagged as `#[must_use]`",
     report_in_external_macro: true
 }
 
@@ -316,7 +316,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAttributes {
 
         let name = attr.name_or_empty();
         if !attr::is_used(attr) {
-            debug!("Emitting warning for: {:?}", attr);
+            debug!("emitting warning for: {:?}", attr);
             cx.span_lint(UNUSED_ATTRIBUTES, attr.span, "unused attribute");
             // Is it a builtin attribute that must be used at the crate level?
             let known_crate = attr_info.map(|&&(_, ty, ..)| {
@@ -332,7 +332,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAttributes {
                 let msg = match attr.style {
                     ast::AttrStyle::Outer => {
                         "crate-level attribute should be an inner attribute: add an exclamation \
-                         mark: #![foo]"
+                         mark: `#![foo]`"
                     }
                     ast::AttrStyle::Inner => "crate-level attribute should be in the root module",
                 };
@@ -570,9 +570,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedAllocation {
             if let adjustment::Adjust::Borrow(adjustment::AutoBorrow::Ref(_, m)) = adj.kind {
                 let msg = match m {
                     adjustment::AutoBorrowMutability::Immutable =>
-                        "unnecessary allocation, use & instead",
+                        "unnecessary allocation, use `&` instead",
                     adjustment::AutoBorrowMutability::Mutable { .. }=>
-                        "unnecessary allocation, use &mut instead"
+                        "unnecessary allocation, use `&mut` instead"
                 };
                 cx.span_lint(UNUSED_ALLOCATION, e.span, msg);
             }
diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs
index 2073b317939..126cfec157f 100644
--- a/src/librustc_metadata/creader.rs
+++ b/src/librustc_metadata/creader.rs
@@ -938,14 +938,14 @@ impl<'a> CrateLoader<'a> {
             }
             match global_allocator {
                 Some(Some(other_crate)) => {
-                    self.sess.err(&format!("the #[global_allocator] in {} \
+                    self.sess.err(&format!("the `#[global_allocator]` in {} \
                                             conflicts with this global \
                                             allocator in: {}",
                                            other_crate,
                                            data.root.name));
                 }
                 Some(None) => {
-                    self.sess.err(&format!("the #[global_allocator] in this \
+                    self.sess.err(&format!("the `#[global_allocator]` in this \
                                             crate conflicts with global \
                                             allocator in: {}", data.root.name));
                 }
@@ -971,7 +971,7 @@ impl<'a> CrateLoader<'a> {
         if !has_default {
             self.sess.err("no global memory allocator found but one is \
                            required; link to std or \
-                           add #[global_allocator] to a static item \
+                           add `#[global_allocator]` to a static item \
                            that implements the GlobalAlloc trait.");
         }
         self.sess.allocator_kind.set(Some(AllocatorKind::DefaultLib));
diff --git a/src/librustc_metadata/error_codes.rs b/src/librustc_metadata/error_codes.rs
index 7c631736591..909fca2ab58 100644
--- a/src/librustc_metadata/error_codes.rs
+++ b/src/librustc_metadata/error_codes.rs
@@ -7,7 +7,8 @@ E0454: r##"
 A link name was given with an empty name. Erroneous code example:
 
 ```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
-#[link(name = "")] extern {} // error: #[link(name = "")] given with empty name
+#[link(name = "")] extern {}
+// error: `#[link(name = "")]` given with empty name
 ```
 
 The rust compiler cannot link to an external library if you don't give it its
@@ -61,7 +62,7 @@ A link was used without a name parameter. Erroneous code example:
 
 ```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
 #[link(kind = "dylib")] extern {}
-// error: #[link(...)] specified without `name = "foo"`
+// error: `#[link(...)]` specified without `name = "foo"`
 ```
 
 Please add the name parameter to allow the rust compiler to find the library
diff --git a/src/librustc_metadata/native_libs.rs b/src/librustc_metadata/native_libs.rs
index 5da5384f8aa..66971bb6f8b 100644
--- a/src/librustc_metadata/native_libs.rs
+++ b/src/librustc_metadata/native_libs.rs
@@ -102,7 +102,7 @@ impl ItemLikeVisitor<'tcx> for Collector<'tcx> {
                     match item.value_str() {
                         Some(s) => lib.wasm_import_module = Some(s),
                         None => {
-                            let msg = "must be of the form #[link(wasm_import_module = \"...\")]";
+                            let msg = "must be of the form `#[link(wasm_import_module = \"...\")]`";
                             self.tcx.sess.span_err(item.span(), msg);
                         }
                     }
@@ -117,7 +117,7 @@ impl ItemLikeVisitor<'tcx> for Collector<'tcx> {
             let requires_name = kind_specified || lib.wasm_import_module.is_none();
             if lib.name.is_none() && requires_name {
                 struct_span_err!(self.tcx.sess, m.span, E0459,
-                                 "#[link(...)] specified without \
+                                 "`#[link(...)]` specified without \
                                   `name = \"foo\"`")
                     .span_label(m.span, "missing `name` argument")
                     .emit();
@@ -136,7 +136,7 @@ impl Collector<'tcx> {
             match span {
                 Some(span) => {
                     struct_span_err!(self.tcx.sess, span, E0454,
-                                     "#[link(name = \"\")] given with empty name")
+                                     "`#[link(name = \"\")]` given with empty name")
                         .span_label(span, "empty name given")
                         .emit();
                 }
@@ -187,7 +187,7 @@ impl Collector<'tcx> {
                         &format!("an empty renaming target was specified for library `{}`",name));
                 } else if !any_duplicate {
                     self.tcx.sess.err(&format!("renaming of the library `{}` was specified, \
-                                                however this crate contains no #[link(...)] \
+                                                however this crate contains no `#[link(...)]` \
                                                 attributes referencing this library.", name));
                 } else if renames.contains(name) {
                     self.tcx.sess.err(&format!("multiple renamings were \
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs
index 2925d8362c8..1e28ee8da26 100644
--- a/src/libstd/collections/hash/map.rs
+++ b/src/libstd/collections/hash/map.rs
@@ -3138,13 +3138,15 @@ mod test_map {
 
     #[test]
     fn test_from_iter() {
-        let xs = [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
+        let xs = [(1, 1), (2, 2), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)];
 
         let map: HashMap<_, _> = xs.iter().cloned().collect();
 
         for &(k, v) in &xs {
             assert_eq!(map.get(&k), Some(&v));
         }
+
+        assert_eq!(map.iter().len(), xs.len() - 1);
     }
 
     #[test]
diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs
index 403914c0707..d243412405a 100644
--- a/src/libstd/collections/hash/set.rs
+++ b/src/libstd/collections/hash/set.rs
@@ -1782,13 +1782,15 @@ mod test_set {
 
     #[test]
     fn test_from_iter() {
-        let xs = [1, 2, 3, 4, 5, 6, 7, 8, 9];
+        let xs = [1, 2, 2, 3, 4, 5, 6, 7, 8, 9];
 
         let set: HashSet<_> = xs.iter().cloned().collect();
 
         for x in &xs {
             assert!(set.contains(x));
         }
+
+        assert_eq!(set.iter().len(), xs.len() - 1);
     }
 
     #[test]
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index a8d4d1181aa..e951b575773 100644
--- a/src/libstd/io/mod.rs
+++ b/src/libstd/io/mod.rs
@@ -511,8 +511,8 @@ pub trait Read {
     ///
     /// Correspondingly, however, *callers* of this method may not assume any guarantees
     /// about how the implementation uses `buf`. The trait is safe to implement,
-    //  so it is possible that the code that's supposed to write to the buffer might also read
-    //  from it. It is your responsibility to make sure that `buf` is initialized
+    /// so it is possible that the code that's supposed to write to the buffer might also read
+    /// from it. It is your responsibility to make sure that `buf` is initialized
     /// before calling `read`. Calling `read` with an uninitialized `buf` (of the kind one
     /// obtains via [`MaybeUninit<T>`]) is not safe, and can lead to undefined behavior.
     ///
diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs
index 1efccb53b75..33cc87eb795 100644
--- a/src/libstd/io/util.rs
+++ b/src/libstd/io/util.rs
@@ -2,7 +2,7 @@
 
 use crate::fmt;
 use crate::io::{self, Read, Initializer, Write, ErrorKind, BufRead, IoSlice, IoSliceMut};
-use crate::mem;
+use crate::mem::MaybeUninit;
 
 /// Copies the entire contents of a reader into a writer.
 ///
@@ -43,27 +43,23 @@ use crate::mem;
 pub fn copy<R: ?Sized, W: ?Sized>(reader: &mut R, writer: &mut W) -> io::Result<u64>
     where R: Read, W: Write
 {
-    let mut buf = unsafe {
-        // This is still technically undefined behavior due to creating a reference
-        // to uninitialized data, but within libstd we can rely on more guarantees
-        // than if this code were in an external lib
-
-        // FIXME: This should probably be changed to an array of `MaybeUninit<u8>`
-        // once the `mem::MaybeUninit` slice APIs stabilize
-        let mut buf: mem::MaybeUninit<[u8; super::DEFAULT_BUF_SIZE]> = mem::MaybeUninit::uninit();
-        reader.initializer().initialize(&mut *buf.as_mut_ptr());
-        buf.assume_init()
-    };
+    let mut buf = MaybeUninit::<[u8; super::DEFAULT_BUF_SIZE]>::uninit();
+    // FIXME(#53491): This is calling `get_mut` and `get_ref` on an uninitialized
+    // `MaybeUninit`. Revisit this once we decided whether that is valid or not.
+    // This is still technically undefined behavior due to creating a reference
+    // to uninitialized data, but within libstd we can rely on more guarantees
+    // than if this code were in an external lib.
+    unsafe { reader.initializer().initialize(buf.get_mut()); }
 
     let mut written = 0;
     loop {
-        let len = match reader.read(&mut buf) {
+        let len = match reader.read(unsafe { buf.get_mut() }) {
             Ok(0) => return Ok(written),
             Ok(len) => len,
             Err(ref e) if e.kind() == ErrorKind::Interrupted => continue,
             Err(e) => return Err(e),
         };
-        writer.write_all(&buf[..len])?;
+        writer.write_all(unsafe { &buf.get_ref()[..len] })?;
         written += len as u64;
     }
 }
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index f394195d77a..49fb4be39b4 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -205,7 +205,7 @@
 // Don't link to std. We are std.
 #![no_std]
 
-//#![warn(deprecated_in_future)] // FIXME: std still has quite a few uses of `mem::uninitialized`
+#![warn(deprecated_in_future)]
 #![warn(missing_docs)]
 #![warn(missing_debug_implementations)]
 #![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
@@ -272,6 +272,7 @@
 #![feature(libc)]
 #![feature(link_args)]
 #![feature(linkage)]
+#![feature(maybe_uninit_ref)]
 #![feature(mem_take)]
 #![feature(needs_panic_runtime)]
 #![feature(never_type)]
diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs
index 61d9149952e..c430e103951 100644
--- a/src/libstd/net/udp.rs
+++ b/src/libstd/net/udp.rs
@@ -422,7 +422,7 @@ impl UdpSocket {
     /// Sets the value of the `IP_MULTICAST_LOOP` option for this socket.
     ///
     /// If enabled, multicast packets will be looped back to the local socket.
-    /// Note that this may not have any affect on IPv6 sockets.
+    /// Note that this may not have any effect on IPv6 sockets.
     ///
     /// # Examples
     ///
@@ -464,7 +464,7 @@ impl UdpSocket {
     /// this socket. The default value is 1 which means that multicast packets
     /// don't leave the local network unless explicitly requested.
     ///
-    /// Note that this may not have any affect on IPv6 sockets.
+    /// Note that this may not have any effect on IPv6 sockets.
     ///
     /// # Examples
     ///
diff --git a/src/libstd/sync/mod.rs b/src/libstd/sync/mod.rs
index fd6e46fd61d..e29faf18d83 100644
--- a/src/libstd/sync/mod.rs
+++ b/src/libstd/sync/mod.rs
@@ -163,6 +163,7 @@ pub use self::condvar::{Condvar, WaitTimeoutResult};
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use self::mutex::{Mutex, MutexGuard};
 #[stable(feature = "rust1", since = "1.0.0")]
+#[cfg_attr(bootstrap, allow(deprecated_in_future))]
 #[allow(deprecated)]
 pub use self::once::{Once, OnceState, ONCE_INIT};
 #[stable(feature = "rust1", since = "1.0.0")]
diff --git a/src/libstd/sys/cloudabi/mod.rs b/src/libstd/sys/cloudabi/mod.rs
index 3fef7552259..77a52a8743d 100644
--- a/src/libstd/sys/cloudabi/mod.rs
+++ b/src/libstd/sys/cloudabi/mod.rs
@@ -1,4 +1,4 @@
-#![allow(deprecated)] // mem::uninitialized
+#![allow(deprecated_in_future)] // mem::uninitialized; becomes `deprecated` when nightly is 1.39
 
 use crate::io::ErrorKind;
 use crate::mem;
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs
index 317c49c7d35..bfefd9adbfe 100644
--- a/src/libsyntax/parse/lexer/mod.rs
+++ b/src/libsyntax/parse/lexer/mod.rs
@@ -226,7 +226,7 @@ impl<'a> StringReader<'a> {
                     loop {
                         idx = match string[idx..].find('\r') {
                             None => break,
-                            Some(it) => it + 1
+                            Some(it) => idx + it + 1
                         };
                         if string[idx..].chars().next() != Some('\n') {
                             self.err_span_(start + BytePos(idx as u32 - 1),
diff --git a/src/libsyntax/parse/lexer/unicode_chars.rs b/src/libsyntax/parse/lexer/unicode_chars.rs
index e51657c0f13..b728a9e1988 100644
--- a/src/libsyntax/parse/lexer/unicode_chars.rs
+++ b/src/libsyntax/parse/lexer/unicode_chars.rs
@@ -50,7 +50,7 @@ const UNICODE_ARRAY: &[(char, &str, char)] = &[
     ('─', "Box Drawings Light Horizontal", '-'),
     ('━', "Box Drawings Heavy Horizontal", '-'),
     ('㇐', "CJK Stroke H", '-'),
-    ('ꟷ', "Latin Epigraphic Letter Dideways", '-'),
+    ('ꟷ', "Latin Epigraphic Letter Sideways I", '-'),
     ('ᅳ', "Hangul Jungseong Eu", '-'),
     ('ㅡ', "Hangul Letter Eu", '-'),
     ('一', "CJK Unified Ideograph-4E00", '-'),
diff --git a/src/test/incremental/unchecked_dirty_clean.rs b/src/test/incremental/unchecked_dirty_clean.rs
index 9ea9431e20a..66bdb670167 100644
--- a/src/test/incremental/unchecked_dirty_clean.rs
+++ b/src/test/incremental/unchecked_dirty_clean.rs
@@ -11,13 +11,13 @@
 fn main() {
 
     #[rustc_dirty(label="Hir", cfg="cfail2")]
-    //[cfail2]~^ ERROR found unchecked #[rustc_dirty]/#[rustc_clean] attribute
+    //[cfail2]~^ ERROR found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute
     {
         // empty block
     }
 
     #[rustc_clean(label="Hir", cfg="cfail2")]
-    //[cfail2]~^ ERROR found unchecked #[rustc_dirty]/#[rustc_clean] attribute
+    //[cfail2]~^ ERROR found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute
     {
         // empty block
     }
@@ -25,10 +25,10 @@ fn main() {
 
 struct _Struct {
     #[rustc_dirty(label="Hir", cfg="cfail2")]
-    //[cfail2]~^ ERROR found unchecked #[rustc_dirty]/#[rustc_clean] attribute
+    //[cfail2]~^ ERROR found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute
     _field1: i32,
 
     #[rustc_clean(label="Hir", cfg="cfail2")]
-    //[cfail2]~^ ERROR found unchecked #[rustc_dirty]/#[rustc_clean] attribute
+    //[cfail2]~^ ERROR found unchecked `#[rustc_dirty]` / `#[rustc_clean]` attribute
     _field2: i32,
 }
diff --git a/src/test/ui-fulldeps/plugin-attr-register-deny.stderr b/src/test/ui-fulldeps/plugin-attr-register-deny.stderr
index 7fea5134d7a..64a67f6e160 100644
--- a/src/test/ui-fulldeps/plugin-attr-register-deny.stderr
+++ b/src/test/ui-fulldeps/plugin-attr-register-deny.stderr
@@ -10,7 +10,7 @@ note: lint level defined here
 LL | #![deny(unused_attributes)]
    |         ^^^^^^^^^^^^^^^^^
 
-error: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/plugin-attr-register-deny.rs:14:5
    |
 LL |     #[bar]
diff --git a/src/test/ui/allocator/two-allocators2.rs b/src/test/ui/allocator/two-allocators2.rs
index 96da780e4a2..6dfefe19c7f 100644
--- a/src/test/ui/allocator/two-allocators2.rs
+++ b/src/test/ui/allocator/two-allocators2.rs
@@ -1,6 +1,6 @@
 // aux-build:system-allocator.rs
 // no-prefer-dynamic
-// error-pattern: the #[global_allocator] in
+// error-pattern: the `#[global_allocator]` in
 
 extern crate system_allocator;
 
diff --git a/src/test/ui/allocator/two-allocators2.stderr b/src/test/ui/allocator/two-allocators2.stderr
index 2b23ce38ede..b1fb4421ea0 100644
--- a/src/test/ui/allocator/two-allocators2.stderr
+++ b/src/test/ui/allocator/two-allocators2.stderr
@@ -1,4 +1,4 @@
-error: the #[global_allocator] in this crate conflicts with global allocator in: system_allocator
+error: the `#[global_allocator]` in this crate conflicts with global allocator in: system_allocator
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/allocator/two-allocators3.rs b/src/test/ui/allocator/two-allocators3.rs
index 8a06335c031..31dea2d4478 100644
--- a/src/test/ui/allocator/two-allocators3.rs
+++ b/src/test/ui/allocator/two-allocators3.rs
@@ -1,7 +1,7 @@
 // aux-build:system-allocator.rs
 // aux-build:system-allocator2.rs
 // no-prefer-dynamic
-// error-pattern: the #[global_allocator] in
+// error-pattern: the `#[global_allocator]` in
 
 
 extern crate system_allocator;
diff --git a/src/test/ui/allocator/two-allocators3.stderr b/src/test/ui/allocator/two-allocators3.stderr
index 86e385a96a1..ecffb192e2a 100644
--- a/src/test/ui/allocator/two-allocators3.stderr
+++ b/src/test/ui/allocator/two-allocators3.stderr
@@ -1,4 +1,4 @@
-error: the #[global_allocator] in system_allocator conflicts with this global allocator in: system_allocator2
+error: the `#[global_allocator]` in system_allocator conflicts with this global allocator in: system_allocator2
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/bad/bad-extern-link-attrs.stderr b/src/test/ui/bad/bad-extern-link-attrs.stderr
index 18b0dc9ea38..525c605a9cf 100644
--- a/src/test/ui/bad/bad-extern-link-attrs.stderr
+++ b/src/test/ui/bad/bad-extern-link-attrs.stderr
@@ -1,10 +1,10 @@
-error[E0459]: #[link(...)] specified without `name = "foo"`
+error[E0459]: `#[link(...)]` specified without `name = "foo"`
   --> $DIR/bad-extern-link-attrs.rs:1:1
    |
 LL | #[link()]
    | ^^^^^^^^^ missing `name` argument
 
-error[E0454]: #[link(name = "")] given with empty name
+error[E0454]: `#[link(name = "")]` given with empty name
   --> $DIR/bad-extern-link-attrs.rs:2:1
    |
 LL | #[link(name = "")]
diff --git a/src/test/ui/empty/empty-linkname.stderr b/src/test/ui/empty/empty-linkname.stderr
index df41cb89413..b9d1841f16c 100644
--- a/src/test/ui/empty/empty-linkname.stderr
+++ b/src/test/ui/empty/empty-linkname.stderr
@@ -1,4 +1,4 @@
-error[E0454]: #[link(name = "")] given with empty name
+error[E0454]: `#[link(name = "")]` given with empty name
   --> $DIR/empty-linkname.rs:1:1
    |
 LL | #[link(name = "")]
diff --git a/src/test/ui/error-codes/E0454.stderr b/src/test/ui/error-codes/E0454.stderr
index 352c3baa83a..499162694e5 100644
--- a/src/test/ui/error-codes/E0454.stderr
+++ b/src/test/ui/error-codes/E0454.stderr
@@ -1,4 +1,4 @@
-error[E0454]: #[link(name = "")] given with empty name
+error[E0454]: `#[link(name = "")]` given with empty name
   --> $DIR/E0454.rs:1:1
    |
 LL | #[link(name = "")] extern {}
diff --git a/src/test/ui/error-codes/E0458.stderr b/src/test/ui/error-codes/E0458.stderr
index d60fd96c779..51f7764aaf2 100644
--- a/src/test/ui/error-codes/E0458.stderr
+++ b/src/test/ui/error-codes/E0458.stderr
@@ -6,7 +6,7 @@ LL | #[link(kind = "wonderful_unicorn")] extern {}
    |        |
    |        unknown kind
 
-error[E0459]: #[link(...)] specified without `name = "foo"`
+error[E0459]: `#[link(...)]` specified without `name = "foo"`
   --> $DIR/E0458.rs:1:1
    |
 LL | #[link(kind = "wonderful_unicorn")] extern {}
diff --git a/src/test/ui/error-codes/E0459.stderr b/src/test/ui/error-codes/E0459.stderr
index da7069fbb47..c618fea9afc 100644
--- a/src/test/ui/error-codes/E0459.stderr
+++ b/src/test/ui/error-codes/E0459.stderr
@@ -1,4 +1,4 @@
-error[E0459]: #[link(...)] specified without `name = "foo"`
+error[E0459]: `#[link(...)]` specified without `name = "foo"`
   --> $DIR/E0459.rs:1:1
    |
 LL | #[link(kind = "dylib")] extern {}
diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr
index f987cb97d1a..94757c5a35a 100644
--- a/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr
+++ b/src/test/ui/feature-gate/issue-43106-gating-of-builtin-attrs.stderr
@@ -632,7 +632,7 @@ warning: unused attribute
 LL |     #[no_std] fn f() { }
    |     ^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:483:5
    |
 LL |     #[no_std] fn f() { }
@@ -644,7 +644,7 @@ warning: unused attribute
 LL |     #[no_std] struct S;
    |     ^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:487:5
    |
 LL |     #[no_std] struct S;
@@ -656,7 +656,7 @@ warning: unused attribute
 LL |     #[no_std] type T = S;
    |     ^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:491:5
    |
 LL |     #[no_std] type T = S;
@@ -668,7 +668,7 @@ warning: unused attribute
 LL |     #[no_std] impl S { }
    |     ^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:495:5
    |
 LL |     #[no_std] impl S { }
@@ -680,7 +680,7 @@ warning: unused attribute
 LL | #[no_std]
    | ^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:475:1
    |
 LL | #[no_std]
@@ -704,7 +704,7 @@ warning: unused attribute
 LL |     #[crate_name = "0900"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:638:5
    |
 LL |     #[crate_name = "0900"] fn f() { }
@@ -716,7 +716,7 @@ warning: unused attribute
 LL |     #[crate_name = "0900"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:642:5
    |
 LL |     #[crate_name = "0900"] struct S;
@@ -728,7 +728,7 @@ warning: unused attribute
 LL |     #[crate_name = "0900"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:646:5
    |
 LL |     #[crate_name = "0900"] type T = S;
@@ -740,7 +740,7 @@ warning: unused attribute
 LL |     #[crate_name = "0900"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:650:5
    |
 LL |     #[crate_name = "0900"] impl S { }
@@ -752,7 +752,7 @@ warning: unused attribute
 LL | #[crate_name = "0900"]
    | ^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:630:1
    |
 LL | #[crate_name = "0900"]
@@ -776,7 +776,7 @@ warning: unused attribute
 LL |     #[crate_type = "0800"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:5
    |
 LL |     #[crate_type = "0800"] fn f() { }
@@ -788,7 +788,7 @@ warning: unused attribute
 LL |     #[crate_type = "0800"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:5
    |
 LL |     #[crate_type = "0800"] struct S;
@@ -800,7 +800,7 @@ warning: unused attribute
 LL |     #[crate_type = "0800"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:671:5
    |
 LL |     #[crate_type = "0800"] type T = S;
@@ -812,7 +812,7 @@ warning: unused attribute
 LL |     #[crate_type = "0800"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:675:5
    |
 LL |     #[crate_type = "0800"] impl S { }
@@ -824,7 +824,7 @@ warning: unused attribute
 LL | #[crate_type = "0800"]
    | ^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:655:1
    |
 LL | #[crate_type = "0800"]
@@ -848,7 +848,7 @@ warning: unused attribute
 LL |     #[feature(x0600)] fn f() { }
    |     ^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:5
    |
 LL |     #[feature(x0600)] fn f() { }
@@ -860,7 +860,7 @@ warning: unused attribute
 LL |     #[feature(x0600)] struct S;
    |     ^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:692:5
    |
 LL |     #[feature(x0600)] struct S;
@@ -872,7 +872,7 @@ warning: unused attribute
 LL |     #[feature(x0600)] type T = S;
    |     ^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5
    |
 LL |     #[feature(x0600)] type T = S;
@@ -884,7 +884,7 @@ warning: unused attribute
 LL |     #[feature(x0600)] impl S { }
    |     ^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:700:5
    |
 LL |     #[feature(x0600)] impl S { }
@@ -896,7 +896,7 @@ warning: unused attribute
 LL | #[feature(x0600)]
    | ^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:680:1
    |
 LL | #[feature(x0600)]
@@ -920,7 +920,7 @@ warning: unused attribute
 LL |     #[no_main] fn f() { }
    |     ^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:714:5
    |
 LL |     #[no_main] fn f() { }
@@ -932,7 +932,7 @@ warning: unused attribute
 LL |     #[no_main] struct S;
    |     ^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5
    |
 LL |     #[no_main] struct S;
@@ -944,7 +944,7 @@ warning: unused attribute
 LL |     #[no_main] type T = S;
    |     ^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:722:5
    |
 LL |     #[no_main] type T = S;
@@ -956,7 +956,7 @@ warning: unused attribute
 LL |     #[no_main] impl S { }
    |     ^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:726:5
    |
 LL |     #[no_main] impl S { }
@@ -968,7 +968,7 @@ warning: unused attribute
 LL | #[no_main]
    | ^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:1
    |
 LL | #[no_main]
@@ -992,7 +992,7 @@ warning: unused attribute
 LL |     #[recursion_limit="0200"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:752:5
    |
 LL |     #[recursion_limit="0200"] fn f() { }
@@ -1004,7 +1004,7 @@ warning: unused attribute
 LL |     #[recursion_limit="0200"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:756:5
    |
 LL |     #[recursion_limit="0200"] struct S;
@@ -1016,7 +1016,7 @@ warning: unused attribute
 LL |     #[recursion_limit="0200"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:760:5
    |
 LL |     #[recursion_limit="0200"] type T = S;
@@ -1028,7 +1028,7 @@ warning: unused attribute
 LL |     #[recursion_limit="0200"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:764:5
    |
 LL |     #[recursion_limit="0200"] impl S { }
@@ -1040,7 +1040,7 @@ warning: unused attribute
 LL | #[recursion_limit="0200"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:1
    |
 LL | #[recursion_limit="0200"]
@@ -1064,7 +1064,7 @@ warning: unused attribute
 LL |     #[type_length_limit="0100"] fn f() { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:777:5
    |
 LL |     #[type_length_limit="0100"] fn f() { }
@@ -1076,7 +1076,7 @@ warning: unused attribute
 LL |     #[type_length_limit="0100"] struct S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:5
    |
 LL |     #[type_length_limit="0100"] struct S;
@@ -1088,7 +1088,7 @@ warning: unused attribute
 LL |     #[type_length_limit="0100"] type T = S;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:5
    |
 LL |     #[type_length_limit="0100"] type T = S;
@@ -1100,7 +1100,7 @@ warning: unused attribute
 LL |     #[type_length_limit="0100"] impl S { }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5
    |
 LL |     #[type_length_limit="0100"] impl S { }
@@ -1112,7 +1112,7 @@ warning: unused attribute
 LL | #[type_length_limit="0100"]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/issue-43106-gating-of-builtin-attrs.rs:769:1
    |
 LL | #[type_length_limit="0100"]
diff --git a/src/test/ui/feature-gate/issue-49983-see-issue-0.stderr b/src/test/ui/feature-gate/issue-49983-see-issue-0.stderr
index adbbebd40c5..314238a34df 100644
--- a/src/test/ui/feature-gate/issue-49983-see-issue-0.stderr
+++ b/src/test/ui/feature-gate/issue-49983-see-issue-0.stderr
@@ -1,4 +1,4 @@
-error[E0658]: use of unstable library feature 'ptr_internals': use NonNull instead and consider PhantomData<T> (if you also use #[may_dangle]), Send, and/or Sync
+error[E0658]: use of unstable library feature 'ptr_internals': use `NonNull` instead and consider `PhantomData<T>` (if you also use `#[may_dangle]`), `Send`, and/or `Sync`
   --> $DIR/issue-49983-see-issue-0.rs:4:30
    |
 LL | #[allow(unused_imports)] use core::ptr::Unique;
diff --git a/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr b/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr
index cd74916bea4..84af2a0163a 100644
--- a/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr
+++ b/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr
@@ -121,7 +121,7 @@ error[E0562]: `impl Trait` not allowed outside of function and inherent method r
 LL | const _cdef: impl Tr1<As1: Copy> = S1;
    |              ^^^^^^^^^^^^^^^^^^^
    |
-   = help: add #![feature(impl_trait_in_bindings)] to the crate attributes to enable
+   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
   --> $DIR/feature-gate-associated_type_bounds.rs:60:15
@@ -129,7 +129,7 @@ error[E0562]: `impl Trait` not allowed outside of function and inherent method r
 LL | static _sdef: impl Tr1<As1: Copy> = S1;
    |               ^^^^^^^^^^^^^^^^^^^
    |
-   = help: add #![feature(impl_trait_in_bindings)] to the crate attributes to enable
+   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
   --> $DIR/feature-gate-associated_type_bounds.rs:67:12
@@ -137,7 +137,7 @@ error[E0562]: `impl Trait` not allowed outside of function and inherent method r
 LL |     let _: impl Tr1<As1: Copy> = S1;
    |            ^^^^^^^^^^^^^^^^^^^
    |
-   = help: add #![feature(impl_trait_in_bindings)] to the crate attributes to enable
+   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
 
 error: aborting due to 16 previous errors
 
diff --git a/src/test/ui/feature-gates/feature-gate-impl_trait_in_bindings.stderr b/src/test/ui/feature-gates/feature-gate-impl_trait_in_bindings.stderr
index a54e7e1b3bf..bd648b40590 100644
--- a/src/test/ui/feature-gates/feature-gate-impl_trait_in_bindings.stderr
+++ b/src/test/ui/feature-gates/feature-gate-impl_trait_in_bindings.stderr
@@ -10,7 +10,7 @@ error[E0562]: `impl Trait` not allowed outside of function and inherent method r
 LL | const FOO: impl Copy = 42;
    |            ^^^^^^^^^
    |
-   = help: add #![feature(impl_trait_in_bindings)] to the crate attributes to enable
+   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
   --> $DIR/feature-gate-impl_trait_in_bindings.rs:4:13
@@ -18,7 +18,7 @@ error[E0562]: `impl Trait` not allowed outside of function and inherent method r
 LL | static BAR: impl Copy = 42;
    |             ^^^^^^^^^
    |
-   = help: add #![feature(impl_trait_in_bindings)] to the crate attributes to enable
+   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/impl-trait/where-allowed.stderr b/src/test/ui/impl-trait/where-allowed.stderr
index e7a8430faea..9895b028a4e 100644
--- a/src/test/ui/impl-trait/where-allowed.stderr
+++ b/src/test/ui/impl-trait/where-allowed.stderr
@@ -232,7 +232,7 @@ error[E0562]: `impl Trait` not allowed outside of function and inherent method r
 LL |     let _in_local_variable: impl Fn() = || {};
    |                             ^^^^^^^^^
    |
-   = help: add #![feature(impl_trait_in_bindings)] to the crate attributes to enable
+   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
   --> $DIR/where-allowed.rs:222:46
diff --git a/src/test/ui/invalid/invalid-plugin-attr.stderr b/src/test/ui/invalid/invalid-plugin-attr.stderr
index c7b2ce47489..36714c39b31 100644
--- a/src/test/ui/invalid/invalid-plugin-attr.stderr
+++ b/src/test/ui/invalid/invalid-plugin-attr.stderr
@@ -10,7 +10,7 @@ note: lint level defined here
 LL | #![deny(unused_attributes)]
    |         ^^^^^^^^^^^^^^^^^
 
-error: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/invalid-plugin-attr.rs:4:1
    |
 LL | #[plugin(bla)]
diff --git a/src/test/ui/issues/issue-45562.fixed b/src/test/ui/issues/issue-45562.fixed
index c23f5909bbe..ac700fbd046 100644
--- a/src/test/ui/issues/issue-45562.fixed
+++ b/src/test/ui/issues/issue-45562.fixed
@@ -1,6 +1,6 @@
 // run-rustfix
 
 #[no_mangle] pub static RAH: usize = 5;
-//~^ ERROR const items should never be #[no_mangle]
+//~^ ERROR const items should never be `#[no_mangle]`
 
 fn main() {}
diff --git a/src/test/ui/issues/issue-45562.rs b/src/test/ui/issues/issue-45562.rs
index 8ac4f6794f6..eabb5a5cecf 100644
--- a/src/test/ui/issues/issue-45562.rs
+++ b/src/test/ui/issues/issue-45562.rs
@@ -1,6 +1,6 @@
 // run-rustfix
 
 #[no_mangle] pub const RAH: usize = 5;
-//~^ ERROR const items should never be #[no_mangle]
+//~^ ERROR const items should never be `#[no_mangle]`
 
 fn main() {}
diff --git a/src/test/ui/issues/issue-45562.stderr b/src/test/ui/issues/issue-45562.stderr
index e6e33aa85c3..be259d3f8a4 100644
--- a/src/test/ui/issues/issue-45562.stderr
+++ b/src/test/ui/issues/issue-45562.stderr
@@ -1,4 +1,4 @@
-error: const items should never be #[no_mangle]
+error: const items should never be `#[no_mangle]`
   --> $DIR/issue-45562.rs:3:14
    |
 LL | #[no_mangle] pub const RAH: usize = 5;
diff --git a/src/test/ui/lint/lint-misplaced-attr.stderr b/src/test/ui/lint/lint-misplaced-attr.stderr
index 1419f858f8e..cd4a89f91c4 100644
--- a/src/test/ui/lint/lint-misplaced-attr.stderr
+++ b/src/test/ui/lint/lint-misplaced-attr.stderr
@@ -22,7 +22,7 @@ error: unused attribute
 LL | #[crate_type = "bin"] fn main() {}
    | ^^^^^^^^^^^^^^^^^^^^^
 
-error: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo]
+error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
   --> $DIR/lint-misplaced-attr.rs:11:1
    |
 LL | #[crate_type = "bin"] fn main() {}
diff --git a/src/test/ui/lint/lint-unexported-no-mangle.rs b/src/test/ui/lint/lint-unexported-no-mangle.rs
index 5945c90023c..f260fc32303 100644
--- a/src/test/ui/lint/lint-unexported-no-mangle.rs
+++ b/src/test/ui/lint/lint-unexported-no-mangle.rs
@@ -6,10 +6,10 @@ fn foo() {
 
 #[allow(dead_code)]
 #[no_mangle]
-const FOO: u64 = 1; //~ ERROR const items should never be #[no_mangle]
+const FOO: u64 = 1; //~ ERROR const items should never be `#[no_mangle]`
 
 #[no_mangle]
-pub const PUB_FOO: u64 = 1; //~ ERROR const items should never be #[no_mangle]
+pub const PUB_FOO: u64 = 1; //~ ERROR const items should never be `#[no_mangle]`
 
 #[no_mangle]
 pub fn bar()  {
diff --git a/src/test/ui/lint/lint-unexported-no-mangle.stderr b/src/test/ui/lint/lint-unexported-no-mangle.stderr
index 586ee8ed411..c2cbf5feaad 100644
--- a/src/test/ui/lint/lint-unexported-no-mangle.stderr
+++ b/src/test/ui/lint/lint-unexported-no-mangle.stderr
@@ -1,12 +1,12 @@
-warning: lint `private_no_mangle_fns` has been removed: `no longer a warning, #[no_mangle] functions always exported`
+warning: lint `private_no_mangle_fns` has been removed: `no longer a warning, `#[no_mangle]` functions always exported`
    |
    = note: requested on the command line with `-F private_no_mangle_fns`
 
-warning: lint `private_no_mangle_statics` has been removed: `no longer a warning, #[no_mangle] statics always exported`
+warning: lint `private_no_mangle_statics` has been removed: `no longer a warning, `#[no_mangle]` statics always exported`
    |
    = note: requested on the command line with `-F private_no_mangle_statics`
 
-error: const items should never be #[no_mangle]
+error: const items should never be `#[no_mangle]`
   --> $DIR/lint-unexported-no-mangle.rs:9:1
    |
 LL | const FOO: u64 = 1;
@@ -16,7 +16,7 @@ LL | const FOO: u64 = 1;
    |
    = note: requested on the command line with `-F no-mangle-const-items`
 
-error: const items should never be #[no_mangle]
+error: const items should never be `#[no_mangle]`
   --> $DIR/lint-unexported-no-mangle.rs:12:1
    |
 LL | pub const PUB_FOO: u64 = 1;
diff --git a/src/test/ui/lint/suggestions.rs b/src/test/ui/lint/suggestions.rs
index 67bd6dd501b..aa5518d1a7a 100644
--- a/src/test/ui/lint/suggestions.rs
+++ b/src/test/ui/lint/suggestions.rs
@@ -4,7 +4,7 @@
 #![feature(no_debug)]
 
 #[no_mangle] const DISCOVERY: usize = 1;
-//~^ ERROR const items should never be #[no_mangle]
+//~^ ERROR const items should never be `#[no_mangle]`
 //~| HELP try a static value
 
 #[no_mangle]
@@ -20,7 +20,7 @@ mod badlands {
     // item is already `pub` (but triggered the lint because, e.g., it's in a
     // private module). (Issue #47383)
     #[no_mangle] pub const DAUNTLESS: bool = true;
-    //~^ ERROR const items should never be #[no_mangle]
+    //~^ ERROR const items should never be `#[no_mangle]`
     //~| HELP try a static value
     #[no_mangle] pub fn val_jean<T>() {}
     //~^ WARN functions generic over types or consts must be mangled
@@ -28,7 +28,7 @@ mod badlands {
 
     // ... but we can suggest just-`pub` instead of restricted
     #[no_mangle] pub(crate) const VETAR: bool = true;
-    //~^ ERROR const items should never be #[no_mangle]
+    //~^ ERROR const items should never be `#[no_mangle]`
     //~| HELP try a static value
     #[no_mangle] pub(crate) fn crossfield<T>() {}
     //~^ WARN functions generic over types or consts must be mangled
diff --git a/src/test/ui/lint/suggestions.stderr b/src/test/ui/lint/suggestions.stderr
index eb1e95dcdc5..2042ed75537 100644
--- a/src/test/ui/lint/suggestions.stderr
+++ b/src/test/ui/lint/suggestions.stderr
@@ -52,7 +52,7 @@ LL | ||             b = 1;
    |  |____________|
    |               help: remove this `mut`
 
-error: const items should never be #[no_mangle]
+error: const items should never be `#[no_mangle]`
   --> $DIR/suggestions.rs:6:14
    |
 LL | #[no_mangle] const DISCOVERY: usize = 1;
@@ -83,7 +83,7 @@ LL |             Equinox { warp_factor: warp_factor } => {}
    |
    = note: `#[warn(non_shorthand_field_patterns)]` on by default
 
-error: const items should never be #[no_mangle]
+error: const items should never be `#[no_mangle]`
   --> $DIR/suggestions.rs:22:18
    |
 LL |     #[no_mangle] pub const DAUNTLESS: bool = true;
@@ -99,7 +99,7 @@ LL |     #[no_mangle] pub fn val_jean<T>() {}
    |     |
    |     help: remove this attribute
 
-error: const items should never be #[no_mangle]
+error: const items should never be `#[no_mangle]`
   --> $DIR/suggestions.rs:30:18
    |
 LL |     #[no_mangle] pub(crate) const VETAR: bool = true;
diff --git a/src/test/ui/missing/missing-allocator.stderr b/src/test/ui/missing/missing-allocator.stderr
index 11e0085d1ce..59648c42a5f 100644
--- a/src/test/ui/missing/missing-allocator.stderr
+++ b/src/test/ui/missing/missing-allocator.stderr
@@ -1,4 +1,4 @@
-error: no global memory allocator found but one is required; link to std or add #[global_allocator] to a static item that implements the GlobalAlloc trait.
+error: no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait.
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/missing_debug_impls.stderr b/src/test/ui/missing_debug_impls.stderr
index bb8390a8f31..b9530587787 100644
--- a/src/test/ui/missing_debug_impls.stderr
+++ b/src/test/ui/missing_debug_impls.stderr
@@ -1,4 +1,4 @@
-error: type does not implement `fmt::Debug`; consider adding #[derive(Debug)] or a manual implementation
+error: type does not implement `fmt::Debug`; consider adding `#[derive(Debug)]` or a manual implementation
   --> $DIR/missing_debug_impls.rs:7:1
    |
 LL | pub enum A {}
@@ -10,7 +10,7 @@ note: lint level defined here
 LL | #![deny(missing_debug_implementations)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: type does not implement `fmt::Debug`; consider adding #[derive(Debug)] or a manual implementation
+error: type does not implement `fmt::Debug`; consider adding `#[derive(Debug)]` or a manual implementation
   --> $DIR/missing_debug_impls.rs:20:1
    |
 LL | pub struct Foo;
diff --git a/src/test/ui/parser/several-carriage-returns-in-doc-comment.rs b/src/test/ui/parser/several-carriage-returns-in-doc-comment.rs
new file mode 100644
index 00000000000..ee14c55d292
--- /dev/null
+++ b/src/test/ui/parser/several-carriage-returns-in-doc-comment.rs
@@ -0,0 +1,10 @@
+// Issue #62863
+// ignore-tidy-cr
+
+// Note: if you see ^M in this file, that's how your editor renders literal `\r`
+
+/// This do
c comment contains 
three isolated `\r`
 symbols
+//~^ ERROR bare CR not allowed in doc-comment
+//~| ERROR bare CR not allowed in doc-comment
+//~| ERROR bare CR not allowed in doc-comment
+fn main() {}
diff --git a/src/test/ui/parser/several-carriage-returns-in-doc-comment.stderr b/src/test/ui/parser/several-carriage-returns-in-doc-comment.stderr
new file mode 100644
index 00000000000..07066fc22e6
--- /dev/null
+++ b/src/test/ui/parser/several-carriage-returns-in-doc-comment.stderr
@@ -0,0 +1,20 @@
+error: bare CR not allowed in doc-comment
+  --> $DIR/several-carriage-returns-in-doc-comment.rs:6:12
+   |
+LL | /// This do
c comment contains 
three isolated `\r`
 symbols
+   |            ^
+
+error: bare CR not allowed in doc-comment
+  --> $DIR/several-carriage-returns-in-doc-comment.rs:6:32
+   |
+LL | /// This do
c comment contains 
three isolated `\r`
 symbols
+   |                               ^
+
+error: bare CR not allowed in doc-comment
+  --> $DIR/several-carriage-returns-in-doc-comment.rs:6:52
+   |
+LL | /// This do
c comment contains 
three isolated `\r`
 symbols
+   |                                                  ^
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/rfc1717/missing-link-attr.stderr b/src/test/ui/rfc1717/missing-link-attr.stderr
index 30555e80944..d836741f9ed 100644
--- a/src/test/ui/rfc1717/missing-link-attr.stderr
+++ b/src/test/ui/rfc1717/missing-link-attr.stderr
@@ -1,4 +1,4 @@
-error: renaming of the library `foo` was specified, however this crate contains no #[link(...)] attributes referencing this library.
+error: renaming of the library `foo` was specified, however this crate contains no `#[link(...)]` attributes referencing this library.
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/wasm-import-module.stderr b/src/test/ui/wasm-import-module.stderr
index 20eec4c9f59..47d6cb68997 100644
--- a/src/test/ui/wasm-import-module.stderr
+++ b/src/test/ui/wasm-import-module.stderr
@@ -1,16 +1,16 @@
-error: must be of the form #[link(wasm_import_module = "...")]
+error: must be of the form `#[link(wasm_import_module = "...")]`
   --> $DIR/wasm-import-module.rs:1:22
    |
 LL | #[link(name = "...", wasm_import_module)]
    |                      ^^^^^^^^^^^^^^^^^^
 
-error: must be of the form #[link(wasm_import_module = "...")]
+error: must be of the form `#[link(wasm_import_module = "...")]`
   --> $DIR/wasm-import-module.rs:4:22
    |
 LL | #[link(name = "...", wasm_import_module(x))]
    |                      ^^^^^^^^^^^^^^^^^^^^^
 
-error: must be of the form #[link(wasm_import_module = "...")]
+error: must be of the form `#[link(wasm_import_module = "...")]`
   --> $DIR/wasm-import-module.rs:7:22
    |
 LL | #[link(name = "...", wasm_import_module())]