about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCaleb Cartwright <calebcartwright@users.noreply.github.com>2023-10-22 14:07:55 -0500
committerGitHub <noreply@github.com>2023-10-22 14:07:55 -0500
commit0bb2acf50fad389285d22b2706d592b9668e65d5 (patch)
tree04a882b7b65f81460a74805e127f5e76b4e9bd28
parent547577fa5d309d90292ca3a58fef1bf0d9325cc0 (diff)
parentc2515dfa41369e1fc7a384d07ba6e33bbb7e60b9 (diff)
downloadrust-0bb2acf50fad389285d22b2706d592b9668e65d5.tar.gz
rust-0bb2acf50fad389285d22b2706d592b9668e65d5.zip
Merge pull request #5944 from calebcartwright/subtree-sync-2023-10-22
sync subtree
-rw-r--r--CHANGELOG.md8
-rw-r--r--Cargo.lock28
-rw-r--r--Cargo.toml2
-rw-r--r--rust-toolchain2
-rw-r--r--src/expr.rs16
-rw-r--r--src/items.rs3
-rw-r--r--src/macros.rs28
-rw-r--r--src/matches.rs2
-rw-r--r--src/pairs.rs4
-rw-r--r--src/parse/macros/mod.rs2
-rw-r--r--src/parse/session.rs49
-rw-r--r--src/test/mod.rs4
-rw-r--r--src/types.rs2
-rw-r--r--src/utils.rs4
-rw-r--r--tests/source/immovable_coroutines.rs (renamed from tests/source/immovable_generators.rs)2
-rw-r--r--tests/source/let_chains.rs4
-rw-r--r--tests/target/anonymous-types.rs19
-rw-r--r--tests/target/immovable_coroutines.rs (renamed from tests/target/immovable_generators.rs)2
-rw-r--r--tests/target/issue_4110.rs2
-rw-r--r--tests/target/let_chains.rs13
20 files changed, 111 insertions, 85 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9460f636dae..a590a055bd5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -81,7 +81,11 @@
 - Support for formatting let-else statements [#5690]
 - New config option, `single_line_let_else_max_width`, that allows users to configure the maximum length of single line `let-else` statements. `let-else` statements that otherwise meet the requirements to be formatted on a single line will have their divergent`else` block formatted over multiple lines if they exceed this length [#5684]
 
+<<<<<<< HEAD
+[#5690]: (https://github.com/rust-lang/rustfmt/pulls/5690)
+=======
 [#5690]: https://github.com/rust-lang/rustfmt/pull/5690
+>>>>>>> upstream/master
 [#5684]: https://github.com/rust-lang/rustfmt/issues/5684
 
 ## [1.5.3] 2023-06-20
@@ -90,7 +94,11 @@
 
 - When formatting doc comments with `wrap_comments = true` rustfmt will no longer wrap markdown tables [#4210](https://github.com/rust-lang/rustfmt/issues/4210)
 - Properly handle wrapping comments that include a numbered list in markdown [#5416](https://github.com/rust-lang/rustfmt/issues/5416)
+<<<<<<< HEAD
+- Properly handle markdown sublists that utilize a `+` [#4041](https://github.com/rust-lang/rustfmt/issues/4210)
+=======
 - Properly handle markdown sublists that utilize a `+` [#4041](https://github.com/rust-lang/rustfmt/issues/4041)
+>>>>>>> upstream/master
 - rustfmt will no longer use shorthand initialization when rewriting a tuple struct even when `use_field_init_shorthand = true` as this leads to code that could no longer compile.
   Take the following struct as an example `struct MyStruct(u64);`. rustfmt will no longer format `MyStruct { 0: 0 }` as `MyStruct { 0 }` [#5488](https://github.com/rust-lang/rustfmt/issues/5488)
 - rustfmt no longer panics when formatting an empty code block in a doc comment with `format_code_in_doc_comments = true` [#5234](https://github.com/rust-lang/rustfmt/issues/5234). For example:
diff --git a/Cargo.lock b/Cargo.lock
index 76adbb1119f..69e291bf97e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -98,11 +98,11 @@ dependencies = [
 
 [[package]]
 name = "bytecount"
-version = "0.6.3"
+version = "0.6.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c"
+checksum = "ad152d03a2c813c80bb94fedbf3a3f02b28f793e39e7c214c8a0bcc196343de7"
 dependencies = [
- "packed_simd_2",
+ "packed_simd",
 ]
 
 [[package]]
@@ -370,9 +370,9 @@ checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5"
 
 [[package]]
 name = "libm"
-version = "0.1.4"
+version = "0.2.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
+checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
 
 [[package]]
 name = "log"
@@ -409,6 +409,16 @@ dependencies = [
 ]
 
 [[package]]
+name = "num-traits"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
+dependencies = [
+ "autocfg",
+ "libm",
+]
+
+[[package]]
 name = "once_cell"
 version = "1.17.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -421,13 +431,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
 
 [[package]]
-name = "packed_simd_2"
-version = "0.3.8"
+name = "packed_simd"
+version = "0.3.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282"
+checksum = "1f9f08af0c877571712e2e3e686ad79efad9657dbf0f7c3c8ba943ff6c38932d"
 dependencies = [
  "cfg-if",
- "libm",
+ "num-traits",
 ]
 
 [[package]]
diff --git a/Cargo.toml b/Cargo.toml
index ce7cfec9ba0..637001b610b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,7 +35,7 @@ generic-simd = ["bytecount/generic-simd"]
 [dependencies]
 annotate-snippets = { version = "0.9", features = ["color"] }
 anyhow = "1.0"
-bytecount = "0.6.3"
+bytecount = "0.6.4"
 cargo_metadata = "0.15.4"
 clap = { version = "4.4.2", features = ["derive"] }
 clap-cargo = "0.12.0"
diff --git a/rust-toolchain b/rust-toolchain
index 33ff8b03da2..0057e2f370a 100644
--- a/rust-toolchain
+++ b/rust-toolchain
@@ -1,3 +1,3 @@
 [toolchain]
-channel = "nightly-2023-07-01"
+channel = "nightly-2023-10-22"
 components = ["llvm-tools", "rustc-dev"]
diff --git a/src/expr.rs b/src/expr.rs
index 25226991fbc..acde8809329 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -132,7 +132,7 @@ pub(crate) fn format_expr(
         ast::ExprKind::Tup(ref items) => {
             rewrite_tuple(context, items.iter(), expr.span, shape, items.len() == 1)
         }
-        ast::ExprKind::Let(ref pat, ref expr, _span) => rewrite_let(context, shape, pat, expr),
+        ast::ExprKind::Let(ref pat, ref expr, _span, _) => rewrite_let(context, shape, pat, expr),
         ast::ExprKind::If(..)
         | ast::ExprKind::ForLoop(..)
         | ast::ExprKind::Loop(..)
@@ -261,7 +261,7 @@ pub(crate) fn format_expr(
             shape,
             SeparatorPlace::Back,
         ),
-        ast::ExprKind::Index(ref expr, ref index) => {
+        ast::ExprKind::Index(ref expr, ref index, _) => {
             rewrite_index(&**expr, &**index, context, shape)
         }
         ast::ExprKind::Repeat(ref expr, ref repeats) => rewrite_pair(
@@ -662,7 +662,7 @@ struct ControlFlow<'a> {
 
 fn extract_pats_and_cond(expr: &ast::Expr) -> (Option<&ast::Pat>, &ast::Expr) {
     match expr.kind {
-        ast::ExprKind::Let(ref pat, ref cond, _) => (Some(pat), cond),
+        ast::ExprKind::Let(ref pat, ref cond, _, _) => (Some(pat), cond),
         _ => (None, expr),
     }
 }
@@ -1339,7 +1339,7 @@ pub(crate) fn is_simple_expr(expr: &ast::Expr) -> bool {
         | ast::ExprKind::Field(ref expr, _)
         | ast::ExprKind::Try(ref expr)
         | ast::ExprKind::Unary(_, ref expr) => is_simple_expr(expr),
-        ast::ExprKind::Index(ref lhs, ref rhs) => is_simple_expr(lhs) && is_simple_expr(rhs),
+        ast::ExprKind::Index(ref lhs, ref rhs, _) => is_simple_expr(lhs) && is_simple_expr(rhs),
         ast::ExprKind::Repeat(ref lhs, ref rhs) => {
             is_simple_expr(lhs) && is_simple_expr(&*rhs.value)
         }
@@ -1379,12 +1379,8 @@ pub(crate) fn can_be_overflowed_expr(
                 || (context.use_block_indent() && args_len == 1)
         }
         ast::ExprKind::MacCall(ref mac) => {
-            match (
-                rustc_ast::ast::MacDelimiter::from_token(mac.args.delim.to_token()),
-                context.config.overflow_delimited_expr(),
-            ) {
-                (Some(ast::MacDelimiter::Bracket), true)
-                | (Some(ast::MacDelimiter::Brace), true) => true,
+            match (mac.args.delim, context.config.overflow_delimited_expr()) {
+                (Delimiter::Bracket, true) | (Delimiter::Brace, true) => true,
                 _ => context.use_block_indent() && args_len == 1,
             }
         }
diff --git a/src/items.rs b/src/items.rs
index c31d425af52..edb5a5b629a 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -2608,7 +2608,8 @@ fn rewrite_fn_base(
     if where_clause_str.is_empty() {
         if let ast::FnRetTy::Default(ret_span) = fd.output {
             match recover_missing_comment_in_span(
-                mk_sp(params_span.hi(), ret_span.hi()),
+                // from after the closing paren to right before block or semicolon
+                mk_sp(ret_span.lo(), span.hi()),
                 shape,
                 context,
                 last_line_width(&result),
diff --git a/src/macros.rs b/src/macros.rs
index 8047ab03687..76553466e48 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -13,7 +13,7 @@ use std::collections::HashMap;
 use std::panic::{catch_unwind, AssertUnwindSafe};
 
 use rustc_ast::token::{BinOpToken, Delimiter, Token, TokenKind};
-use rustc_ast::tokenstream::{TokenStream, TokenTree, TokenTreeCursor};
+use rustc_ast::tokenstream::{RefTokenTreeCursor, TokenStream, TokenTree};
 use rustc_ast::{ast, ptr};
 use rustc_ast_pretty::pprust;
 use rustc_span::{
@@ -411,7 +411,7 @@ pub(crate) fn rewrite_macro_def(
     }
 
     let ts = def.body.tokens.clone();
-    let mut parser = MacroParser::new(ts.into_trees());
+    let mut parser = MacroParser::new(ts.trees());
     let parsed_def = match parser.parse() {
         Some(def) => def,
         None => return snippet,
@@ -760,9 +760,9 @@ impl MacroArgParser {
         self.buf.clear();
     }
 
-    fn add_meta_variable(&mut self, iter: &mut TokenTreeCursor) -> Option<()> {
+    fn add_meta_variable(&mut self, iter: &mut RefTokenTreeCursor<'_>) -> Option<()> {
         match iter.next() {
-            Some(TokenTree::Token(
+            Some(&TokenTree::Token(
                 Token {
                     kind: TokenKind::Ident(name, _),
                     ..
@@ -792,7 +792,7 @@ impl MacroArgParser {
         &mut self,
         inner: Vec<ParsedMacroArg>,
         delim: Delimiter,
-        iter: &mut TokenTreeCursor,
+        iter: &mut RefTokenTreeCursor<'_>,
     ) -> Option<()> {
         let mut buffer = String::new();
         let mut first = true;
@@ -892,11 +892,11 @@ impl MacroArgParser {
 
     /// Returns a collection of parsed macro def's arguments.
     fn parse(mut self, tokens: TokenStream) -> Option<Vec<ParsedMacroArg>> {
-        let mut iter = tokens.into_trees();
+        let mut iter = tokens.trees();
 
         while let Some(tok) = iter.next() {
             match tok {
-                TokenTree::Token(
+                &TokenTree::Token(
                     Token {
                         kind: TokenKind::Dollar,
                         span,
@@ -925,7 +925,7 @@ impl MacroArgParser {
                     self.add_meta_variable(&mut iter)?;
                 }
                 TokenTree::Token(ref t, _) => self.update_buffer(t),
-                TokenTree::Delimited(_delimited_span, delimited, ref tts) => {
+                &TokenTree::Delimited(_delimited_span, delimited, ref tts) => {
                     if !self.buf.is_empty() {
                         if next_space(&self.last_tok.kind) == SpaceState::Always {
                             self.add_separator();
@@ -1143,12 +1143,12 @@ pub(crate) fn macro_style(mac: &ast::MacCall, context: &RewriteContext<'_>) -> D
 
 // A very simple parser that just parses a macros 2.0 definition into its branches.
 // Currently we do not attempt to parse any further than that.
-struct MacroParser {
-    toks: TokenTreeCursor,
+struct MacroParser<'a> {
+    toks: RefTokenTreeCursor<'a>,
 }
 
-impl MacroParser {
-    const fn new(toks: TokenTreeCursor) -> Self {
+impl<'a> MacroParser<'a> {
+    const fn new(toks: RefTokenTreeCursor<'a>) -> Self {
         Self { toks }
     }
 
@@ -1167,9 +1167,9 @@ impl MacroParser {
         let tok = self.toks.next()?;
         let (lo, args_paren_kind) = match tok {
             TokenTree::Token(..) => return None,
-            TokenTree::Delimited(delimited_span, d, _) => (delimited_span.open.lo(), d),
+            &TokenTree::Delimited(delimited_span, d, _) => (delimited_span.open.lo(), d),
         };
-        let args = TokenStream::new(vec![tok]);
+        let args = TokenStream::new(vec![tok.clone()]);
         match self.toks.next()? {
             TokenTree::Token(
                 Token {
diff --git a/src/matches.rs b/src/matches.rs
index 27a9c1d3130..95b0ed16db8 100644
--- a/src/matches.rs
+++ b/src/matches.rs
@@ -605,7 +605,7 @@ fn can_flatten_block_around_this(body: &ast::Expr) -> bool {
         ast::ExprKind::AddrOf(_, _, ref expr)
         | ast::ExprKind::Try(ref expr)
         | ast::ExprKind::Unary(_, ref expr)
-        | ast::ExprKind::Index(ref expr, _)
+        | ast::ExprKind::Index(ref expr, _, _)
         | ast::ExprKind::Cast(ref expr, _) => can_flatten_block_around_this(expr),
         _ => false,
     }
diff --git a/src/pairs.rs b/src/pairs.rs
index 9dac20d3699..07c05193739 100644
--- a/src/pairs.rs
+++ b/src/pairs.rs
@@ -274,7 +274,7 @@ impl<'a, 'b> PairList<'a, 'b, ast::Expr> {
     fn let_chain_count(&self) -> usize {
         self.list
             .iter()
-            .filter(|(expr, _)| matches!(expr.kind, ast::ExprKind::Let(_, _, _)))
+            .filter(|(expr, _)| matches!(expr.kind, ast::ExprKind::Let(..)))
             .count()
     }
 
@@ -284,7 +284,7 @@ impl<'a, 'b> PairList<'a, 'b, ast::Expr> {
         }
 
         let fist_item_is_ident = is_ident(self.list[0].0);
-        let second_item_is_let_chain = matches!(self.list[1].0.kind, ast::ExprKind::Let(_, _, _));
+        let second_item_is_let_chain = matches!(self.list[1].0.kind, ast::ExprKind::Let(..));
 
         fist_item_is_ident && second_item_is_let_chain
     }
diff --git a/src/parse/macros/mod.rs b/src/parse/macros/mod.rs
index 67f3985926e..7a802f7a88e 100644
--- a/src/parse/macros/mod.rs
+++ b/src/parse/macros/mod.rs
@@ -56,7 +56,7 @@ fn parse_macro_arg<'a, 'b: 'a>(parser: &'a mut Parser<'b>) -> Option<MacroArg> {
     );
     parse_macro_arg!(
         Pat,
-        |parser: &mut rustc_parse::parser::Parser<'b>| parser.parse_pat_no_top_alt(None),
+        |parser: &mut rustc_parse::parser::Parser<'b>| parser.parse_pat_no_top_alt(None, None),
         |x: ptr::P<ast::Pat>| Some(x)
     );
     // `parse_item` returns `Option<ptr::P<ast::Item>>`.
diff --git a/src/parse/session.rs b/src/parse/session.rs
index 2edb830a573..0573df9de2f 100644
--- a/src/parse/session.rs
+++ b/src/parse/session.rs
@@ -1,10 +1,10 @@
 use std::path::Path;
 use std::sync::atomic::{AtomicBool, Ordering};
 
-use rustc_data_structures::sync::{Lrc, Send};
-use rustc_errors::emitter::{Emitter, EmitterWriter};
+use rustc_data_structures::sync::{IntoDynSyncSend, Lrc};
+use rustc_errors::emitter::{DynEmitter, Emitter, EmitterWriter};
 use rustc_errors::translation::Translate;
-use rustc_errors::{ColorConfig, Diagnostic, Handler, Level as DiagnosticLevel, TerminalUrl};
+use rustc_errors::{ColorConfig, Diagnostic, Handler, Level as DiagnosticLevel};
 use rustc_session::parse::ParseSess as RawParseSess;
 use rustc_span::{
     source_map::{FilePathMapping, SourceMap},
@@ -48,15 +48,15 @@ impl Emitter for SilentEmitter {
     fn emit_diagnostic(&mut self, _db: &Diagnostic) {}
 }
 
-fn silent_emitter() -> Box<dyn Emitter + Send> {
+fn silent_emitter() -> Box<DynEmitter> {
     Box::new(SilentEmitter {})
 }
 
 /// Emit errors against every files expect ones specified in the `ignore_path_set`.
 struct SilentOnIgnoredFilesEmitter {
-    ignore_path_set: Lrc<IgnorePathSet>,
+    ignore_path_set: IntoDynSyncSend<Lrc<IgnorePathSet>>,
     source_map: Lrc<SourceMap>,
-    emitter: Box<dyn Emitter + Send>,
+    emitter: Box<DynEmitter>,
     has_non_ignorable_parser_errors: bool,
     can_reset: Lrc<AtomicBool>,
 }
@@ -139,30 +139,15 @@ fn default_handler(
             rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(),
             false,
         );
-        Box::new(EmitterWriter::stderr(
-            emit_color,
-            Some(source_map.clone()),
-            None,
-            fallback_bundle,
-            false,
-            false,
-            None,
-            false,
-            false,
-            TerminalUrl::No,
-        ))
+        Box::new(EmitterWriter::stderr(emit_color, fallback_bundle).sm(Some(source_map.clone())))
     };
-    Handler::with_emitter(
-        true,
-        None,
-        Box::new(SilentOnIgnoredFilesEmitter {
-            has_non_ignorable_parser_errors: false,
-            source_map,
-            emitter,
-            ignore_path_set,
-            can_reset,
-        }),
-    )
+    Handler::with_emitter(Box::new(SilentOnIgnoredFilesEmitter {
+        has_non_ignorable_parser_errors: false,
+        source_map,
+        emitter,
+        ignore_path_set: IntoDynSyncSend(ignore_path_set),
+        can_reset,
+    }))
 }
 
 impl ParseSess {
@@ -233,7 +218,7 @@ impl ParseSess {
     }
 
     pub(crate) fn set_silent_emitter(&mut self) {
-        self.parse_sess.span_diagnostic = Handler::with_emitter(true, None, silent_emitter());
+        self.parse_sess.span_diagnostic = Handler::with_emitter(silent_emitter());
     }
 
     pub(crate) fn span_to_filename(&self, span: Span) -> FileName {
@@ -283,7 +268,7 @@ impl ParseSess {
         let source_file = self.parse_sess.source_map().lookup_char_pos(span.lo()).file;
         SnippetProvider::new(
             source_file.start_pos,
-            source_file.end_pos,
+            source_file.end_position(),
             Lrc::clone(source_file.src.as_ref().unwrap()),
         )
     }
@@ -410,7 +395,7 @@ mod tests {
                 has_non_ignorable_parser_errors: false,
                 source_map,
                 emitter: Box::new(emitter_writer),
-                ignore_path_set,
+                ignore_path_set: IntoDynSyncSend(ignore_path_set),
                 can_reset,
             }
         }
diff --git a/src/test/mod.rs b/src/test/mod.rs
index c8137c1bd28..47f89c1871a 100644
--- a/src/test/mod.rs
+++ b/src/test/mod.rs
@@ -834,6 +834,10 @@ fn handle_result(
 
         // Ignore LF and CRLF difference for Windows.
         if !string_eq_ignore_newline_repr(&fmt_text, &text) {
+            if std::env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0") {
+                std::fs::write(file_name, fmt_text).unwrap();
+                continue;
+            }
             let diff = make_diff(&text, &fmt_text, DIFF_CONTEXT_SIZE);
             assert!(
                 !diff.is_empty(),
diff --git a/src/types.rs b/src/types.rs
index f2e229d7477..127aff913e3 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -816,6 +816,8 @@ impl Rewrite for ast::Ty {
             ast::TyKind::Tup(ref items) => {
                 rewrite_tuple(context, items.iter(), self.span, shape, items.len() == 1)
             }
+            ast::TyKind::AnonStruct(_) => Some(context.snippet(self.span).to_owned()),
+            ast::TyKind::AnonUnion(_) => Some(context.snippet(self.span).to_owned()),
             ast::TyKind::Path(ref q_self, ref path) => {
                 rewrite_path(context, PathContext::Type, q_self, path, shape)
             }
diff --git a/src/utils.rs b/src/utils.rs
index ae7c50b4ca2..79a759d68ce 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -442,7 +442,7 @@ pub(crate) fn left_most_sub_expr(e: &ast::Expr) -> &ast::Expr {
         | ast::ExprKind::Assign(ref e, _, _)
         | ast::ExprKind::AssignOp(_, ref e, _)
         | ast::ExprKind::Field(ref e, _)
-        | ast::ExprKind::Index(ref e, _)
+        | ast::ExprKind::Index(ref e, _, _)
         | ast::ExprKind::Range(Some(ref e), _, _)
         | ast::ExprKind::Try(ref e) => left_most_sub_expr(e),
         _ => e,
@@ -480,7 +480,7 @@ pub(crate) fn is_block_expr(context: &RewriteContext<'_>, expr: &ast::Expr, repr
         | ast::ExprKind::Match(..) => repr.contains('\n'),
         ast::ExprKind::Paren(ref expr)
         | ast::ExprKind::Binary(_, _, ref expr)
-        | ast::ExprKind::Index(_, ref expr)
+        | ast::ExprKind::Index(_, ref expr, _)
         | ast::ExprKind::Unary(_, ref expr)
         | ast::ExprKind::Try(ref expr)
         | ast::ExprKind::Yield(Some(ref expr)) => is_block_expr(context, expr, repr),
diff --git a/tests/source/immovable_generators.rs b/tests/source/immovable_coroutines.rs
index c57a1e14483..3b94af0c96c 100644
--- a/tests/source/immovable_generators.rs
+++ b/tests/source/immovable_coroutines.rs
@@ -1,4 +1,4 @@
-#![feature(generators)]
+#![feature(coroutines)]
 
 unsafe fn foo() {
     let mut ga = static || { 
diff --git a/tests/source/let_chains.rs b/tests/source/let_chains.rs
index 88ee126bfbd..b7c1f811096 100644
--- a/tests/source/let_chains.rs
+++ b/tests/source/let_chains.rs
@@ -5,11 +5,11 @@ fn main() {
 
     if aaaaaaaaaaaaaaaaaaaaa &&  aaaaaaaaaaaaaaa && aaaaaaaaa && let Some(x) = xxxxxxxxxxxx && aaaaaaa && let None = aaaaaaaaaa {}
 
-    if aaaaaaaaaaaaaaaaaaaaa &&  aaaaaaaaaaaaaaa || aaaaaaaaa && let Some(x) = xxxxxxxxxxxx && aaaaaaa && let None = aaaaaaaaaa {}
+    if aaaaaaaaaaaaaaaaaaaaa &&  aaaaaaaaaaaaaaa && aaaaaaaaa && let Some(x) = xxxxxxxxxxxx && aaaaaaa && let None = aaaaaaaaaa {}
 
     if let Some(Struct { x:TS(1,2) }) = path::to::<_>(hehe)
         && let [Simple, people] = /* get ready */ create_universe(/* hi */  GreatPowers).initialize_badminton().populate_swamps() &&
-        let    everybody    =    (Loops { hi /*hi*/  , ..loopy() }) || summons::triumphantly() { todo!() }
+        let    everybody    =    (Loops { hi /*hi*/  , ..loopy() }) && summons::triumphantly() { todo!() }
 
     if let XXXXXXXXX { xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyy, zzzzzzzzzzzzz} = xxxxxxx()
     && let Foo = bar() { todo!() }
diff --git a/tests/target/anonymous-types.rs b/tests/target/anonymous-types.rs
new file mode 100644
index 00000000000..8e08c314ed1
--- /dev/null
+++ b/tests/target/anonymous-types.rs
@@ -0,0 +1,19 @@
+// Test for issue 85480
+// Pretty print anonymous struct and union types
+
+// pp-exact
+// pretty-compare-only
+
+struct Foo {
+    _: union  {
+        _: struct  {
+            a: u8,
+            b: u16,
+        },
+        c: u32,
+    },
+    d: u64,
+    e: f32,
+}
+
+fn main() {}
diff --git a/tests/target/immovable_generators.rs b/tests/target/immovable_coroutines.rs
index 0bf7a2d91ba..f52cfa00f97 100644
--- a/tests/target/immovable_generators.rs
+++ b/tests/target/immovable_coroutines.rs
@@ -1,4 +1,4 @@
-#![feature(generators)]
+#![feature(coroutines)]
 
 unsafe fn foo() {
     let mut ga = static || {
diff --git a/tests/target/issue_4110.rs b/tests/target/issue_4110.rs
index d3734e90b7f..ea8fa3b73d2 100644
--- a/tests/target/issue_4110.rs
+++ b/tests/target/issue_4110.rs
@@ -12,7 +12,7 @@ fn bindings() {
                 span,
                 ..
             },
-        ) if borrow_spans.for_generator() | borrow_spans.for_closure() => self
+        ) if borrow_spans.for_coroutine() | borrow_spans.for_closure() => self
             .report_escaping_closure_capture(
                 borrow_spans,
                 borrow_span,
diff --git a/tests/target/let_chains.rs b/tests/target/let_chains.rs
index 165641521cf..1ceecac8abc 100644
--- a/tests/target/let_chains.rs
+++ b/tests/target/let_chains.rs
@@ -13,11 +13,12 @@ fn main() {
         && let None = aaaaaaaaaa
     {}
 
-    if aaaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaa
-        || aaaaaaaaa
-            && let Some(x) = xxxxxxxxxxxx
-            && aaaaaaa
-            && let None = aaaaaaaaaa
+    if aaaaaaaaaaaaaaaaaaaaa
+        && aaaaaaaaaaaaaaa
+        && aaaaaaaaa
+        && let Some(x) = xxxxxxxxxxxx
+        && aaaaaaa
+        && let None = aaaaaaaaaa
     {}
 
     if let Some(Struct { x: TS(1, 2) }) = path::to::<_>(hehe)
@@ -29,7 +30,7 @@ fn main() {
             hi, /*hi*/
             ..loopy()
         })
-        || summons::triumphantly()
+        && summons::triumphantly()
     {
         todo!()
     }