aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/assists/src/handlers/add_missing_impl_members.rs2
-rw-r--r--crates/assists/src/handlers/extract_struct_from_enum_variant.rs2
-rw-r--r--crates/hir/src/code_model.rs2
-rw-r--r--crates/ide/src/link_rewrite.rs4
-rw-r--r--crates/ssr/src/resolving.rs2
-rw-r--r--crates/syntax/Cargo.toml2
-rw-r--r--crates/syntax/src/ast/edit.rs2
-rw-r--r--crates/syntax/src/parsing/lexer.rs8
8 files changed, 12 insertions, 12 deletions
diff --git a/crates/assists/src/handlers/add_missing_impl_members.rs b/crates/assists/src/handlers/add_missing_impl_members.rs
index 1ac5fefd6..51b5a2eb0 100644
--- a/crates/assists/src/handlers/add_missing_impl_members.rs
+++ b/crates/assists/src/handlers/add_missing_impl_members.rs
@@ -146,7 +146,7 @@ fn add_missing_impl_members_inner(
146 146
147 let target = impl_def.syntax().text_range(); 147 let target = impl_def.syntax().text_range();
148 acc.add(AssistId(assist_id, AssistKind::QuickFix), label, target, |builder| { 148 acc.add(AssistId(assist_id, AssistKind::QuickFix), label, target, |builder| {
149 let impl_item_list = impl_def.assoc_item_list().unwrap_or(make::assoc_item_list()); 149 let impl_item_list = impl_def.assoc_item_list().unwrap_or_else(make::assoc_item_list);
150 150
151 let n_existing_items = impl_item_list.assoc_items().count(); 151 let n_existing_items = impl_item_list.assoc_items().count();
152 let source_scope = ctx.sema.scope_for_def(trait_); 152 let source_scope = ctx.sema.scope_for_def(trait_);
diff --git a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
index d1eadaa99..f5f03ef36 100644
--- a/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
+++ b/crates/assists/src/handlers/extract_struct_from_enum_variant.rs
@@ -91,7 +91,7 @@ fn existing_struct_def(db: &RootDatabase, variant_name: &str, variant: &EnumVari
91 .module(db) 91 .module(db)
92 .scope(db, None) 92 .scope(db, None)
93 .into_iter() 93 .into_iter()
94 .any(|(name, _)| name.to_string() == variant_name.to_string()) 94 .any(|(name, _)| name.to_string() == variant_name)
95} 95}
96 96
97#[allow(dead_code)] 97#[allow(dead_code)]
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index 567fd91af..5721a66c4 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -145,7 +145,7 @@ impl Crate {
145 } 145 }
146 }).flat_map(|t| t).next(); 146 }).flat_map(|t| t).next();
147 147
148 doc_url.map(|s| s.trim_matches('"').trim_end_matches("/").to_owned() + "/") 148 doc_url.map(|s| s.trim_matches('"').trim_end_matches('/').to_owned() + "/")
149 } 149 }
150} 150}
151 151
diff --git a/crates/ide/src/link_rewrite.rs b/crates/ide/src/link_rewrite.rs
index 107787bb9..a16f90e17 100644
--- a/crates/ide/src/link_rewrite.rs
+++ b/crates/ide/src/link_rewrite.rs
@@ -120,7 +120,7 @@ fn rewrite_intra_doc_link(
120 120
121/// Try to resolve path to local documentation via path-based links (i.e. `../gateway/struct.Shard.html`). 121/// Try to resolve path to local documentation via path-based links (i.e. `../gateway/struct.Shard.html`).
122fn rewrite_url_link(db: &RootDatabase, def: ModuleDef, target: &str) -> Option<String> { 122fn rewrite_url_link(db: &RootDatabase, def: ModuleDef, target: &str) -> Option<String> {
123 if !(target.contains("#") || target.contains(".html")) { 123 if !(target.contains('#') || target.contains(".html")) {
124 return None; 124 return None;
125 } 125 }
126 126
@@ -190,7 +190,7 @@ fn strip_prefixes_suffixes(mut s: &str) -> &str {
190 prefixes.clone().for_each(|prefix| s = s.trim_start_matches(*prefix)); 190 prefixes.clone().for_each(|prefix| s = s.trim_start_matches(*prefix));
191 suffixes.clone().for_each(|suffix| s = s.trim_end_matches(*suffix)); 191 suffixes.clone().for_each(|suffix| s = s.trim_end_matches(*suffix));
192 }); 192 });
193 s.trim_start_matches("@").trim() 193 s.trim_start_matches('@').trim()
194} 194}
195 195
196static TYPES: ([&str; 7], [&str; 0]) = 196static TYPES: ([&str; 7], [&str; 0]) =
diff --git a/crates/ssr/src/resolving.rs b/crates/ssr/src/resolving.rs
index 5d2cbec47..347cc4aad 100644
--- a/crates/ssr/src/resolving.rs
+++ b/crates/ssr/src/resolving.rs
@@ -205,7 +205,7 @@ impl<'db> ResolutionScope<'db> {
205 205
206 /// Returns the function in which SSR was invoked, if any. 206 /// Returns the function in which SSR was invoked, if any.
207 pub(crate) fn current_function(&self) -> Option<SyntaxNode> { 207 pub(crate) fn current_function(&self) -> Option<SyntaxNode> {
208 self.node.ancestors().find(|node| node.kind() == SyntaxKind::FN).map(|node| node.clone()) 208 self.node.ancestors().find(|node| node.kind() == SyntaxKind::FN)
209 } 209 }
210 210
211 fn resolve_path(&self, path: &ast::Path) -> Option<hir::PathResolution> { 211 fn resolve_path(&self, path: &ast::Path) -> Option<hir::PathResolution> {
diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml
index af61bb658..0b15f10e9 100644
--- a/crates/syntax/Cargo.toml
+++ b/crates/syntax/Cargo.toml
@@ -13,7 +13,7 @@ doctest = false
13[dependencies] 13[dependencies]
14itertools = "0.9.0" 14itertools = "0.9.0"
15rowan = "0.10.0" 15rowan = "0.10.0"
16rustc_lexer = { version = "673.0.0", package = "rustc-ap-rustc_lexer" } 16rustc_lexer = { version = "681.0.0", package = "rustc-ap-rustc_lexer" }
17rustc-hash = "1.1.0" 17rustc-hash = "1.1.0"
18arrayvec = "0.5.1" 18arrayvec = "0.5.1"
19once_cell = "1.3.1" 19once_cell = "1.3.1"
diff --git a/crates/syntax/src/ast/edit.rs b/crates/syntax/src/ast/edit.rs
index dda0a0319..77233ab31 100644
--- a/crates/syntax/src/ast/edit.rs
+++ b/crates/syntax/src/ast/edit.rs
@@ -159,7 +159,7 @@ impl ast::AssocItemList {
159 let whitespace = 159 let whitespace =
160 last_token_before_curly.clone().into_token().and_then(ast::Whitespace::cast)?; 160 last_token_before_curly.clone().into_token().and_then(ast::Whitespace::cast)?;
161 let text = whitespace.syntax().text(); 161 let text = whitespace.syntax().text();
162 let newline = text.rfind("\n")?; 162 let newline = text.rfind('\n')?;
163 let keep = tokens::WsBuilder::new(&text[newline..]); 163 let keep = tokens::WsBuilder::new(&text[newline..]);
164 Some(self.replace_children( 164 Some(self.replace_children(
165 first_token_after_items..=last_token_before_curly, 165 first_token_after_items..=last_token_before_curly,
diff --git a/crates/syntax/src/parsing/lexer.rs b/crates/syntax/src/parsing/lexer.rs
index fa3be1016..f1202113b 100644
--- a/crates/syntax/src/parsing/lexer.rs
+++ b/crates/syntax/src/parsing/lexer.rs
@@ -120,10 +120,10 @@ fn rustc_token_kind_to_syntax_kind(
120 120
121 let syntax_kind = { 121 let syntax_kind = {
122 match rustc_token_kind { 122 match rustc_token_kind {
123 rustc_lexer::TokenKind::LineComment => COMMENT, 123 rustc_lexer::TokenKind::LineComment { doc_style: _ } => COMMENT,
124 124
125 rustc_lexer::TokenKind::BlockComment { terminated: true } => COMMENT, 125 rustc_lexer::TokenKind::BlockComment { doc_style: _, terminated: true } => COMMENT,
126 rustc_lexer::TokenKind::BlockComment { terminated: false } => { 126 rustc_lexer::TokenKind::BlockComment { doc_style: _, terminated: false } => {
127 return ( 127 return (
128 COMMENT, 128 COMMENT,
129 Some("Missing trailing `*/` symbols to terminate the block comment"), 129 Some("Missing trailing `*/` symbols to terminate the block comment"),
@@ -164,7 +164,7 @@ fn rustc_token_kind_to_syntax_kind(
164 rustc_lexer::TokenKind::Colon => T![:], 164 rustc_lexer::TokenKind::Colon => T![:],
165 rustc_lexer::TokenKind::Dollar => T![$], 165 rustc_lexer::TokenKind::Dollar => T![$],
166 rustc_lexer::TokenKind::Eq => T![=], 166 rustc_lexer::TokenKind::Eq => T![=],
167 rustc_lexer::TokenKind::Not => T![!], 167 rustc_lexer::TokenKind::Bang => T![!],
168 rustc_lexer::TokenKind::Lt => T![<], 168 rustc_lexer::TokenKind::Lt => T![<],
169 rustc_lexer::TokenKind::Gt => T![>], 169 rustc_lexer::TokenKind::Gt => T![>],
170 rustc_lexer::TokenKind::Minus => T![-], 170 rustc_lexer::TokenKind::Minus => T![-],