Skip to content

Commit 72b935f

Browse files
authored
Merge pull request #21185 from rust-lang/rustc-pull
Rustc pull update
2 parents cbdd9c9 + 4f45c09 commit 72b935f

File tree

7 files changed

+10
-36
lines changed

7 files changed

+10
-36
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/ide-db/src/generated/lints.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11840,34 +11840,6 @@ extern "rust-call" fn add_args(args: (u32, u32)) -> u32 {
1184011840

1184111841
fn main() {}
1184211842
```
11843-
"##,
11844-
default_severity: Severity::Allow,
11845-
warn_since: None,
11846-
deny_since: None,
11847-
},
11848-
Lint {
11849-
label: "unchecked_neg",
11850-
description: r##"# `unchecked_neg`
11851-
11852-
The tracking issue for this feature is: [#85122]
11853-
11854-
[#85122]: https://github.com/rust-lang/rust/issues/85122
11855-
11856-
------------------------
11857-
"##,
11858-
default_severity: Severity::Allow,
11859-
warn_since: None,
11860-
deny_since: None,
11861-
},
11862-
Lint {
11863-
label: "unchecked_shifts",
11864-
description: r##"# `unchecked_shifts`
11865-
11866-
The tracking issue for this feature is: [#85122]
11867-
11868-
[#85122]: https://github.com/rust-lang/rust/issues/85122
11869-
11870-
------------------------
1187111843
"##,
1187211844
default_severity: Severity::Allow,
1187311845
warn_since: None,

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,

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1be6b13be73dc12e98e51b403add4c41a0b77759
1+
dfe1b8c97bcde283102f706d5dcdc3649e5e12e3

0 commit comments

Comments
 (0)