mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2026-03-12 20:00:31 +00:00
commit
72b935f64a
@ -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 {
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -11840,34 +11840,6 @@ extern "rust-call" fn add_args(args: (u32, u32)) -> u32 {
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
"##,
|
||||
default_severity: Severity::Allow,
|
||||
warn_since: None,
|
||||
deny_since: None,
|
||||
},
|
||||
Lint {
|
||||
label: "unchecked_neg",
|
||||
description: r##"# `unchecked_neg`
|
||||
|
||||
The tracking issue for this feature is: [#85122]
|
||||
|
||||
[#85122]: https://github.com/rust-lang/rust/issues/85122
|
||||
|
||||
------------------------
|
||||
"##,
|
||||
default_severity: Severity::Allow,
|
||||
warn_since: None,
|
||||
deny_since: None,
|
||||
},
|
||||
Lint {
|
||||
label: "unchecked_shifts",
|
||||
description: r##"# `unchecked_shifts`
|
||||
|
||||
The tracking issue for this feature is: [#85122]
|
||||
|
||||
[#85122]: https://github.com/rust-lang/rust/issues/85122
|
||||
|
||||
------------------------
|
||||
"##,
|
||||
default_severity: Severity::Allow,
|
||||
warn_since: None,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -1 +1 @@
|
||||
1be6b13be73dc12e98e51b403add4c41a0b77759
|
||||
dfe1b8c97bcde283102f706d5dcdc3649e5e12e3
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user