Skip to content

Commit f2f2106

Browse files
committed
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
2 parents 53d2132 + b650533 commit f2f2106

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

crates/hir-expand/src/builtin/fn_macro.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,8 @@ fn parse_string(tt: &tt::TopSubtree) -> Result<(Symbol, Span), ExpandError> {
786786
&& let DelimiterKind::Parenthesis | DelimiterKind::Invisible = sub.delimiter.kind
787787
{
788788
tt =
789-
tt_iter.exactly_one().map_err(|_| sub.delimiter.open.cover(sub.delimiter.close))?;
789+
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
790+
Itertools::exactly_one(tt_iter).map_err(|_| sub.delimiter.open.cover(sub.delimiter.close))?;
790791
}
791792

792793
match tt {

crates/ide-assists/src/handlers/convert_bool_then.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ pub(crate) fn convert_bool_then_to_if(acc: &mut Assists, ctx: &AssistContext<'_>
163163
let name_ref = ctx.find_node_at_offset::<ast::NameRef>()?;
164164
let mcall = name_ref.syntax().parent().and_then(ast::MethodCallExpr::cast)?;
165165
let receiver = mcall.receiver()?;
166-
let closure_body = mcall.arg_list()?.args().exactly_one().ok()?;
166+
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
167+
let closure_body = Itertools::exactly_one(mcall.arg_list()?.args()).ok()?;
167168
let closure_body = match closure_body {
168169
ast::Expr::ClosureExpr(expr) => expr.body()?,
169170
_ => return None,

crates/ide-assists/src/handlers/convert_range_for_to_while.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fn extract_range(iterable: &ast::Expr) -> Option<(ast::Expr, Option<ast::Expr>,
113113
(range.start()?, range.end(), make::expr_literal("1").into(), inclusive)
114114
}
115115
ast::Expr::MethodCallExpr(call) if call.name_ref()?.text() == "step_by" => {
116-
let [step] = call.arg_list()?.args().collect_array()?;
116+
let [step] = Itertools::collect_array(call.arg_list()?.args())?;
117117
let (start, end, _, inclusive) = extract_range(&call.receiver()?)?;
118118
(start, end, step, inclusive)
119119
}

crates/ide-completion/src/tests/raw_identifiers.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ fn check(#[rust_analyzer::rust_fixture] ra_fixture: &str, expect: Expect) {
88
let completions = completion_list_with_config_raw(TEST_CONFIG, ra_fixture, true, None);
99
let (db, position) = position(ra_fixture);
1010
let mut actual = db.file_text(position.file_id).text(&db).to_string();
11-
completions
12-
.into_iter()
13-
.exactly_one()
11+
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
12+
Itertools::exactly_one(completions.into_iter())
1413
.expect("more than one completion")
1514
.text_edit
1615
.apply(&mut actual);

crates/rust-analyzer/tests/slow-tests/support.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ impl Project<'_> {
113113
let mut buf = Vec::new();
114114
flags::Lsif::run(
115115
flags::Lsif {
116-
path: tmp_dir_path.join(self.roots.iter().exactly_one().unwrap()).into(),
116+
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
117+
path: tmp_dir_path.join(Itertools::exactly_one(self.roots.iter()).unwrap()).into(),
117118
exclude_vendored_libraries: false,
118119
},
119120
&mut buf,

0 commit comments

Comments
 (0)