Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #149370 - Zalathar:rollup-6fkk5x4, r=Zalathar
Rollup of 8 pull requests Successful merges: - rust-lang/rust#149238 (float::clamp: make treatment of signed zeros unspecified) - rust-lang/rust#149270 (implement `Iterator::{exactly_one, collect_array}`) - rust-lang/rust#149295 (Suggest _bytes versions of endian-converting methods) - rust-lang/rust#149332 (fix rustdoc search says “Consider searching for "null" instead.” rust-lang/rust#149324) - rust-lang/rust#149349 (Fix typo in comment.) - rust-lang/rust#149353 (Tidying up UI tests [3/N]) - rust-lang/rust#149355 (Document that `build.description` affects symbol mangling and crate IDs) - rust-lang/rust#149360 (Enable CI download for windows-gnullvm) r? `@ghost` `@rustbot` modify labels: rollup
bors 5 months ago
parent 53d2132 · parent b650533 · commit f2f2106
-rw-r--r--crates/hir-expand/src/builtin/fn_macro.rs3
-rw-r--r--crates/ide-assists/src/handlers/convert_bool_then.rs3
-rw-r--r--crates/ide-assists/src/handlers/convert_range_for_to_while.rs2
-rw-r--r--crates/ide-completion/src/tests/raw_identifiers.rs5
-rw-r--r--crates/rust-analyzer/tests/slow-tests/support.rs3
5 files changed, 9 insertions, 7 deletions
diff --git a/crates/hir-expand/src/builtin/fn_macro.rs b/crates/hir-expand/src/builtin/fn_macro.rs
index 6fe63f249c..78fac8ff13 100644
--- a/crates/hir-expand/src/builtin/fn_macro.rs
+++ b/crates/hir-expand/src/builtin/fn_macro.rs
@@ -786,7 +786,8 @@ fn parse_string(tt: &tt::TopSubtree) -> Result<(Symbol, Span), ExpandError> {
&& let DelimiterKind::Parenthesis | DelimiterKind::Invisible = sub.delimiter.kind
{
tt =
- tt_iter.exactly_one().map_err(|_| sub.delimiter.open.cover(sub.delimiter.close))?;
+ // FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
+ Itertools::exactly_one(tt_iter).map_err(|_| sub.delimiter.open.cover(sub.delimiter.close))?;
}
match tt {
diff --git a/crates/ide-assists/src/handlers/convert_bool_then.rs b/crates/ide-assists/src/handlers/convert_bool_then.rs
index 9d5d3f2237..91cee59ad8 100644
--- a/crates/ide-assists/src/handlers/convert_bool_then.rs
+++ b/crates/ide-assists/src/handlers/convert_bool_then.rs
@@ -163,7 +163,8 @@ pub(crate) fn convert_bool_then_to_if(acc: &mut Assists, ctx: &AssistContext<'_>
let name_ref = ctx.find_node_at_offset::<ast::NameRef>()?;
let mcall = name_ref.syntax().parent().and_then(ast::MethodCallExpr::cast)?;
let receiver = mcall.receiver()?;
- let closure_body = mcall.arg_list()?.args().exactly_one().ok()?;
+ // FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
+ let closure_body = Itertools::exactly_one(mcall.arg_list()?.args()).ok()?;
let closure_body = match closure_body {
ast::Expr::ClosureExpr(expr) => expr.body()?,
_ => return None,
diff --git a/crates/ide-assists/src/handlers/convert_range_for_to_while.rs b/crates/ide-assists/src/handlers/convert_range_for_to_while.rs
index 68cb764030..ba577b217d 100644
--- a/crates/ide-assists/src/handlers/convert_range_for_to_while.rs
+++ b/crates/ide-assists/src/handlers/convert_range_for_to_while.rs
@@ -113,7 +113,7 @@ fn extract_range(iterable: &ast::Expr) -> Option<(ast::Expr, Option<ast::Expr>,
(range.start()?, range.end(), make::expr_literal("1").into(), inclusive)
}
ast::Expr::MethodCallExpr(call) if call.name_ref()?.text() == "step_by" => {
- let [step] = call.arg_list()?.args().collect_array()?;
+ let [step] = Itertools::collect_array(call.arg_list()?.args())?;
let (start, end, _, inclusive) = extract_range(&call.receiver()?)?;
(start, end, step, inclusive)
}
diff --git a/crates/ide-completion/src/tests/raw_identifiers.rs b/crates/ide-completion/src/tests/raw_identifiers.rs
index 00977ea4e5..66b16681f4 100644
--- a/crates/ide-completion/src/tests/raw_identifiers.rs
+++ b/crates/ide-completion/src/tests/raw_identifiers.rs
@@ -8,9 +8,8 @@ fn check(#[rust_analyzer::rust_fixture] ra_fixture: &str, expect: Expect) {
let completions = completion_list_with_config_raw(TEST_CONFIG, ra_fixture, true, None);
let (db, position) = position(ra_fixture);
let mut actual = db.file_text(position.file_id).text(&db).to_string();
- completions
- .into_iter()
- .exactly_one()
+ // FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
+ Itertools::exactly_one(completions.into_iter())
.expect("more than one completion")
.text_edit
.apply(&mut actual);
diff --git a/crates/rust-analyzer/tests/slow-tests/support.rs b/crates/rust-analyzer/tests/slow-tests/support.rs
index 3464a9644b..b1b428e706 100644
--- a/crates/rust-analyzer/tests/slow-tests/support.rs
+++ b/crates/rust-analyzer/tests/slow-tests/support.rs
@@ -113,7 +113,8 @@ impl Project<'_> {
let mut buf = Vec::new();
flags::Lsif::run(
flags::Lsif {
- path: tmp_dir_path.join(self.roots.iter().exactly_one().unwrap()).into(),
+ // FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
+ path: tmp_dir_path.join(Itertools::exactly_one(self.roots.iter()).unwrap()).into(),
exclude_vendored_libraries: false,
},
&mut buf,