about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-01-31 11:24:03 +0000
committerbors <bors@rust-lang.org>2022-01-31 11:24:03 +0000
commit86f5e177bca8121e1edc9864023a8ea61acf9034 (patch)
treefeaed126198ded6aecf5af5512277c1acff222f0
parent415c9f95884caebd0be9b837ef0885d1ffde1b9b (diff)
parent2070b221163760b7ed86d511082af72d3de4ce06 (diff)
downloadrust-86f5e177bca8121e1edc9864023a8ea61acf9034.tar.gz
rust-86f5e177bca8121e1edc9864023a8ea61acf9034.zip
Auto merge of #93498 - matthiaskrgr:rollup-k5shwrc, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #90277 (Improve terminology around "after typeck")
 - #92918 (Allow eliding GATs in expression position)
 - #93039 (Don't suggest inaccessible fields)
 - #93155 (Switch pretty printer to block-based indentation)
 - #93214 (Respect doc(hidden) when suggesting available fields)
 - #93347 (Make `char::DecodeUtf16::size_hist` more precise)
 - #93392 (Clarify documentation on char::MAX)
 - #93444 (Fix some CSS warnings and errors from VS Code)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_ast_pretty/src/pp.rs69
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state.rs4
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state/expr.rs24
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state/item.rs4
-rw-r--r--compiler/rustc_infer/src/infer/mod.rs2
-rw-r--r--compiler/rustc_lint/src/context.rs2
-rw-r--r--compiler/rustc_middle/src/mir/mod.rs2
-rw-r--r--compiler/rustc_middle/src/ty/context.rs4
-rw-r--r--compiler/rustc_middle/src/ty/normalize_erasing_regions.rs4
-rw-r--r--compiler/rustc_middle/src/ty/sty.rs4
-rw-r--r--compiler/rustc_save_analysis/src/lib.rs2
-rw-r--r--compiler/rustc_target/src/asm/mod.rs2
-rw-r--r--compiler/rustc_trait_selection/src/traits/codegen.rs8
-rw-r--r--compiler/rustc_trait_selection/src/traits/mod.rs2
-rw-r--r--compiler/rustc_trait_selection/src/traits/project.rs2
-rw-r--r--compiler/rustc_trait_selection/src/traits/query/normalize.rs2
-rw-r--r--compiler/rustc_ty_utils/src/ty.rs2
-rw-r--r--compiler/rustc_typeck/src/astconv/generics.rs2
-rw-r--r--compiler/rustc_typeck/src/astconv/mod.rs15
-rw-r--r--compiler/rustc_typeck/src/check/expr.rs69
-rw-r--r--library/core/src/char/decode.rs31
-rw-r--r--library/core/src/char/methods.rs17
-rw-r--r--library/core/src/char/mod.rs17
-rw-r--r--library/core/tests/char.rs27
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css1
-rw-r--r--src/librustdoc/html/static/css/themes/ayu.css4
-rw-r--r--src/librustdoc/html/static/css/themes/dark.css4
-rw-r--r--src/librustdoc/html/static/css/themes/light.css6
-rw-r--r--src/test/pretty/ast-stmt-expr-attr.rs74
-rw-r--r--src/test/pretty/block-comment-wchar.pp8
-rw-r--r--src/test/pretty/delimited-token-groups.rs20
-rw-r--r--src/test/pretty/issue-4264.pp70
-rw-r--r--src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs8
-rw-r--r--src/test/pretty/macro_rules.rs4
-rw-r--r--src/test/pretty/match-naked-expr-medium.rs8
-rw-r--r--src/test/pretty/stmt_expr_attributes.rs66
-rw-r--r--src/test/pretty/vec-comments.pp32
-rw-r--r--src/test/ui/attributes/key-value-expansion.stderr10
-rw-r--r--src/test/ui/const-generics/defaults/pretty-printing-ast.stdout2
-rw-r--r--src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.rs24
-rw-r--r--src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.stderr19
-rw-r--r--src/test/ui/generic-associated-types/elided-in-expr-position.rs38
-rw-r--r--src/test/ui/generic-associated-types/elided-in-expr-position.stderr35
-rw-r--r--src/test/ui/match/issue-82392.stdout18
-rw-r--r--src/test/ui/proc-macro/cfg-eval-inner.stdout8
-rw-r--r--src/test/ui/proc-macro/issue-75930-derive-cfg.stdout50
-rw-r--r--src/test/ui/proc-macro/macro-rules-derive-cfg.stdout8
-rw-r--r--src/test/ui/proc-macro/quote-debug.stdout44
-rw-r--r--src/test/ui/rfc-2565-param-attrs/auxiliary/param-attrs.rs4
-rw-r--r--src/test/ui/suggestions/private-field.rs19
-rw-r--r--src/test/ui/suggestions/private-field.stderr11
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-60662.stdout4
52 files changed, 593 insertions, 323 deletions
diff --git a/compiler/rustc_ast_pretty/src/pp.rs b/compiler/rustc_ast_pretty/src/pp.rs
index d41cebc98df..e1f43cb20dc 100644
--- a/compiler/rustc_ast_pretty/src/pp.rs
+++ b/compiler/rustc_ast_pretty/src/pp.rs
@@ -147,6 +147,22 @@ pub enum Breaks {
 }
 
 #[derive(Clone, Copy)]
+enum IndentStyle {
+    /// Vertically aligned under whatever column this block begins at.
+    ///
+    ///     fn demo(arg1: usize,
+    ///             arg2: usize);
+    Visual,
+    /// Indented relative to the indentation level of the previous line.
+    ///
+    ///     fn demo(
+    ///         arg1: usize,
+    ///         arg2: usize,
+    ///     );
+    Block { offset: isize },
+}
+
+#[derive(Clone, Copy)]
 pub struct BreakToken {
     offset: isize,
     blank_space: isize,
@@ -154,7 +170,7 @@ pub struct BreakToken {
 
 #[derive(Clone, Copy)]
 pub struct BeginToken {
-    offset: isize,
+    indent: IndentStyle,
     breaks: Breaks,
 }
 
@@ -178,7 +194,7 @@ impl Token {
 #[derive(Copy, Clone)]
 enum PrintFrame {
     Fits,
-    Broken { offset: isize, breaks: Breaks },
+    Broken { indent: usize, breaks: Breaks },
 }
 
 const SIZE_INFINITY: isize = 0xffff;
@@ -204,6 +220,8 @@ pub struct Printer {
     scan_stack: VecDeque<usize>,
     /// Stack of blocks-in-progress being flushed by print
     print_stack: Vec<PrintFrame>,
+    /// Level of indentation of current line
+    indent: usize,
     /// Buffered indentation to avoid writing trailing whitespace
     pending_indentation: isize,
     /// The token most recently popped from the left boundary of the
@@ -229,6 +247,7 @@ impl Printer {
             right_total: 0,
             scan_stack: VecDeque::new(),
             print_stack: Vec::new(),
+            indent: 0,
             pending_indentation: 0,
             last_printed: None,
         }
@@ -368,38 +387,41 @@ impl Printer {
         *self
             .print_stack
             .last()
-            .unwrap_or(&PrintFrame::Broken { offset: 0, breaks: Breaks::Inconsistent })
+            .unwrap_or(&PrintFrame::Broken { indent: 0, breaks: Breaks::Inconsistent })
     }
 
     fn print_begin(&mut self, token: BeginToken, size: isize) {
         if size > self.space {
-            let col = self.margin - self.space + token.offset;
-            self.print_stack.push(PrintFrame::Broken { offset: col, breaks: token.breaks });
+            self.print_stack.push(PrintFrame::Broken { indent: self.indent, breaks: token.breaks });
+            self.indent = match token.indent {
+                IndentStyle::Block { offset } => (self.indent as isize + offset) as usize,
+                IndentStyle::Visual => (self.margin - self.space) as usize,
+            };
         } else {
             self.print_stack.push(PrintFrame::Fits);
         }
     }
 
     fn print_end(&mut self) {
-        self.print_stack.pop().unwrap();
+        if let PrintFrame::Broken { indent, .. } = self.print_stack.pop().unwrap() {
+            self.indent = indent;
+        }
     }
 
     fn print_break(&mut self, token: BreakToken, size: isize) {
-        let break_offset =
-            match self.get_top() {
-                PrintFrame::Fits => None,
-                PrintFrame::Broken { offset, breaks: Breaks::Consistent } => Some(offset),
-                PrintFrame::Broken { offset, breaks: Breaks::Inconsistent } => {
-                    if size > self.space { Some(offset) } else { None }
-                }
-            };
-        if let Some(offset) = break_offset {
-            self.out.push('\n');
-            self.pending_indentation = offset + token.offset;
-            self.space = self.margin - (offset + token.offset);
-        } else {
+        let fits = match self.get_top() {
+            PrintFrame::Fits => true,
+            PrintFrame::Broken { breaks: Breaks::Consistent, .. } => false,
+            PrintFrame::Broken { breaks: Breaks::Inconsistent, .. } => size <= self.space,
+        };
+        if fits {
             self.pending_indentation += token.blank_space;
             self.space -= token.blank_space;
+        } else {
+            self.out.push('\n');
+            let indent = self.indent as isize + token.offset;
+            self.pending_indentation = indent;
+            self.space = self.margin - indent;
         }
     }
 
@@ -422,7 +444,10 @@ impl Printer {
 
     /// "raw box"
     pub fn rbox(&mut self, indent: usize, breaks: Breaks) {
-        self.scan_begin(BeginToken { offset: indent as isize, breaks })
+        self.scan_begin(BeginToken {
+            indent: IndentStyle::Block { offset: indent as isize },
+            breaks,
+        })
     }
 
     /// Inconsistent breaking box
@@ -435,6 +460,10 @@ impl Printer {
         self.rbox(indent, Breaks::Consistent)
     }
 
+    pub fn visual_align(&mut self) {
+        self.scan_begin(BeginToken { indent: IndentStyle::Visual, breaks: Breaks::Consistent });
+    }
+
     pub fn break_offset(&mut self, n: usize, off: isize) {
         self.scan_break(BreakToken { offset: off, blank_space: n as isize })
     }
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs
index 96dbd3dca15..b575dc21961 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state.rs
@@ -315,7 +315,7 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
                     self.word(cmnt.lines[0].clone());
                     self.hardbreak()
                 } else {
-                    self.ibox(0);
+                    self.visual_align();
                     for line in &cmnt.lines {
                         if !line.is_empty() {
                             self.word(line.clone());
@@ -655,7 +655,7 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
         // Outer-box is consistent.
         self.cbox(INDENT_UNIT);
         // Head-box is inconsistent.
-        self.ibox(w.len() + 1);
+        self.ibox(0);
         // Keyword that starts the head.
         if !w.is_empty() {
             self.word_nbsp(w);
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
index 956200d60f5..6a5bba30b8b 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state/expr.rs
@@ -320,7 +320,9 @@ impl<'a> State<'a> {
                     self.print_ident(label.ident);
                     self.word_space(":");
                 }
-                self.head("while");
+                self.cbox(0);
+                self.ibox(0);
+                self.word_nbsp("while");
                 self.print_expr_as_cond(test);
                 self.space();
                 self.print_block_with_attrs(blk, attrs);
@@ -330,7 +332,9 @@ impl<'a> State<'a> {
                     self.print_ident(label.ident);
                     self.word_space(":");
                 }
-                self.head("for");
+                self.cbox(0);
+                self.ibox(0);
+                self.word_nbsp("for");
                 self.print_pat(pat);
                 self.space();
                 self.word_space("in");
@@ -343,12 +347,14 @@ impl<'a> State<'a> {
                     self.print_ident(label.ident);
                     self.word_space(":");
                 }
-                self.head("loop");
+                self.cbox(0);
+                self.ibox(0);
+                self.word_nbsp("loop");
                 self.print_block_with_attrs(blk, attrs);
             }
             ast::ExprKind::Match(ref expr, ref arms) => {
-                self.cbox(INDENT_UNIT);
-                self.ibox(INDENT_UNIT);
+                self.cbox(0);
+                self.ibox(0);
                 self.word_nbsp("match");
                 self.print_expr_as_cond(expr);
                 self.space();
@@ -388,7 +394,7 @@ impl<'a> State<'a> {
                     self.word_space(":");
                 }
                 // containing cbox, will be closed by print-block at }
-                self.cbox(INDENT_UNIT);
+                self.cbox(0);
                 // head-box, will be closed by print-block after {
                 self.ibox(0);
                 self.print_block_with_attrs(blk, attrs);
@@ -397,7 +403,7 @@ impl<'a> State<'a> {
                 self.word_nbsp("async");
                 self.print_capture_clause(capture_clause);
                 // cbox/ibox in analogy to the `ExprKind::Block` arm above
-                self.cbox(INDENT_UNIT);
+                self.cbox(0);
                 self.ibox(0);
                 self.print_block_with_attrs(blk, attrs);
             }
@@ -500,7 +506,9 @@ impl<'a> State<'a> {
                 self.word("?")
             }
             ast::ExprKind::TryBlock(ref blk) => {
-                self.head("try");
+                self.cbox(0);
+                self.ibox(0);
+                self.word_nbsp("try");
                 self.print_block_with_attrs(blk, attrs)
             }
             ast::ExprKind::Err => {
diff --git a/compiler/rustc_ast_pretty/src/pprust/state/item.rs b/compiler/rustc_ast_pretty/src/pprust/state/item.rs
index e575d6aa7e2..dac84ae9d5f 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state/item.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state/item.rs
@@ -1,5 +1,5 @@
 use crate::pp::Breaks::Inconsistent;
-use crate::pprust::state::{AnnNode, PrintState, State, INDENT_UNIT};
+use crate::pprust::state::{AnnNode, PrintState, State};
 
 use rustc_ast as ast;
 use rustc_ast::GenericBound;
@@ -377,7 +377,7 @@ impl<'a> State<'a> {
             self.space_if_not_bol();
             self.maybe_print_comment(v.span.lo());
             self.print_outer_attributes(&v.attrs);
-            self.ibox(INDENT_UNIT);
+            self.ibox(0);
             self.print_variant(v);
             self.word(",");
             self.end();
diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs
index 266eec08ceb..d1b24b332bd 100644
--- a/compiler/rustc_infer/src/infer/mod.rs
+++ b/compiler/rustc_infer/src/infer/mod.rs
@@ -195,7 +195,7 @@ pub struct InferCtxtInner<'tcx> {
     // Opaque types found in explicit return types and their
     // associated fresh inference variable. Writeback resolves these
     // variables to get the concrete type, which can be used to
-    // 'de-opaque' OpaqueTypeDecl, after typeck is done with all functions.
+    // 'de-opaque' OpaqueTypeDecl outside of type inference.
     pub opaque_types: OpaqueTypeMap<'tcx>,
 
     /// A map from inference variables created from opaque
diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs
index 21c25a2fd98..cb08e952586 100644
--- a/compiler/rustc_lint/src/context.rs
+++ b/compiler/rustc_lint/src/context.rs
@@ -524,7 +524,7 @@ impl LintStore {
     }
 }
 
-/// Context for lint checking after type checking.
+/// Context for lint checking outside of type inference.
 pub struct LateContext<'tcx> {
     /// Type context we're checking in.
     pub tcx: TyCtxt<'tcx>,
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index c7b1e25b993..b1ab0f5b533 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -894,7 +894,7 @@ pub struct LocalDecl<'tcx> {
     /// across a suspension point against the type components of the generator
     /// which type checking knows are live across a suspension point. We need to
     /// flag drop flags to avoid triggering this check as they are introduced
-    /// after typeck.
+    /// outside of type inference.
     ///
     /// This should be sound because the drop flags are fully algebraic, and
     /// therefore don't affect the auto-trait or outlives properties of the
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs
index 6c8573805cb..d063494f2bc 100644
--- a/compiler/rustc_middle/src/ty/context.rs
+++ b/compiler/rustc_middle/src/ty/context.rs
@@ -220,7 +220,7 @@ pub struct CommonLifetimes<'tcx> {
     /// `ReStatic`
     pub re_static: Region<'tcx>,
 
-    /// Erased region, used after type-checking
+    /// Erased region, used outside of type inference.
     pub re_erased: Region<'tcx>,
 }
 
@@ -360,7 +360,7 @@ pub struct TypeckResults<'tcx> {
     field_indices: ItemLocalMap<usize>,
 
     /// Stores the types for various nodes in the AST. Note that this table
-    /// is not guaranteed to be populated until after typeck. See
+    /// is not guaranteed to be populated outside inference. See
     /// typeck::check::fn_ctxt for details.
     node_types: ItemLocalMap<Ty<'tcx>>,
 
diff --git a/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs b/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
index 84ab42a760b..b3b2bb4459f 100644
--- a/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
+++ b/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
@@ -34,8 +34,8 @@ impl<'tcx> TyCtxt<'tcx> {
     /// Erase the regions in `value` and then fully normalize all the
     /// types found within. The result will also have regions erased.
     ///
-    /// This is appropriate to use only after type-check: it assumes
-    /// that normalization will succeed, for example.
+    /// This should only be used outside of type inference. For example,
+    /// it assumes that normalization will succeed.
     pub fn normalize_erasing_regions<T>(self, param_env: ty::ParamEnv<'tcx>, value: T) -> T
     where
         T: TypeFoldable<'tcx>,
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs
index f70fde2a040..7d4af6cfa40 100644
--- a/compiler/rustc_middle/src/ty/sty.rs
+++ b/compiler/rustc_middle/src/ty/sty.rs
@@ -1464,11 +1464,11 @@ pub enum RegionKind {
     /// Static data that has an "infinite" lifetime. Top in the region lattice.
     ReStatic,
 
-    /// A region variable. Should not exist after typeck.
+    /// A region variable. Should not exist outside of type inference.
     ReVar(RegionVid),
 
     /// A placeholder region -- basically, the higher-ranked version of `ReFree`.
-    /// Should not exist after typeck.
+    /// Should not exist outside of type inference.
     RePlaceholder(ty::PlaceholderRegion),
 
     /// Empty lifetime is for data that is never accessed.  We tag the
diff --git a/compiler/rustc_save_analysis/src/lib.rs b/compiler/rustc_save_analysis/src/lib.rs
index b95fe1b0549..570fa873a23 100644
--- a/compiler/rustc_save_analysis/src/lib.rs
+++ b/compiler/rustc_save_analysis/src/lib.rs
@@ -984,7 +984,7 @@ pub fn process_crate<'l, 'tcx, H: SaveHandler>(
         tcx.dep_graph.with_ignore(|| {
             info!("Dumping crate {}", cratename);
 
-            // Privacy checking requires and is done after type checking; use a
+            // Privacy checking must be done outside of type inference; use a
             // fallback in case the access levels couldn't have been correctly computed.
             let access_levels = match tcx.sess.compile_status() {
                 Ok(..) => tcx.privacy_access_levels(()),
diff --git a/compiler/rustc_target/src/asm/mod.rs b/compiler/rustc_target/src/asm/mod.rs
index 8046267a59d..a84410d0f3c 100644
--- a/compiler/rustc_target/src/asm/mod.rs
+++ b/compiler/rustc_target/src/asm/mod.rs
@@ -444,7 +444,7 @@ impl InlineAsmRegClass {
     }
 
     /// Returns a suggested register class to use for this type. This is called
-    /// after type checking via `supported_types` fails to give a better error
+    /// when `supported_types` fails to give a better error
     /// message to the user.
     pub fn suggest_class(self, arch: InlineAsmArch, ty: InlineAsmType) -> Option<Self> {
         match self {
diff --git a/compiler/rustc_trait_selection/src/traits/codegen.rs b/compiler/rustc_trait_selection/src/traits/codegen.rs
index 848aba7c912..759bc696981 100644
--- a/compiler/rustc_trait_selection/src/traits/codegen.rs
+++ b/compiler/rustc_trait_selection/src/traits/codegen.rs
@@ -18,7 +18,6 @@ use rustc_middle::ty::{self, TyCtxt};
 /// that type check should guarantee to us that all nested
 /// obligations *could be* resolved if we wanted to.
 ///
-/// Assumes that this is run after the entire crate has been successfully type-checked.
 /// This also expects that `trait_ref` is fully normalized.
 pub fn codegen_fulfill_obligation<'tcx>(
     tcx: TyCtxt<'tcx>,
@@ -101,7 +100,7 @@ pub fn codegen_fulfill_obligation<'tcx>(
 /// Finishes processes any obligations that remain in the
 /// fulfillment context, and then returns the result with all type
 /// variables removed and regions erased. Because this is intended
-/// for use after type-check has completed, if any errors occur,
+/// for use outside of type inference, if any errors occur,
 /// it will panic. It is used during normalization and other cases
 /// where processing the obligations in `fulfill_cx` may cause
 /// type inference variables that appear in `result` to be
@@ -124,7 +123,10 @@ where
     if !errors.is_empty() {
         infcx.tcx.sess.delay_span_bug(
             rustc_span::DUMMY_SP,
-            &format!("Encountered errors `{:?}` resolving bounds after type-checking", errors),
+            &format!(
+                "Encountered errors `{:?}` resolving bounds outside of type inference",
+                errors
+            ),
         );
     }
 
diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs
index 23f534858b8..2927e64f705 100644
--- a/compiler/rustc_trait_selection/src/traits/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/mod.rs
@@ -291,7 +291,7 @@ pub fn normalize_param_env_or_error<'tcx>(
     //
     // In any case, in practice, typeck constructs all the
     // parameter environments once for every fn as it goes,
-    // and errors will get reported then; so after typeck we
+    // and errors will get reported then; so outside of type inference we
     // can be sure that no errors should occur.
 
     debug!(
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs
index e8b46e88a42..087fc6034d9 100644
--- a/compiler/rustc_trait_selection/src/traits/project.rs
+++ b/compiler/rustc_trait_selection/src/traits/project.rs
@@ -391,7 +391,7 @@ impl<'a, 'b, 'tcx> TypeFolder<'tcx> for AssocTypeNormalizer<'a, 'b, 'tcx> {
             // severe performance implications for large opaque types with
             // late-bound regions. See `issue-88862` benchmark.
             ty::Opaque(def_id, substs) if !substs.has_escaping_bound_vars() => {
-                // Only normalize `impl Trait` after type-checking, usually in codegen.
+                // Only normalize `impl Trait` outside of type inference, usually in codegen.
                 match self.param_env.reveal() {
                     Reveal::UserFacing => ty.super_fold_with(self),
 
diff --git a/compiler/rustc_trait_selection/src/traits/query/normalize.rs b/compiler/rustc_trait_selection/src/traits/query/normalize.rs
index 81ee22c1de4..3c9e1bbcef2 100644
--- a/compiler/rustc_trait_selection/src/traits/query/normalize.rs
+++ b/compiler/rustc_trait_selection/src/traits/query/normalize.rs
@@ -200,7 +200,7 @@ impl<'cx, 'tcx> FallibleTypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
             // severe performance implications for large opaque types with
             // late-bound regions. See `issue-88862` benchmark.
             ty::Opaque(def_id, substs) if !substs.has_escaping_bound_vars() => {
-                // Only normalize `impl Trait` after type-checking, usually in codegen.
+                // Only normalize `impl Trait` outside of type inference, usually in codegen.
                 match self.param_env.reveal() {
                     Reveal::UserFacing => ty.try_super_fold_with(self),
 
diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs
index fef83190468..b882a940d40 100644
--- a/compiler/rustc_ty_utils/src/ty.rs
+++ b/compiler/rustc_ty_utils/src/ty.rs
@@ -149,7 +149,7 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
     // kind of an "idempotent" action, but I'm not sure where would be
     // a better place. In practice, we construct environments for
     // every fn once during type checking, and we'll abort if there
-    // are any errors at that point, so after type checking you can be
+    // are any errors at that point, so outside of type inference you can be
     // sure that this will succeed without errors anyway.
 
     if tcx.sess.opts.debugging_opts.chalk {
diff --git a/compiler/rustc_typeck/src/astconv/generics.rs b/compiler/rustc_typeck/src/astconv/generics.rs
index 956696546da..05ff7f818c7 100644
--- a/compiler/rustc_typeck/src/astconv/generics.rs
+++ b/compiler/rustc_typeck/src/astconv/generics.rs
@@ -445,7 +445,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
         let named_type_param_count =
             param_counts.types - has_self as usize - synth_type_param_count;
         let infer_lifetimes =
-            gen_pos != GenericArgPosition::Type && !gen_args.has_lifetime_params();
+            (gen_pos != GenericArgPosition::Type || infer_args) && !gen_args.has_lifetime_params();
 
         if gen_pos != GenericArgPosition::Type && !gen_args.bindings.is_empty() {
             Self::prohibit_assoc_ty_binding(tcx, gen_args.bindings[0].span);
diff --git a/compiler/rustc_typeck/src/astconv/mod.rs b/compiler/rustc_typeck/src/astconv/mod.rs
index 4cf8ddcb8f0..16fc9a01a27 100644
--- a/compiler/rustc_typeck/src/astconv/mod.rs
+++ b/compiler/rustc_typeck/src/astconv/mod.rs
@@ -482,7 +482,20 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
             ) -> subst::GenericArg<'tcx> {
                 let tcx = self.astconv.tcx();
                 match param.kind {
-                    GenericParamDefKind::Lifetime => tcx.lifetimes.re_static.into(),
+                    GenericParamDefKind::Lifetime => self
+                        .astconv
+                        .re_infer(Some(param), self.span)
+                        .unwrap_or_else(|| {
+                            debug!(?param, "unelided lifetime in signature");
+
+                            // This indicates an illegal lifetime in a non-assoc-trait position
+                            tcx.sess.delay_span_bug(self.span, "unelided lifetime in signature");
+
+                            // Supply some dummy value. We don't have an
+                            // `re_error`, annoyingly, so use `'static`.
+                            tcx.lifetimes.re_static
+                        })
+                        .into(),
                     GenericParamDefKind::Type { has_default, .. } => {
                         if !infer_args && has_default {
                             // No type parameter provided, but a default exists.
diff --git a/compiler/rustc_typeck/src/check/expr.rs b/compiler/rustc_typeck/src/check/expr.rs
index 23cc4b0ffc8..0e1dbc53806 100644
--- a/compiler/rustc_typeck/src/check/expr.rs
+++ b/compiler/rustc_typeck/src/check/expr.rs
@@ -31,10 +31,11 @@ use rustc_hir as hir;
 use rustc_hir::def::{CtorKind, DefKind, Res};
 use rustc_hir::def_id::DefId;
 use rustc_hir::intravisit::Visitor;
-use rustc_hir::{ExprKind, QPath};
+use rustc_hir::{ExprKind, HirId, QPath};
 use rustc_infer::infer;
 use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
 use rustc_infer::infer::InferOk;
+use rustc_middle::middle::stability;
 use rustc_middle::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase};
 use rustc_middle::ty::error::ExpectedFound;
 use rustc_middle::ty::error::TypeError::{FieldMisMatch, Sorts};
@@ -1720,9 +1721,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             _ => {
                 // prevent all specified fields from being suggested
                 let skip_fields = skip_fields.iter().map(|x| x.ident.name);
-                if let Some(field_name) =
-                    Self::suggest_field_name(variant, field.ident.name, skip_fields.collect())
-                {
+                if let Some(field_name) = self.suggest_field_name(
+                    variant,
+                    field.ident.name,
+                    skip_fields.collect(),
+                    expr_span,
+                ) {
                     err.span_suggestion(
                         field.ident.span,
                         "a field with a similar name exists",
@@ -1743,7 +1747,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                                     format!("`{}` does not have this field", ty),
                                 );
                             }
-                            let available_field_names = self.available_field_names(variant);
+                            let available_field_names =
+                                self.available_field_names(variant, expr_span);
                             if !available_field_names.is_empty() {
                                 err.note(&format!(
                                     "available fields are: {}",
@@ -1759,19 +1764,27 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         err.emit();
     }
 
-    // Return an hint about the closest match in field names
+    // Return a hint about the closest match in field names
     fn suggest_field_name(
+        &self,
         variant: &'tcx ty::VariantDef,
         field: Symbol,
         skip: Vec<Symbol>,
+        // The span where stability will be checked
+        span: Span,
     ) -> Option<Symbol> {
         let names = variant
             .fields
             .iter()
             .filter_map(|field| {
                 // ignore already set fields and private fields from non-local crates
+                // and unstable fields.
                 if skip.iter().any(|&x| x == field.name)
                     || (!variant.def_id.is_local() && !field.vis.is_public())
+                    || matches!(
+                        self.tcx.eval_stability(field.did, None, span, None),
+                        stability::EvalResult::Deny { .. }
+                    )
                 {
                     None
                 } else {
@@ -1783,7 +1796,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         find_best_match_for_name(&names, field, None)
     }
 
-    fn available_field_names(&self, variant: &'tcx ty::VariantDef) -> Vec<Symbol> {
+    fn available_field_names(
+        &self,
+        variant: &'tcx ty::VariantDef,
+        access_span: Span,
+    ) -> Vec<Symbol> {
         variant
             .fields
             .iter()
@@ -1793,7 +1810,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                     .adjust_ident_and_get_scope(field.ident(self.tcx), variant.def_id, self.body_id)
                     .1;
                 field.vis.is_accessible_from(def_scope, self.tcx)
+                    && !matches!(
+                        self.tcx.eval_stability(field.did, None, access_span, None),
+                        stability::EvalResult::Deny { .. }
+                    )
             })
+            .filter(|field| !self.tcx.is_doc_hidden(field.did))
             .map(|field| field.name)
             .collect()
     }
@@ -1948,7 +1970,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             "ban_nonexisting_field: field={:?}, base={:?}, expr={:?}, expr_ty={:?}",
             field, base, expr, expr_t
         );
-        let mut err = self.no_such_field_err(field, expr_t);
+        let mut err = self.no_such_field_err(field, expr_t, base.hir_id);
 
         match *expr_t.peel_refs().kind() {
             ty::Array(_, len) => {
@@ -1958,7 +1980,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 self.suggest_first_deref_field(&mut err, expr, base, field);
             }
             ty::Adt(def, _) if !def.is_enum() => {
-                self.suggest_fields_on_recordish(&mut err, def, field);
+                self.suggest_fields_on_recordish(&mut err, def, field, expr.span);
             }
             ty::Param(param_ty) => {
                 self.point_at_param_definition(&mut err, param_ty);
@@ -2121,9 +2143,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         err: &mut DiagnosticBuilder<'_>,
         def: &'tcx ty::AdtDef,
         field: Ident,
+        access_span: Span,
     ) {
         if let Some(suggested_field_name) =
-            Self::suggest_field_name(def.non_enum_variant(), field.name, vec![])
+            self.suggest_field_name(def.non_enum_variant(), field.name, vec![], access_span)
         {
             err.span_suggestion(
                 field.span,
@@ -2134,7 +2157,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         } else {
             err.span_label(field.span, "unknown field");
             let struct_variant_def = def.non_enum_variant();
-            let field_names = self.available_field_names(struct_variant_def);
+            let field_names = self.available_field_names(struct_variant_def, access_span);
             if !field_names.is_empty() {
                 err.note(&format!(
                     "available fields are: {}",
@@ -2186,6 +2209,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         &self,
         field: Ident,
         expr_t: &'tcx ty::TyS<'tcx>,
+        id: HirId,
     ) -> DiagnosticBuilder<'_> {
         let span = field.span;
         debug!("no_such_field_err(span: {:?}, field: {:?}, expr_t: {:?})", span, field, expr_t);
@@ -2203,9 +2227,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         // try to add a suggestion in case the field is a nested field of a field of the Adt
         if let Some((fields, substs)) = self.get_field_candidates(span, &expr_t) {
             for candidate_field in fields.iter() {
-                if let Some(field_path) =
-                    self.check_for_nested_field(span, field, candidate_field, substs, vec![])
-                {
+                if let Some(field_path) = self.check_for_nested_field(
+                    span,
+                    field,
+                    candidate_field,
+                    substs,
+                    vec![],
+                    self.tcx.parent_module(id).to_def_id(),
+                ) {
                     let field_path_str = field_path
                         .iter()
                         .map(|id| id.name.to_ident_string())
@@ -2257,6 +2286,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         candidate_field: &ty::FieldDef,
         subst: SubstsRef<'tcx>,
         mut field_path: Vec<Ident>,
+        id: DefId,
     ) -> Option<Vec<Ident>> {
         debug!(
             "check_for_nested_field(span: {:?}, candidate_field: {:?}, field_path: {:?}",
@@ -2276,10 +2306,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             let field_ty = candidate_field.ty(self.tcx, subst);
             if let Some((nested_fields, subst)) = self.get_field_candidates(span, &field_ty) {
                 for field in nested_fields.iter() {
-                    let ident = field.ident(self.tcx).normalize_to_macros_2_0();
-                    if ident == target_field {
-                        return Some(field_path);
-                    } else {
+                    let accessible = field.vis.is_accessible_from(id, self.tcx);
+                    if accessible {
+                        let ident = field.ident(self.tcx).normalize_to_macros_2_0();
+                        if ident == target_field {
+                            return Some(field_path);
+                        }
                         let field_path = field_path.clone();
                         if let Some(path) = self.check_for_nested_field(
                             span,
@@ -2287,6 +2319,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                             field,
                             subst,
                             field_path,
+                            id,
                         ) {
                             return Some(path);
                         }
diff --git a/library/core/src/char/decode.rs b/library/core/src/char/decode.rs
index 5dd8c5ef789..8b9f979b573 100644
--- a/library/core/src/char/decode.rs
+++ b/library/core/src/char/decode.rs
@@ -120,9 +120,34 @@ impl<I: Iterator<Item = u16>> Iterator for DecodeUtf16<I> {
     #[inline]
     fn size_hint(&self) -> (usize, Option<usize>) {
         let (low, high) = self.iter.size_hint();
-        // we could be entirely valid surrogates (2 elements per
-        // char), or entirely non-surrogates (1 element per char)
-        (low / 2, high)
+
+        let (low_buf, high_buf) = match self.buf {
+            // buf is empty, no additional elements from it.
+            None => (0, 0),
+            // `u` is a non surrogate, so it's always an additional character.
+            Some(u) if u < 0xD800 || 0xDFFF < u => (1, 1),
+            // `u` is a leading surrogate (it can never be a trailing surrogate and
+            // it's a surrogate due to the previous branch) and `self.iter` is empty.
+            //
+            // `u` can't be paired, since the `self.iter` is empty,
+            // so it will always become an additional element (error).
+            Some(_u) if high == Some(0) => (1, 1),
+            // `u` is a leading surrogate and `iter` may be non-empty.
+            //
+            // `u` can either pair with a trailing surrogate, in which case no additional elements
+            // are produced, or it can become an error, in which case it's an additional character (error).
+            Some(_u) => (0, 1),
+        };
+
+        // `self.iter` could contain entirely valid surrogates (2 elements per
+        // char), or entirely non-surrogates (1 element per char).
+        //
+        // On odd lower bound, at least one element must stay unpaired
+        // (with other elements from `self.iter`), so we round up.
+        let low = low.div_ceil(2) + low_buf;
+        let high = high.and_then(|h| h.checked_add(high_buf));
+
+        (low, high)
     }
 }
 
diff --git a/library/core/src/char/methods.rs b/library/core/src/char/methods.rs
index 7250dca2adf..c4c0a5a6c78 100644
--- a/library/core/src/char/methods.rs
+++ b/library/core/src/char/methods.rs
@@ -9,14 +9,19 @@ use super::*;
 
 #[lang = "char"]
 impl char {
-    /// The highest valid code point a `char` can have.
+    /// The highest valid code point a `char` can have, `'\u{10FFFF}'`.
     ///
-    /// A `char` is a [Unicode Scalar Value], which means that it is a [Code
-    /// Point], but only ones within a certain range. `MAX` is the highest valid
-    /// code point that's a valid [Unicode Scalar Value].
+    /// # Examples
+    ///
+    /// ```
+    /// # fn something_which_returns_char() -> char { 'a' }
+    /// let c: char = something_which_returns_char();
+    /// assert!(c <= char::MAX);
     ///
-    /// [Unicode Scalar Value]: https://www.unicode.org/glossary/#unicode_scalar_value
-    /// [Code Point]: https://www.unicode.org/glossary/#code_point
+    /// let value_at_max = char::MAX as u32;
+    /// assert_eq!(char::from_u32(value_at_max), Some('\u{10FFFF}'));
+    /// assert_eq!(char::from_u32(value_at_max + 1), None);
+    /// ```
     #[stable(feature = "assoc_char_consts", since = "1.52.0")]
     pub const MAX: char = '\u{10ffff}';
 
diff --git a/library/core/src/char/mod.rs b/library/core/src/char/mod.rs
index f65f84e93ae..9364ac4f3ec 100644
--- a/library/core/src/char/mod.rs
+++ b/library/core/src/char/mod.rs
@@ -89,14 +89,19 @@ const MAX_THREE_B: u32 = 0x10000;
     Cn  Unassigned              a reserved unassigned code point or a noncharacter
 */
 
-/// The highest valid code point a `char` can have.
+/// The highest valid code point a `char` can have, `'\u{10FFFF}'`.
 ///
-/// A [`char`] is a [Unicode Scalar Value], which means that it is a [Code
-/// Point], but only ones within a certain range. `MAX` is the highest valid
-/// code point that's a valid [Unicode Scalar Value].
+/// # Examples
 ///
-/// [Unicode Scalar Value]: https://www.unicode.org/glossary/#unicode_scalar_value
-/// [Code Point]: https://www.unicode.org/glossary/#code_point
+/// ```
+/// # fn something_which_returns_char() -> char { 'a' }
+/// let c: char = something_which_returns_char();
+/// assert!(c <= char::MAX);
+///
+/// let value_at_max = char::MAX as u32;
+/// assert_eq!(char::from_u32(value_at_max), Some('\u{10FFFF}'));
+/// assert_eq!(char::from_u32(value_at_max + 1), None);
+/// ```
 #[stable(feature = "rust1", since = "1.0.0")]
 pub const MAX: char = char::MAX;
 
diff --git a/library/core/tests/char.rs b/library/core/tests/char.rs
index 2b857a65919..4c899b6eb43 100644
--- a/library/core/tests/char.rs
+++ b/library/core/tests/char.rs
@@ -309,6 +309,33 @@ fn test_decode_utf16() {
 }
 
 #[test]
+fn test_decode_utf16_size_hint() {
+    fn check(s: &[u16]) {
+        let mut iter = char::decode_utf16(s.iter().cloned());
+
+        loop {
+            let count = iter.clone().count();
+            let (lower, upper) = iter.size_hint();
+
+            assert!(
+                lower <= count && count <= upper.unwrap(),
+                "lower = {lower}, count = {count}, upper = {upper:?}"
+            );
+
+            if let None = iter.next() {
+                break;
+            }
+        }
+    }
+
+    check(&[0xD800, 0xD800, 0xDC00]);
+    check(&[0xD800, 0xD800, 0x0]);
+    check(&[0xD800, 0x41, 0x42]);
+    check(&[0xD800, 0]);
+    check(&[0xD834, 0x006d]);
+}
+
+#[test]
 fn ed_iterator_specializations() {
     // Check counting
     assert_eq!('\n'.escape_default().count(), 2);
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 87403a8b834..76913a5c1c5 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -1502,7 +1502,6 @@ kbd {
 	vertical-align: middle;
 	border: solid 1px;
 	border-radius: 3px;
-	box-shadow: inset 0 -1px 0;
 	cursor: default;
 }
 
diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css
index cee45e1de39..0aaf4f78c34 100644
--- a/src/librustdoc/html/static/css/themes/ayu.css
+++ b/src/librustdoc/html/static/css/themes/ayu.css
@@ -532,7 +532,7 @@ kbd {
 	background-color: #314559;
 	border-color: #5c6773;
 	border-bottom-color: #5c6773;
-	box-shadow-color: #c6cbd1;
+	box-shadow: inset 0 -1px 0 #5c6773;
 }
 
 #theme-picker, #settings-menu, #help-button {
@@ -631,5 +631,5 @@ input:checked + .slider {
 	background: #616161;
 }
 .toggle-line:hover .toggle-line-inner {
-	background: ##898989;
+	background: #898989;
 }
diff --git a/src/librustdoc/html/static/css/themes/dark.css b/src/librustdoc/html/static/css/themes/dark.css
index c5817ba4e73..4fad2359ff0 100644
--- a/src/librustdoc/html/static/css/themes/dark.css
+++ b/src/librustdoc/html/static/css/themes/dark.css
@@ -408,7 +408,7 @@ kbd {
 	background-color: #fafbfc;
 	border-color: #d1d5da;
 	border-bottom-color: #c6cbd1;
-	box-shadow-color: #c6cbd1;
+	box-shadow: inset 0 -1px 0 #c6cbd1;
 }
 
 #theme-picker, #settings-menu, #help-button {
@@ -497,5 +497,5 @@ div.files > .selected {
 	background: #616161;
 }
 .toggle-line:hover .toggle-line-inner {
-	background: ##898989;
+	background: #898989;
 }
diff --git a/src/librustdoc/html/static/css/themes/light.css b/src/librustdoc/html/static/css/themes/light.css
index 3d2cd23ae3a..16a777b7e67 100644
--- a/src/librustdoc/html/static/css/themes/light.css
+++ b/src/librustdoc/html/static/css/themes/light.css
@@ -44,7 +44,9 @@ pre, .rustdoc.source .example-wrap {
 }
 
 .rust-logo {
-	/* No need for a border in here! */
+	/* This rule exists to force other themes to explicitly style the logo.
+	 * Rustdoc has a custom linter for this purpose.
+	 */
 }
 
 /* Improve the scrollbar display on webkit-based browsers */
@@ -392,7 +394,7 @@ kbd {
 	background-color: #fafbfc;
 	border-color: #d1d5da;
 	border-bottom-color: #c6cbd1;
-	box-shadow-color: #c6cbd1;
+	box-shadow: inset 0 -1px 0 #c6cbd1;
 }
 
 #theme-picker, #settings-menu, #help-button {
diff --git a/src/test/pretty/ast-stmt-expr-attr.rs b/src/test/pretty/ast-stmt-expr-attr.rs
index e32f5ca24ea..2404b321942 100644
--- a/src/test/pretty/ast-stmt-expr-attr.rs
+++ b/src/test/pretty/ast-stmt-expr-attr.rs
@@ -28,67 +28,67 @@ fn syntax() {
     let _ = #[attr] (x as Y);
     let _ =
         #[attr] while true {
-                    #![attr]
-                };
+            #![attr]
+        };
     let _ =
         #[attr] while let Some(false) = true {
-                    #![attr]
-                };
+            #![attr]
+        };
     let _ =
         #[attr] for x in y {
-                    #![attr]
-                };
+            #![attr]
+        };
     let _ =
         #[attr] loop {
-                    #![attr]
-                };
+            #![attr]
+        };
     let _ =
         #[attr] match true {
-                    #![attr]
-                            #[attr]
-                            _ => false,
-                };
+            #![attr]
+                #[attr]
+                _ => false,
+        };
     let _ = #[attr] || #[attr] foo;
     let _ = #[attr] move || #[attr] foo;
     let _ =
         #[attr] ||
-                    #[attr] {
-                                #![attr]
-                                foo
-                            };
+            #[attr] {
+                #![attr]
+                foo
+            };
     let _ =
         #[attr] move ||
-                    #[attr] {
-                                #![attr]
-                                foo
-                            };
+            #[attr] {
+                #![attr]
+                foo
+            };
     let _ =
         #[attr] ||
-                    {
-                        #![attr]
-                        foo
-                    };
+            {
+                #![attr]
+                foo
+            };
     let _ =
         #[attr] move ||
-                    {
-                        #![attr]
-                        foo
-                    };
+            {
+                #![attr]
+                foo
+            };
     let _ =
         #[attr] {
-                    #![attr]
-                };
+            #![attr]
+        };
     let _ =
         #[attr] {
-                    #![attr]
-                    let _ = ();
-                };
+            #![attr]
+            let _ = ();
+        };
     let _ =
         #[attr] {
-                    #![attr]
-                    let _ = ();
-                    foo
-                };
+            #![attr]
+            let _ = ();
+            foo
+        };
     let _ = #[attr] x = y;
     let _ = #[attr] (x = y);
     let _ = #[attr] x += y;
diff --git a/src/test/pretty/block-comment-wchar.pp b/src/test/pretty/block-comment-wchar.pp
index 385afa4f33e..8c8580b07c2 100644
--- a/src/test/pretty/block-comment-wchar.pp
+++ b/src/test/pretty/block-comment-wchar.pp
@@ -93,9 +93,9 @@ fn main() {
     // Taken from https://www.unicode.org/Public/UNIDATA/PropList.txt
     let chars =
         ['\x0A', '\x0B', '\x0C', '\x0D', '\x20', '\u{85}', '\u{A0}',
-         '\u{1680}', '\u{2000}', '\u{2001}', '\u{2002}', '\u{2003}',
-         '\u{2004}', '\u{2005}', '\u{2006}', '\u{2007}', '\u{2008}',
-         '\u{2009}', '\u{200A}', '\u{2028}', '\u{2029}', '\u{202F}',
-         '\u{205F}', '\u{3000}'];
+                '\u{1680}', '\u{2000}', '\u{2001}', '\u{2002}', '\u{2003}',
+                '\u{2004}', '\u{2005}', '\u{2006}', '\u{2007}', '\u{2008}',
+                '\u{2009}', '\u{200A}', '\u{2028}', '\u{2029}', '\u{202F}',
+                '\u{205F}', '\u{3000}'];
     for c in &chars { let ws = c.is_whitespace(); println!("{} {}", c, ws); }
 }
diff --git a/src/test/pretty/delimited-token-groups.rs b/src/test/pretty/delimited-token-groups.rs
index 1137d804564..c7c9277faf6 100644
--- a/src/test/pretty/delimited-token-groups.rs
+++ b/src/test/pretty/delimited-token-groups.rs
@@ -17,9 +17,9 @@ mac! {
 
 mac! {
     a(aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-      aaaaaaaa aaaaaaaa) a
+    aaaaaaaa aaaaaaaa) a
     [aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-     aaaaaaaa aaaaaaaa] a
+    aaaaaaaa aaaaaaaa] a
     {
         aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
         aaaaaaaa aaaaaaaa aaaaaaaa
@@ -27,22 +27,22 @@ mac! {
 }
 
 mac!(aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-     aaaaaaaa aaaaaaaa);
+aaaaaaaa aaaaaaaa);
 mac![aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-     aaaaaaaa aaaaaaaa];
+aaaaaaaa aaaaaaaa];
 mac! {
     aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
     aaaaaaaa aaaaaaaa
 }
 
 #[rustc_dummy(aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-              aaaaaaaa aaaaaaaa aaaaaaaa)]
+aaaaaaaa aaaaaaaa aaaaaaaa)]
 #[rustc_dummy[aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-              aaaaaaaa aaaaaaaa aaaaaaaa]]
+aaaaaaaa aaaaaaaa aaaaaaaa]]
 #[rustc_dummy {
-      aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
-      aaaaaaaa aaaaaaaa
-  }]
+    aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
+    aaaaaaaa aaaaaaaa
+}]
 #[rustc_dummy =
-  "aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa"]
+"aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa"]
 fn main() {}
diff --git a/src/test/pretty/issue-4264.pp b/src/test/pretty/issue-4264.pp
index 93967e720c1..3830c3aa6c9 100644
--- a/src/test/pretty/issue-4264.pp
+++ b/src/test/pretty/issue-4264.pp
@@ -11,15 +11,15 @@ extern crate std;
 pub fn foo(_: [i32; (3 as usize)]) ({ } as ())
 
 pub fn bar() ({
-                  const FOO: usize = ((5 as usize) - (4 as usize) as usize);
-                  let _: [(); (FOO as usize)] = ([(() as ())] as [(); 1]);
+        const FOO: usize = ((5 as usize) - (4 as usize) as usize);
+        let _: [(); (FOO as usize)] = ([(() as ())] as [(); 1]);
 
-                  let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]);
+        let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]);
 
-                  let _ =
-                      (((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3])
-                            as &[i32; 3]) as *const _ as *const [i32; 3]) as
-                          *const [i32; (3 as usize)] as *const [i32; 3]);
+        let _ =
+            (((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3]) as
+                        &[i32; 3]) as *const _ as *const [i32; 3]) as
+                *const [i32; (3 as usize)] as *const [i32; 3]);
 
 
 
@@ -29,29 +29,19 @@ pub fn bar() ({
 
 
 
-                  ({
-                       let res =
-                           ((::alloc::fmt::format as
-                                for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1
-                                                                                   as
-                                                                                   fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test"
-                                                                                                                                                                as
-                                                                                                                                                                &str)]
-                                                                                                                                                              as
-                                                                                                                                                              [&str; 1])
-                                                                                                                                                            as
-                                                                                                                                                            &[&str; 1]),
-                                                                                                                                                        (&([]
-                                                                                                                                                              as
-                                                                                                                                                              [ArgumentV1; 0])
-                                                                                                                                                            as
-                                                                                                                                                            &[ArgumentV1; 0]))
-                                                                                  as
-                                                                                  Arguments))
-                               as String);
-                       (res as String)
-                   } as String);
-              } as ())
+        ({
+                let res =
+                    ((::alloc::fmt::format as
+                            for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1
+                                as
+                                fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test"
+                                            as &str)] as [&str; 1]) as
+                                &[&str; 1]),
+                            (&([] as [ArgumentV1; 0]) as &[ArgumentV1; 0])) as
+                            Arguments)) as String);
+                (res as String)
+            } as String);
+    } as ())
 pub type Foo = [i32; (3 as usize)];
 pub struct Bar {
     pub x: [i32; (3 as usize)],
@@ -60,19 +50,9 @@ pub struct TupleBar([i32; (4 as usize)]);
 pub enum Baz { BazVariant([i32; (5 as usize)]), }
 pub fn id<T>(x: T) -> T ({ (x as T) } as T)
 pub fn use_id() ({
-                     let _ =
-                         ((id::<[i32; (3 as usize)]> as
-                              fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1
-                                                                               as
-                                                                               i32),
-                                                                           (2
-                                                                               as
-                                                                               i32),
-                                                                           (3
-                                                                               as
-                                                                               i32)]
-                                                                             as
-                                                                             [i32; 3]))
-                             as [i32; 3]);
-                 } as ())
+        let _ =
+            ((id::<[i32; (3 as usize)]> as
+                    fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1 as i32),
+                        (2 as i32), (3 as i32)] as [i32; 3])) as [i32; 3]);
+    } as ())
 fn main() ({ } as ())
diff --git a/src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs b/src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs
index ed7879001d5..87f525a6178 100644
--- a/src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs
+++ b/src/test/pretty/issue-68710-field-attr-proc-mac-lost.rs
@@ -9,8 +9,8 @@ struct C {
 #[allow()]
 const C: C =
     C{
-      #[cfg(debug_assertions)]
-      field: 0,
+        #[cfg(debug_assertions)]
+        field: 0,
 
-      #[cfg(not(debug_assertions))]
-      field: 1,};
+        #[cfg(not(debug_assertions))]
+        field: 1,};
diff --git a/src/test/pretty/macro_rules.rs b/src/test/pretty/macro_rules.rs
index fb66e4a7758..01adb14133b 100644
--- a/src/test/pretty/macro_rules.rs
+++ b/src/test/pretty/macro_rules.rs
@@ -12,8 +12,8 @@ macro_rules! matcher_brackets {
 
 macro_rules! all_fragments {
     ($b : block, $e : expr, $i : ident, $it : item, $l : lifetime, $lit :
-     literal, $m : meta, $p : pat, $pth : path, $s : stmt, $tt : tt, $ty : ty,
-     $vis : vis) => {} ;
+    literal, $m : meta, $p : pat, $pth : path, $s : stmt, $tt : tt, $ty : ty,
+    $vis : vis) => {} ;
 }
 
 fn main() {}
diff --git a/src/test/pretty/match-naked-expr-medium.rs b/src/test/pretty/match-naked-expr-medium.rs
index a124fdff390..836af99002d 100644
--- a/src/test/pretty/match-naked-expr-medium.rs
+++ b/src/test/pretty/match-naked-expr-medium.rs
@@ -5,10 +5,10 @@ fn main() {
     let _y =
         match x {
             Some(_) =>
-            ["some(_)".to_string(), "not".to_string(), "SO".to_string(),
-             "long".to_string(), "string".to_string()],
+                ["some(_)".to_string(), "not".to_string(), "SO".to_string(),
+                        "long".to_string(), "string".to_string()],
             None =>
-            ["none".to_string(), "a".to_string(), "a".to_string(),
-             "a".to_string(), "a".to_string()],
+                ["none".to_string(), "a".to_string(), "a".to_string(),
+                        "a".to_string(), "a".to_string()],
         };
 }
diff --git a/src/test/pretty/stmt_expr_attributes.rs b/src/test/pretty/stmt_expr_attributes.rs
index 01533cd8107..96bde96200a 100644
--- a/src/test/pretty/stmt_expr_attributes.rs
+++ b/src/test/pretty/stmt_expr_attributes.rs
@@ -48,9 +48,9 @@ fn _4() {
 
     let _ =
         #[rustc_dummy] match () {
-                           #![rustc_dummy]
-                           () => (),
-                       };
+            #![rustc_dummy]
+            () => (),
+        };
 }
 
 fn _5() {
@@ -156,56 +156,56 @@ fn _11() {
     let _ = #[rustc_dummy] 0 as usize;
     let _ =
         #[rustc_dummy] while false {
-                           #![rustc_dummy]
-                       };
+            #![rustc_dummy]
+        };
     let _ =
         #[rustc_dummy] while let None = Some(()) {
-                           #![rustc_dummy]
-                       };
+            #![rustc_dummy]
+        };
     let _ =
         #[rustc_dummy] for _ in 0..0 {
-                           #![rustc_dummy]
-                       };
+            #![rustc_dummy]
+        };
     let _ =
         #[rustc_dummy] loop {
-                           #![rustc_dummy]
-                       };
+            #![rustc_dummy]
+        };
     let _ =
         #[rustc_dummy] match false {
-                           #![rustc_dummy]
-                           _ => (),
-                       };
+            #![rustc_dummy]
+            _ => (),
+        };
     let _ = #[rustc_dummy] || #[rustc_dummy] ();
     let _ = #[rustc_dummy] move || #[rustc_dummy] ();
     let _ =
         #[rustc_dummy] ||
-                           {
-                               #![rustc_dummy]
-                               #[rustc_dummy]
-                               ()
-                           };
+            {
+                #![rustc_dummy]
+                #[rustc_dummy]
+                ()
+            };
     let _ =
         #[rustc_dummy] move ||
-                           {
-                               #![rustc_dummy]
-                               #[rustc_dummy]
-                               ()
-                           };
+            {
+                #![rustc_dummy]
+                #[rustc_dummy]
+                ()
+            };
     let _ =
         #[rustc_dummy] {
-                           #![rustc_dummy]
-                       };
+            #![rustc_dummy]
+        };
     let _ =
         #[rustc_dummy] {
-                           #![rustc_dummy]
-                           let _ = ();
-                       };
+            #![rustc_dummy]
+            let _ = ();
+        };
     let _ =
         #[rustc_dummy] {
-                           #![rustc_dummy]
-                           let _ = ();
-                           ()
-                       };
+            #![rustc_dummy]
+            let _ = ();
+            ()
+        };
     let mut x = 0;
     let _ = #[rustc_dummy] x = 15;
     let _ = #[rustc_dummy] x += 15;
diff --git a/src/test/pretty/vec-comments.pp b/src/test/pretty/vec-comments.pp
index a150cf0b8ea..f2f807c59de 100644
--- a/src/test/pretty/vec-comments.pp
+++ b/src/test/pretty/vec-comments.pp
@@ -4,26 +4,26 @@
 fn main() {
     let _v1 =
         [
-         // Comment
-         0,
-         // Comment
-         1,
-         // Comment
-         2];
+                // Comment
+                0,
+                // Comment
+                1,
+                // Comment
+                2];
     let _v2 =
         [0, // Comment
-         1, // Comment
-         2]; // Comment
+                1, // Comment
+                2]; // Comment
     let _v3 =
         [
-         /* Comment */
-         0,
-         /* Comment */
-         1,
-         /* Comment */
-         2];
+                /* Comment */
+                0,
+                /* Comment */
+                1,
+                /* Comment */
+                2];
     let _v4 =
         [0, /* Comment */
-         1, /* Comment */
-         2]; /* Comment */
+                1, /* Comment */
+                2]; /* Comment */
 }
diff --git a/src/test/ui/attributes/key-value-expansion.stderr b/src/test/ui/attributes/key-value-expansion.stderr
index 464e1e1cda7..1b7cb76b553 100644
--- a/src/test/ui/attributes/key-value-expansion.stderr
+++ b/src/test/ui/attributes/key-value-expansion.stderr
@@ -16,11 +16,11 @@ LL | bug!();
    = note: this error originates in the macro `bug` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: unexpected token: `{
-           let res =
-               ::alloc::fmt::format(::core::fmt::Arguments::new_v1(&[""],
-                                                                   &[::core::fmt::ArgumentV1::new_display(&"u8")]));
-           res
-       }.as_str()`
+               let res =
+                   ::alloc::fmt::format(::core::fmt::Arguments::new_v1(&[""],
+                           &[::core::fmt::ArgumentV1::new_display(&"u8")]));
+               res
+           }.as_str()`
   --> $DIR/key-value-expansion.rs:48:23
    |
 LL |         doc_comment! {format!("{coor}", coor = stringify!($t1)).as_str()}
diff --git a/src/test/ui/const-generics/defaults/pretty-printing-ast.stdout b/src/test/ui/const-generics/defaults/pretty-printing-ast.stdout
index 99fe9d2e4b3..121138605f1 100644
--- a/src/test/ui/const-generics/defaults/pretty-printing-ast.stdout
+++ b/src/test/ui/const-generics/defaults/pretty-printing-ast.stdout
@@ -15,4 +15,4 @@ trait Foo<const KIND : bool = true> {}
 fn foo<const SIZE : usize = 5>() {}
 
 struct Range<const FROM : usize = 0, const LEN : usize = 0, const TO : usize =
-             FROM>;
+    FROM>;
diff --git a/src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.rs b/src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.rs
new file mode 100644
index 00000000000..0efc7daa3e1
--- /dev/null
+++ b/src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.rs
@@ -0,0 +1,24 @@
+#[derive(Default)]
+pub struct A {
+    #[doc(hidden)]
+    pub hello: i32,
+    pub bye: i32,
+}
+
+#[derive(Default)]
+pub struct B {
+    pub hello: i32,
+    pub bye: i32,
+}
+
+fn main() {
+    A::default().hey;
+    //~^ ERROR no field `hey` on type `A`
+    //~| NOTE unknown field
+    //~| NOTE available fields are: `bye`
+
+    B::default().hey;
+    //~^ ERROR no field `hey` on type `B`
+    //~| NOTE unknown field
+    //~| NOTE available fields are: `hello`, `bye`
+}
diff --git a/src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.stderr b/src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.stderr
new file mode 100644
index 00000000000..784986d3b95
--- /dev/null
+++ b/src/test/ui/did_you_mean/issue-93210-ignore-doc-hidden.stderr
@@ -0,0 +1,19 @@
+error[E0609]: no field `hey` on type `A`
+  --> $DIR/issue-93210-ignore-doc-hidden.rs:15:18
+   |
+LL |     A::default().hey;
+   |                  ^^^ unknown field
+   |
+   = note: available fields are: `bye`
+
+error[E0609]: no field `hey` on type `B`
+  --> $DIR/issue-93210-ignore-doc-hidden.rs:20:18
+   |
+LL |     B::default().hey;
+   |                  ^^^ unknown field
+   |
+   = note: available fields are: `hello`, `bye`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0609`.
diff --git a/src/test/ui/generic-associated-types/elided-in-expr-position.rs b/src/test/ui/generic-associated-types/elided-in-expr-position.rs
new file mode 100644
index 00000000000..482d0d5c00a
--- /dev/null
+++ b/src/test/ui/generic-associated-types/elided-in-expr-position.rs
@@ -0,0 +1,38 @@
+#![feature(generic_associated_types)]
+#![allow(unused)]
+
+pub trait Trait  {
+    type Assoc<'a> where Self: 'a;
+
+    fn f(&self) -> Self::Assoc<'_>;
+
+    // Disallow elision in return position, for now
+    fn g(&self) -> Self::Assoc;
+    //~^ ERROR missing generics for associated type `Trait::Assoc`
+}
+
+pub struct Struct {
+    item: f32
+}
+
+pub struct GenericStruct<'a> {
+    ref_item: &'a f32
+}
+
+impl Trait for Struct {
+    type Assoc<'a> = GenericStruct<'a>;
+
+    fn f(&self) -> Self::Assoc<'_> {
+        Self::Assoc {
+            ref_item: &self.item
+        }
+    }
+
+    // Disallow elision in return position, for now
+    fn g(&self) -> Self::Assoc {
+    //~^ ERROR missing generics for associated type `Trait::Assoc`
+        todo!()
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/elided-in-expr-position.stderr b/src/test/ui/generic-associated-types/elided-in-expr-position.stderr
new file mode 100644
index 00000000000..9263f3d67e3
--- /dev/null
+++ b/src/test/ui/generic-associated-types/elided-in-expr-position.stderr
@@ -0,0 +1,35 @@
+error[E0107]: missing generics for associated type `Trait::Assoc`
+  --> $DIR/elided-in-expr-position.rs:10:26
+   |
+LL |     fn g(&self) -> Self::Assoc;
+   |                          ^^^^^ expected 1 lifetime argument
+   |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+  --> $DIR/elided-in-expr-position.rs:5:10
+   |
+LL |     type Assoc<'a> where Self: 'a;
+   |          ^^^^^ --
+help: add missing lifetime argument
+   |
+LL |     fn g(&self) -> Self::Assoc<'_>;
+   |                          ~~~~~~~~~
+
+error[E0107]: missing generics for associated type `Trait::Assoc`
+  --> $DIR/elided-in-expr-position.rs:32:26
+   |
+LL |     fn g(&self) -> Self::Assoc {
+   |                          ^^^^^ expected 1 lifetime argument
+   |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+  --> $DIR/elided-in-expr-position.rs:5:10
+   |
+LL |     type Assoc<'a> where Self: 'a;
+   |          ^^^^^ --
+help: add missing lifetime argument
+   |
+LL |     fn g(&self) -> Self::Assoc<'_> {
+   |                          ~~~~~~~~~
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/match/issue-82392.stdout b/src/test/ui/match/issue-82392.stdout
index 4f46e32dc30..2054d43c409 100644
--- a/src/test/ui/match/issue-82392.stdout
+++ b/src/test/ui/match/issue-82392.stdout
@@ -7,13 +7,11 @@ extern crate std;
 // check-pass
 
 pub fn main() ({
-                   (if (true as bool)
-                       ({ } as
-                           ()) else if (let Some(a) =
-                                           ((Some as
-                                                fn(i32) -> Option<i32> {Option::<i32>::Some})((3
-                                                                                                  as
-                                                                                                  i32))
-                                               as Option<i32>) as bool)
-                              ({ } as ()) as ())
-                             } as ())
+        (if (true as bool)
+                ({ } as
+                    ()) else if (let Some(a) =
+                       ((Some as
+                               fn(i32) -> Option<i32> {Option::<i32>::Some})((3
+                               as i32)) as Option<i32>) as bool) ({ } as ())
+                   as ())
+               } as ())
diff --git a/src/test/ui/proc-macro/cfg-eval-inner.stdout b/src/test/ui/proc-macro/cfg-eval-inner.stdout
index debbad57a86..9d25def587c 100644
--- a/src/test/ui/proc-macro/cfg-eval-inner.stdout
+++ b/src/test/ui/proc-macro/cfg-eval-inner.stdout
@@ -1,9 +1,9 @@
 PRINT-ATTR INPUT (DISPLAY): impl Foo <
 [u8 ;
- {
-     #! [rustc_dummy(cursed_inner)] #! [allow(unused)] struct Inner
-     { field : [u8 ; { #! [rustc_dummy(another_cursed_inner)] 1 }] } 0
- }] > { #! [rustc_dummy(evaluated_attr)] fn bar() {} }
+{
+    #! [rustc_dummy(cursed_inner)] #! [allow(unused)] struct Inner
+    { field : [u8 ; { #! [rustc_dummy(another_cursed_inner)] 1 }] } 0
+}] > { #! [rustc_dummy(evaluated_attr)] fn bar() {} }
 PRINT-ATTR INPUT (DEBUG): TokenStream [
     Ident {
         ident: "impl",
diff --git a/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout b/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout
index fdd178a5229..c81fa201cbc 100644
--- a/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout
+++ b/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout
@@ -4,23 +4,23 @@ struct Foo < #[cfg(FALSE)] A, B >
     #[cfg(FALSE)] first : String, #[cfg_attr(FALSE, deny(warnings))] second :
     bool, third :
     [u8 ;
-     {
-         #[cfg(FALSE)] struct Bar ; #[cfg(not(FALSE))] struct Inner ;
-         #[cfg(FALSE)] let a = 25 ; match true
-         {
-             #[cfg(FALSE)] true => {},
-             #[cfg_attr(not(FALSE), allow(warnings))] false => {}, _ => {}
-         } ; #[print_helper(should_be_removed)] fn removed_fn()
-         { #! [cfg(FALSE)] } #[print_helper(c)] #[cfg(not(FALSE))] fn
-         kept_fn() { #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
-         {
-             Foo(#[cfg(FALSE)] u8, #[cfg(FALSE)] bool, #[cfg(not(FALSE))] i32,
-                 #[cfg(FALSE)] String, u8)
-         } struct
-         TupleStruct(#[cfg(FALSE)] String, #[cfg(not(FALSE))] i32,
-                     #[cfg(FALSE)] bool, u8) ; fn plain_removed_fn()
-         { #! [cfg_attr(not(FALSE), cfg(FALSE))] } 0
-     }], #[print_helper(d)] fourth : B
+    {
+        #[cfg(FALSE)] struct Bar ; #[cfg(not(FALSE))] struct Inner ;
+        #[cfg(FALSE)] let a = 25 ; match true
+        {
+            #[cfg(FALSE)] true => {}, #[cfg_attr(not(FALSE), allow(warnings))]
+            false => {}, _ => {}
+        } ; #[print_helper(should_be_removed)] fn removed_fn()
+        { #! [cfg(FALSE)] } #[print_helper(c)] #[cfg(not(FALSE))] fn kept_fn()
+        { #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
+        {
+            Foo(#[cfg(FALSE)] u8, #[cfg(FALSE)] bool, #[cfg(not(FALSE))] i32,
+            #[cfg(FALSE)] String, u8)
+        } struct
+        TupleStruct(#[cfg(FALSE)] String, #[cfg(not(FALSE))] i32,
+        #[cfg(FALSE)] bool, u8) ; fn plain_removed_fn()
+        { #! [cfg_attr(not(FALSE), cfg(FALSE))] } 0
+    }], #[print_helper(d)] fourth : B
 }
 PRINT-ATTR INPUT (DEBUG): TokenStream [
     Punct {
@@ -1276,14 +1276,14 @@ PRINT-DERIVE INPUT (DISPLAY): #[print_helper(a)] #[allow(dead_code)] #[print_hel
 {
     second : bool, third :
     [u8 ;
-     {
-         #[cfg(not(FALSE))] struct Inner ; match true
-         { #[allow(warnings)] false => {}, _ => {} } ; #[print_helper(c)]
-         #[cfg(not(FALSE))] fn kept_fn()
-         { #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
-         { Foo(#[cfg(not(FALSE))] i32, u8) } struct
-         TupleStruct(#[cfg(not(FALSE))] i32, u8) ; 0
-     }], #[print_helper(d)] fourth : B
+    {
+        #[cfg(not(FALSE))] struct Inner ; match true
+        { #[allow(warnings)] false => {}, _ => {} } ; #[print_helper(c)]
+        #[cfg(not(FALSE))] fn kept_fn()
+        { #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
+        { Foo(#[cfg(not(FALSE))] i32, u8) } struct
+        TupleStruct(#[cfg(not(FALSE))] i32, u8) ; 0
+    }], #[print_helper(d)] fourth : B
 }
 PRINT-DERIVE INPUT (DEBUG): TokenStream [
     Punct {
diff --git a/src/test/ui/proc-macro/macro-rules-derive-cfg.stdout b/src/test/ui/proc-macro/macro-rules-derive-cfg.stdout
index 6e2b6a2e5bd..74641058ef3 100644
--- a/src/test/ui/proc-macro/macro-rules-derive-cfg.stdout
+++ b/src/test/ui/proc-macro/macro-rules-derive-cfg.stdout
@@ -2,10 +2,10 @@ PRINT-DERIVE INPUT (DISPLAY): struct Foo
 {
     val :
     [bool ;
-     {
-         let a = #[rustc_dummy(first)] #[rustc_dummy(second)]
-         { #! [allow(unused)] 30 } ; 0
-     }]
+    {
+        let a = #[rustc_dummy(first)] #[rustc_dummy(second)]
+        { #! [allow(unused)] 30 } ; 0
+    }]
 }
 PRINT-DERIVE INPUT (DEBUG): TokenStream [
     Ident {
diff --git a/src/test/ui/proc-macro/quote-debug.stdout b/src/test/ui/proc-macro/quote-debug.stdout
index 4bdc04b9ac4..79651f01b95 100644
--- a/src/test/ui/proc-macro/quote-debug.stdout
+++ b/src/test/ui/proc-macro/quote-debug.stdout
@@ -19,29 +19,27 @@ extern crate proc_macro;
 
 fn main() {
     [crate::TokenStream::from(crate::TokenTree::Ident(crate::Ident::new("let",
-                                                                        crate::Span::recover_proc_macro_span(0)))),
-     crate::TokenStream::from(crate::TokenTree::Ident(crate::Ident::new("hello",
-                                                                        crate::Span::recover_proc_macro_span(1)))),
-     crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3d}',
-                                                                        crate::Spacing::Alone))),
-     crate::TokenStream::from(crate::TokenTree::Literal({
-                                                            let mut iter =
-                                                                "\"world\"".parse::<crate::TokenStream>().unwrap().into_iter();
-                                                            if let (Some(crate::TokenTree::Literal(mut lit)),
-                                                                    None) =
-                                                                   (iter.next(),
-                                                                    iter.next())
-                                                               {
-                                                                lit.set_span(crate::Span::recover_proc_macro_span(2));
-                                                                lit
-                                                            } else {
-                                                                {
-                                                                    ::core::panicking::panic("internal error: entered unreachable code")
-                                                                }
-                                                            }
-                                                        })),
-     crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3b}',
-                                                                        crate::Spacing::Alone)))].iter().cloned().collect::<crate::TokenStream>()
+                                    crate::Span::recover_proc_macro_span(0)))),
+                        crate::TokenStream::from(crate::TokenTree::Ident(crate::Ident::new("hello",
+                                    crate::Span::recover_proc_macro_span(1)))),
+                        crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3d}',
+                                    crate::Spacing::Alone))),
+                        crate::TokenStream::from(crate::TokenTree::Literal({
+                                    let mut iter =
+                                        "\"world\"".parse::<crate::TokenStream>().unwrap().into_iter();
+                                    if let (Some(crate::TokenTree::Literal(mut lit)),
+                                                None) =
+                                                (iter.next(), iter.next()) {
+                                            lit.set_span(crate::Span::recover_proc_macro_span(2));
+                                            lit
+                                        } else {
+                                           {
+                                               ::core::panicking::panic("internal error: entered unreachable code")
+                                           }
+                                       }
+                                })),
+                        crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3b}',
+                                    crate::Spacing::Alone)))].iter().cloned().collect::<crate::TokenStream>()
 }
 const _: () =
     {
diff --git a/src/test/ui/rfc-2565-param-attrs/auxiliary/param-attrs.rs b/src/test/ui/rfc-2565-param-attrs/auxiliary/param-attrs.rs
index 8800d3e66f9..82c4120b4c7 100644
--- a/src/test/ui/rfc-2565-param-attrs/auxiliary/param-attrs.rs
+++ b/src/test/ui/rfc-2565-param-attrs/auxiliary/param-attrs.rs
@@ -37,7 +37,7 @@ checker!(rename_params, r#"impl Foo
     fn hello(#[angery(true)] a : i32, #[a2] b : i32, #[what = "how"] c : u32)
     {} fn
     hello2(#[a1] #[a2] a : i32, #[what = "how"] b : i32, #[angery(true)] c :
-           u32) {} fn
+    u32) {} fn
     hello_self(#[a1] #[a2] & self, #[a1] #[a2] a : i32, #[what = "how"] b :
-               i32, #[angery(true)] c : u32) {}
+    i32, #[angery(true)] c : u32) {}
 }"#);
diff --git a/src/test/ui/suggestions/private-field.rs b/src/test/ui/suggestions/private-field.rs
new file mode 100644
index 00000000000..1cc4d2a4d06
--- /dev/null
+++ b/src/test/ui/suggestions/private-field.rs
@@ -0,0 +1,19 @@
+// compile-flags: --crate-type lib
+pub struct S {
+    pub val: string::MyString,
+}
+
+pub fn test(s: S) {
+    dbg!(s.cap) //~ ERROR: no field `cap` on type `S` [E0609]
+}
+
+pub(crate) mod string {
+
+    pub struct MyString {
+        buf: MyVec,
+    }
+
+    struct MyVec {
+        cap: usize,
+    }
+}
diff --git a/src/test/ui/suggestions/private-field.stderr b/src/test/ui/suggestions/private-field.stderr
new file mode 100644
index 00000000000..c38c795e07a
--- /dev/null
+++ b/src/test/ui/suggestions/private-field.stderr
@@ -0,0 +1,11 @@
+error[E0609]: no field `cap` on type `S`
+  --> $DIR/private-field.rs:7:12
+   |
+LL |     dbg!(s.cap)
+   |            ^^^ unknown field
+   |
+   = note: available fields are: `val`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0609`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-60662.stdout b/src/test/ui/type-alias-impl-trait/issue-60662.stdout
index 14a49f20e6b..a46047d9174 100644
--- a/src/test/ui/type-alias-impl-trait/issue-60662.stdout
+++ b/src/test/ui/type-alias-impl-trait/issue-60662.stdout
@@ -10,5 +10,5 @@ extern crate std;
 trait Animal { }
 
 fn main() {
-              pub type ServeFut = /*impl Trait*/;
-          }
+        pub type ServeFut = /*impl Trait*/;
+    }