From d2eccb028f103fce73fac7951895d4c1eeae89f2 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Sun, 16 Jan 2022 13:05:29 +0800 Subject: [PATCH 1/7] Do not display ~const in rustdoc --- src/librustdoc/html/format.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index c0115bfc6d4fa..3aa8421456b8d 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -424,7 +424,8 @@ impl clean::GenericBound { let modifier_str = match modifier { hir::TraitBoundModifier::None => "", hir::TraitBoundModifier::Maybe => "?", - hir::TraitBoundModifier::MaybeConst => "~const", + // ~const is experimental; do not display those bounds in rustdoc + hir::TraitBoundModifier::MaybeConst => "", }; if f.alternate() { write!(f, "{}{:#}", modifier_str, ty.print(cx)) From 5406cbfb1c498812de69200c9ad8db2b5b25eff7 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Sat, 22 Jan 2022 14:46:19 +0800 Subject: [PATCH 2/7] Do not display hidden `~const Drop` bounds --- src/librustdoc/html/format.rs | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 3aa8421456b8d..f703a67894939 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -279,7 +279,24 @@ crate fn print_where_clause<'a, 'tcx: 'a>( clause.push_str(" where"); } } - for (i, pred) in gens.where_predicates.iter().enumerate() { + + #[derive(Clone, Copy)] + enum Print<'a> { + Predicate(&'a clean::WherePredicate), + Comma, + } + + for pred in gens.where_predicates.iter().filter(|pred| { + !matches!(pred, clean::WherePredicate::BoundPredicate { bounds, .. } if bounds.is_empty()) + }).map(Print::Predicate).intersperse(Print::Comma) { + let pred = match pred { + Print::Predicate(pred) => pred, + Print::Comma => { + clause.push(','); + continue; + } + }; + if f.alternate() { clause.push(' '); } else { @@ -338,13 +355,10 @@ crate fn print_where_clause<'a, 'tcx: 'a>( } } } - - if i < gens.where_predicates.len() - 1 || end_newline { - clause.push(','); - } } if end_newline { + clause.push(','); // add a space so stripping
tags and breaking spaces still renders properly if f.alternate() { clause.push(' '); From 9c0141a4907e9255c5583304def3c16d357a5a14 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Sun, 23 Jan 2022 00:13:42 +0800 Subject: [PATCH 3/7] Bless rustdoc test --- src/librustdoc/html/format.rs | 166 +++++++++--------- .../const-generics/generic_const_exprs.rs | 2 +- 2 files changed, 83 insertions(+), 85 deletions(-) diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index f703a67894939..699be93b1230f 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -143,11 +143,14 @@ impl Buffer { } } -fn comma_sep(items: impl Iterator) -> impl fmt::Display { +fn comma_sep( + items: impl Iterator, + space_after_comma: bool, +) -> impl fmt::Display { display_fn(move |f| { for (i, item) in items.enumerate() { if i != 0 { - write!(f, ", ")?; + write!(f, ",{}", if space_after_comma { " " } else { "" })?; } fmt::Display::fmt(&item, f)?; } @@ -248,9 +251,9 @@ impl clean::Generics { } if f.alternate() { - write!(f, "<{:#}>", comma_sep(real_params.map(|g| g.print(cx)))) + write!(f, "<{:#}>", comma_sep(real_params.map(|g| g.print(cx)), true)) } else { - write!(f, "<{}>", comma_sep(real_params.map(|g| g.print(cx)))) + write!(f, "<{}>", comma_sep(real_params.map(|g| g.print(cx)), true)) } }) } @@ -266,10 +269,80 @@ crate fn print_where_clause<'a, 'tcx: 'a>( end_newline: bool, ) -> impl fmt::Display + 'a + Captures<'tcx> { display_fn(move |f| { - if gens.where_predicates.is_empty() { + let mut where_predicates = gens.where_predicates.iter().filter(|pred| { + !matches!(pred, clean::WherePredicate::BoundPredicate { bounds, .. } if bounds.is_empty()) + }).map(|pred| { + display_fn(move |f| { + if f.alternate() { + f.write_str(" ")?; + } else { + f.write_str("
")?; + } + + match pred { + clean::WherePredicate::BoundPredicate { ty, bounds, bound_params } => { + let bounds = bounds; + let for_prefix = match bound_params.len() { + 0 => String::new(), + _ if f.alternate() => { + format!( + "for<{:#}> ", + comma_sep(bound_params.iter().map(|lt| lt.print()), true) + ) + } + _ => format!( + "for<{}> ", + comma_sep(bound_params.iter().map(|lt| lt.print()), true) + ), + }; + + if f.alternate() { + write!( + f, + "{}{:#}: {:#}", + for_prefix, + ty.print(cx), + print_generic_bounds(bounds, cx) + ) + } else { + write!( + f, + "{}{}: {}", + for_prefix, + ty.print(cx), + print_generic_bounds(bounds, cx) + ) + } + } + clean::WherePredicate::RegionPredicate { lifetime, bounds } => { + write!( + f, + "{}: {}", + lifetime.print(), + bounds + .iter() + .map(|b| b.print(cx).to_string()) + .collect::>() + .join(" + ") + ) + } + clean::WherePredicate::EqPredicate { lhs, rhs } => { + if f.alternate() { + write!(f, "{:#} == {:#}", lhs.print(cx), rhs.print(cx),) + } else { + write!(f, "{} == {}", lhs.print(cx), rhs.print(cx),) + } + } + } + }) + }).peekable(); + + if where_predicates.peek().is_none() { return Ok(()); } + let mut clause = String::new(); + if f.alternate() { clause.push_str(" where"); } else { @@ -280,82 +353,7 @@ crate fn print_where_clause<'a, 'tcx: 'a>( } } - #[derive(Clone, Copy)] - enum Print<'a> { - Predicate(&'a clean::WherePredicate), - Comma, - } - - for pred in gens.where_predicates.iter().filter(|pred| { - !matches!(pred, clean::WherePredicate::BoundPredicate { bounds, .. } if bounds.is_empty()) - }).map(Print::Predicate).intersperse(Print::Comma) { - let pred = match pred { - Print::Predicate(pred) => pred, - Print::Comma => { - clause.push(','); - continue; - } - }; - - if f.alternate() { - clause.push(' '); - } else { - clause.push_str("
"); - } - - match pred { - clean::WherePredicate::BoundPredicate { ty, bounds, bound_params } => { - let bounds = bounds; - let for_prefix = match bound_params.len() { - 0 => String::new(), - _ if f.alternate() => { - format!( - "for<{:#}> ", - comma_sep(bound_params.iter().map(|lt| lt.print())) - ) - } - _ => format!( - "for<{}> ", - comma_sep(bound_params.iter().map(|lt| lt.print())) - ), - }; - - if f.alternate() { - clause.push_str(&format!( - "{}{:#}: {:#}", - for_prefix, - ty.print(cx), - print_generic_bounds(bounds, cx) - )); - } else { - clause.push_str(&format!( - "{}{}: {}", - for_prefix, - ty.print(cx), - print_generic_bounds(bounds, cx) - )); - } - } - clean::WherePredicate::RegionPredicate { lifetime, bounds } => { - clause.push_str(&format!( - "{}: {}", - lifetime.print(), - bounds - .iter() - .map(|b| b.print(cx).to_string()) - .collect::>() - .join(" + ") - )); - } - clean::WherePredicate::EqPredicate { lhs, rhs } => { - if f.alternate() { - clause.push_str(&format!("{:#} == {:#}", lhs.print(cx), rhs.print(cx),)); - } else { - clause.push_str(&format!("{} == {}", lhs.print(cx), rhs.print(cx),)); - } - } - } - } + clause.push_str(&comma_sep(where_predicates, false).to_string()); if end_newline { clause.push(','); @@ -408,13 +406,13 @@ impl clean::PolyTrait { write!( f, "for<{:#}> ", - comma_sep(self.generic_params.iter().map(|g| g.print(cx))) + comma_sep(self.generic_params.iter().map(|g| g.print(cx)), true) )?; } else { write!( f, "for<{}> ", - comma_sep(self.generic_params.iter().map(|g| g.print(cx))) + comma_sep(self.generic_params.iter().map(|g| g.print(cx)), true) )?; } } @@ -1125,7 +1123,7 @@ impl clean::BareFunctionDecl { write!( f, "for<{}> ", - comma_sep(self.generic_params.iter().map(|g| g.print(cx))) + comma_sep(self.generic_params.iter().map(|g| g.print(cx)), true) ) } else { Ok(()) diff --git a/src/test/rustdoc/const-generics/generic_const_exprs.rs b/src/test/rustdoc/const-generics/generic_const_exprs.rs index 35036a89360e2..215ee228eb857 100644 --- a/src/test/rustdoc/const-generics/generic_const_exprs.rs +++ b/src/test/rustdoc/const-generics/generic_const_exprs.rs @@ -3,5 +3,5 @@ #![allow(incomplete_features)] // make sure that `ConstEvaluatable` predicates dont cause rustdoc to ICE #77647 // @has foo/struct.Ice.html '//pre[@class="rust struct"]' \ -// 'pub struct Ice where [(); N + 1]: ;' +// 'pub struct Ice;' pub struct Ice where [(); N + 1]:; From 79f2180928982ebd8deb0b39bfa1c1c1dd7a0a59 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Tue, 22 Feb 2022 10:26:18 +1100 Subject: [PATCH 4/7] Add ui test --- src/test/rustdoc/rfc-2632-const-trait-impl.rs | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/test/rustdoc/rfc-2632-const-trait-impl.rs diff --git a/src/test/rustdoc/rfc-2632-const-trait-impl.rs b/src/test/rustdoc/rfc-2632-const-trait-impl.rs new file mode 100644 index 0000000000000..2adf69f6514cd --- /dev/null +++ b/src/test/rustdoc/rfc-2632-const-trait-impl.rs @@ -0,0 +1,60 @@ +// Test that we do not currently display `~const` in rustdoc +// as that syntax is currently provisional; `~const Drop` has +// no effect on stable code so it should be hidden as well. +// +// To future blessers: make sure that `const_trait_impl` is +// stabilized when changing `@!has` to `@has`, and please do +// not remove this test. +#![feature(const_trait_impl)] +#![crate_name = "foo"] + +pub struct S(T); + +// @!has foo/trait.Tr.html '//pre[@class="rust trait"]/code/a[@class="trait"]' '~const' +// @!has - '//pre[@class="rust trait"]/code/a[@class="trait"]' 'Drop' +// @has - '//pre[@class="rust trait"]/code/a[@class="trait"]' 'Clone' +// @!has - '//pre[@class="rust trait"]/code/span[@class="where"]' '~const' +// @!has - '//pre[@class="rust trait"]/code/span[@class="where"]' 'Drop' +// @has - '//pre[@class="rust trait"]/code/span[@class="where"]' ': Clone' +pub trait Tr { + // @!has - '//div[@id="method.a"]/h4[@class="code-header"]' '~const' + // @!has - '//div[@id="method.a"]/h4[@class="code-header"]/a[@class="trait"]' 'Drop' + // @has - '//div[@id="method.a"]/h4[@class="code-header"]/a[@class="trait"]' 'Clone' + // @!has - '//div[@id="method.a"]/h4[@class="code-header"]/span[@class="where"]' '~const' + // @!has - '//div[@id="method.a"]/h4[@class="code-header"]/span[@class="where fmt-newline"]' 'Drop' + // @has - '//div[@id="method.a"]/h4[@class="code-header"]/span[@class="where fmt-newline"]' ': Clone' + #[default_method_body_is_const] + fn a() where Option: ~const Drop + ~const Clone {} +} + +// @!has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]' '~const' +// @!has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]/a[@class="trait"]' 'Drop' +// @has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]/a[@class="trait"]' 'Clone' +// @!has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]/span[@class="where"]' '~const' +// @!has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]/span[@class="where fmt-newline"]' 'Drop' +// @has - '//section[@id="impl-Tr%3CT%3E"]/h3[@class="code-header in-band"]/span[@class="where fmt-newline"]' ': Clone' +impl const Tr for T where Option: ~const Drop + ~const Clone { + fn a() where Option: ~const Drop + ~const Clone {} +} + +// @!has foo/fn.foo.html '//pre[@class="rust fn"]/code/a[@class="trait"]' '~const' +// @!has - '//pre[@class="rust fn"]/code/a[@class="trait"]' 'Drop' +// @has - '//pre[@class="rust fn"]/code/a[@class="trait"]' 'Clone' +// @!has - '//pre[@class="rust fn"]/code/span[@class="where fmt-newline"]' '~const' +// @!has - '//pre[@class="rust fn"]/code/span[@class="where fmt-newline"]' 'Drop' +// @has - '//pre[@class="rust fn"]/code/span[@class="where fmt-newline"]' ': Clone' +pub const fn foo() where Option: ~const Drop + ~const Clone { + F::a() +} + +impl S { + // @!has foo/struct.S.html '//section[@id="method.foo"]/h4[@class="code-header"]' '~const' + // @!has - '//section[@id="method.foo"]/h4[@class="code-header"]/a[@class="trait"]' 'Drop' + // @has - '//section[@id="method.foo"]/h4[@class="code-header"]/a[@class="trait"]' 'Clone' + // @!has - '//section[@id="method.foo"]/h4[@class="code-header"]/span[@class="where"]' '~const' + // @!has - '//section[@id="method.foo"]/h4[@class="code-header"]/span[@class="where fmt-newline"]' 'Drop' + // @has - '//section[@id="method.foo"]/h4[@class="code-header"]/span[@class="where fmt-newline"]' ': Clone' + pub const fn foo() where B: ~const Drop + ~const Clone { + B::a() + } +} From 484936bbfcb09c357569198f9a5a21deed8dd041 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Tue, 22 Feb 2022 10:30:59 +1100 Subject: [PATCH 5/7] Address review comments --- src/librustdoc/html/format.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 699be93b1230f..9faf5431a6eba 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -282,18 +282,18 @@ crate fn print_where_clause<'a, 'tcx: 'a>( match pred { clean::WherePredicate::BoundPredicate { ty, bounds, bound_params } => { let bounds = bounds; - let for_prefix = match bound_params.len() { - 0 => String::new(), - _ if f.alternate() => { - format!( - "for<{:#}> ", - comma_sep(bound_params.iter().map(|lt| lt.print()), true) - ) - } - _ => format!( + let for_prefix = if bound_params.is_empty() { + String::new() + } else if f.alternate() { + format!( + "for<{:#}> ", + comma_sep(bound_params.iter().map(|lt| lt.print()), true) + ) + } else { + format!( "for<{}> ", comma_sep(bound_params.iter().map(|lt| lt.print()), true) - ), + ) }; if f.alternate() { From f684acdd7efe9767978d81eb9460077e50692dce Mon Sep 17 00:00:00 2001 From: pierwill Date: Fri, 4 Mar 2022 11:54:28 -0600 Subject: [PATCH 6/7] Update `itertools` Update to 0.10.1 --- Cargo.lock | 39 +++++++++--------------- compiler/rustc_ast_passes/Cargo.toml | 2 +- compiler/rustc_borrowck/Cargo.toml | 2 +- compiler/rustc_codegen_ssa/Cargo.toml | 2 +- compiler/rustc_mir_transform/Cargo.toml | 2 +- src/librustdoc/Cargo.toml | 2 +- src/tools/clippy/Cargo.toml | 2 +- src/tools/clippy/clippy_dev/Cargo.toml | 2 +- src/tools/clippy/clippy_lints/Cargo.toml | 2 +- src/tools/rustfmt/Cargo.toml | 2 +- 10 files changed, 24 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8ca6f26e326d1..e21e9d08bbfc3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -344,7 +344,7 @@ dependencies = [ "humantime 2.0.1", "ignore", "im-rc", - "itertools 0.10.1", + "itertools", "jobserver", "lazy_static", "lazycell", @@ -449,7 +449,7 @@ dependencies = [ "flate2", "git2", "glob", - "itertools 0.10.1", + "itertools", "lazy_static", "remove_dir_all", "serde_json", @@ -567,7 +567,7 @@ dependencies = [ "chalk-ir", "ena", "indexmap", - "itertools 0.10.1", + "itertools", "petgraph", "rustc-hash", "tracing", @@ -631,7 +631,7 @@ dependencies = [ "filetime", "futures 0.3.19", "if_chain", - "itertools 0.10.1", + "itertools", "num_cpus", "parking_lot", "quote", @@ -654,7 +654,7 @@ dependencies = [ "cargo_metadata", "clap 2.34.0", "indoc", - "itertools 0.10.1", + "itertools", "opener", "regex", "shell-escape", @@ -668,7 +668,7 @@ dependencies = [ "cargo_metadata", "clippy_utils", "if_chain", - "itertools 0.10.1", + "itertools", "pulldown-cmark", "quine-mc_cluskey", "regex-syntax", @@ -1790,15 +1790,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "itertools" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.10.1" @@ -3145,7 +3136,7 @@ dependencies = [ "futures 0.3.19", "heck", "home", - "itertools 0.10.1", + "itertools", "jsonrpc-core", "lazy_static", "log", @@ -3187,7 +3178,7 @@ dependencies = [ "derive-new", "env_logger 0.9.0", "fst", - "itertools 0.10.1", + "itertools", "json", "lazy_static", "log", @@ -3418,7 +3409,7 @@ dependencies = [ name = "rustc_ast_passes" version = "0.0.0" dependencies = [ - "itertools 0.10.1", + "itertools", "rustc_ast", "rustc_ast_pretty", "rustc_attr", @@ -3461,7 +3452,7 @@ name = "rustc_borrowck" version = "0.0.0" dependencies = [ "either", - "itertools 0.10.1", + "itertools", "polonius-engine", "rustc_const_eval", "rustc_data_structures", @@ -3543,7 +3534,7 @@ version = "0.0.0" dependencies = [ "bitflags", "cc", - "itertools 0.10.1", + "itertools", "jobserver", "libc", "object 0.28.1", @@ -4027,7 +4018,7 @@ name = "rustc_mir_transform" version = "0.0.0" dependencies = [ "coverage_test_macros", - "itertools 0.10.1", + "itertools", "rustc_ast", "rustc_attr", "rustc_const_eval", @@ -4428,7 +4419,7 @@ dependencies = [ "askama", "atty", "expect-test", - "itertools 0.10.1", + "itertools", "minifier", "pulldown-cmark", "rayon", @@ -4510,7 +4501,7 @@ dependencies = [ "env_logger 0.8.4", "getopts", "ignore", - "itertools 0.9.0", + "itertools", "lazy_static", "log", "regex", @@ -5190,7 +5181,7 @@ checksum = "744e9ed5b352340aa47ce033716991b5589e23781acb97cad37d4ea70560f55b" dependencies = [ "combine", "indexmap", - "itertools 0.10.1", + "itertools", "kstring", "serde", ] diff --git a/compiler/rustc_ast_passes/Cargo.toml b/compiler/rustc_ast_passes/Cargo.toml index 45b70420338dd..22742b2adbd4f 100644 --- a/compiler/rustc_ast_passes/Cargo.toml +++ b/compiler/rustc_ast_passes/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.0" edition = "2021" [dependencies] -itertools = "0.10" +itertools = "0.10.1" tracing = "0.1" rustc_ast_pretty = { path = "../rustc_ast_pretty" } rustc_attr = { path = "../rustc_attr" } diff --git a/compiler/rustc_borrowck/Cargo.toml b/compiler/rustc_borrowck/Cargo.toml index eb2fdbd07967d..0b531623ba6f5 100644 --- a/compiler/rustc_borrowck/Cargo.toml +++ b/compiler/rustc_borrowck/Cargo.toml @@ -8,7 +8,7 @@ doctest = false [dependencies] either = "1.5.0" -itertools = "0.10" +itertools = "0.10.1" tracing = "0.1" polonius-engine = "0.13.0" smallvec = { version = "1.6.1", features = ["union", "may_dangle"] } diff --git a/compiler/rustc_codegen_ssa/Cargo.toml b/compiler/rustc_codegen_ssa/Cargo.toml index 8bbf25ce030f8..87d0680bf6f30 100644 --- a/compiler/rustc_codegen_ssa/Cargo.toml +++ b/compiler/rustc_codegen_ssa/Cargo.toml @@ -9,7 +9,7 @@ test = false [dependencies] bitflags = "1.2.1" cc = "1.0.69" -itertools = "0.10" +itertools = "0.10.1" tracing = "0.1" libc = "0.2.50" jobserver = "0.1.22" diff --git a/compiler/rustc_mir_transform/Cargo.toml b/compiler/rustc_mir_transform/Cargo.toml index 7b000e2e1d226..4c1a7eaf6f03b 100644 --- a/compiler/rustc_mir_transform/Cargo.toml +++ b/compiler/rustc_mir_transform/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" doctest = false [dependencies] -itertools = "0.10" +itertools = "0.10.1" smallvec = { version = "1.6.1", features = ["union", "may_dangle"] } tracing = "0.1" rustc_ast = { path = "../rustc_ast" } diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml index 4371a914b4804..18a3498e34eba 100644 --- a/src/librustdoc/Cargo.toml +++ b/src/librustdoc/Cargo.toml @@ -17,7 +17,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" smallvec = "1.6.1" tempfile = "3" -itertools = "0.10" +itertools = "0.10.1" regex = "1" rustdoc-json-types = { path = "../rustdoc-json-types" } tracing = "0.1" diff --git a/src/tools/clippy/Cargo.toml b/src/tools/clippy/Cargo.toml index 5cc5530f874dd..d4ca9480bec62 100644 --- a/src/tools/clippy/Cargo.toml +++ b/src/tools/clippy/Cargo.toml @@ -43,7 +43,7 @@ rustc-workspace-hack = "1.0" clippy_utils = { path = "clippy_utils" } derive-new = "0.5" if_chain = "1.0" -itertools = "0.10" +itertools = "0.10.1" quote = "1.0" serde = { version = "1.0", features = ["derive"] } syn = { version = "1.0", features = ["full"] } diff --git a/src/tools/clippy/clippy_dev/Cargo.toml b/src/tools/clippy/clippy_dev/Cargo.toml index d350d9a001827..d133e8cddabc7 100644 --- a/src/tools/clippy/clippy_dev/Cargo.toml +++ b/src/tools/clippy/clippy_dev/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" bytecount = "0.6" clap = "2.33" indoc = "1.0" -itertools = "0.10" +itertools = "0.10.1" opener = "0.5" regex = "1.5" shell-escape = "0.1" diff --git a/src/tools/clippy/clippy_lints/Cargo.toml b/src/tools/clippy/clippy_lints/Cargo.toml index 40d7dd702628f..66e61660d313a 100644 --- a/src/tools/clippy/clippy_lints/Cargo.toml +++ b/src/tools/clippy/clippy_lints/Cargo.toml @@ -12,7 +12,7 @@ edition = "2021" cargo_metadata = "0.14" clippy_utils = { path = "../clippy_utils" } if_chain = "1.0" -itertools = "0.10" +itertools = "0.10.1" pulldown-cmark = { version = "0.9", default-features = false } quine-mc_cluskey = "0.2" regex-syntax = "0.6" diff --git a/src/tools/rustfmt/Cargo.toml b/src/tools/rustfmt/Cargo.toml index 8d9c4a7fb20cd..764714638a978 100644 --- a/src/tools/rustfmt/Cargo.toml +++ b/src/tools/rustfmt/Cargo.toml @@ -33,7 +33,7 @@ rustfmt-format-diff = [] generic-simd = ["bytecount/generic-simd"] [dependencies] -itertools = "0.9" +itertools = "0.10.1" toml = "0.5" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" From 1d64b8587fb58a39c8a1d47eecdd5a85884b96a3 Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Sun, 6 Mar 2022 12:43:30 +0000 Subject: [PATCH 7/7] Update -Z unpretty error message Adds `thir-tree`, removes `everybody_loops` --- compiler/rustc_session/src/config.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 5f8aec80bccc7..221dc86c1d46d 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -2628,11 +2628,10 @@ fn parse_pretty(debugging_opts: &DebuggingOptions, efmt: ErrorOutputType) -> Opt name => early_error( efmt, &format!( - "argument to `unpretty` must be one of `normal`, \ - `expanded`, `identified`, `expanded,identified`, \ - `expanded,hygiene`, `everybody_loops`, \ + "argument to `unpretty` must be one of `normal`, `identified`, \ + `expanded`, `expanded,identified`, `expanded,hygiene`, \ `ast-tree`, `ast-tree,expanded`, `hir`, `hir,identified`, \ - `hir,typed`, `hir-tree`, `mir` or `mir-cfg`; got {}", + `hir,typed`, `hir-tree`, `thir-tree`, `mir` or `mir-cfg`; got {}", name ), ),