Skip to content

Commit c577e12

Browse files
bors[bot]matklad
andauthored
Merge #10248
10248: internal: remove dead code r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 911659a + 73b0f9d commit c577e12

File tree

10 files changed

+10
-43
lines changed

10 files changed

+10
-43
lines changed

crates/flycheck/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl fmt::Display for FlycheckConfig {
5555
pub struct FlycheckHandle {
5656
// XXX: drop order is significant
5757
sender: Sender<Restart>,
58-
thread: jod_thread::JoinHandle,
58+
_thread: jod_thread::JoinHandle,
5959
}
6060

6161
impl FlycheckHandle {
@@ -71,7 +71,7 @@ impl FlycheckHandle {
7171
.name("Flycheck".to_owned())
7272
.spawn(move || actor.run(receiver))
7373
.expect("failed to spawn thread");
74-
FlycheckHandle { sender, thread }
74+
FlycheckHandle { sender, _thread: thread }
7575
}
7676

7777
/// Schedule a re-start of the cargo check worker.

crates/hir/src/source_analyzer.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ pub(crate) struct SourceAnalyzer {
4343
body: Option<Arc<Body>>,
4444
body_source_map: Option<Arc<BodySourceMap>>,
4545
infer: Option<Arc<InferenceResult>>,
46-
scopes: Option<Arc<ExprScopes>>,
4746
}
4847

4948
impl SourceAnalyzer {
@@ -65,7 +64,6 @@ impl SourceAnalyzer {
6564
body: Some(body),
6665
body_source_map: Some(source_map),
6766
infer: Some(db.infer(def)),
68-
scopes: Some(scopes),
6967
file_id: node.file_id,
7068
}
7169
}
@@ -79,7 +77,6 @@ impl SourceAnalyzer {
7977
body: None,
8078
body_source_map: None,
8179
infer: None,
82-
scopes: None,
8380
file_id: node.file_id,
8481
}
8582
}

crates/ide_completion/src/context.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ pub(crate) struct CompletionContext<'a> {
107107

108108
pub(super) pattern_ctx: Option<PatternContext>,
109109
pub(super) path_context: Option<PathCompletionContext>,
110-
pub(super) active_parameter: Option<ActiveParameter>,
111110
pub(super) locals: Vec<(String, Local)>,
112111

113112
pub(super) incomplete_let: bool,
@@ -170,7 +169,6 @@ impl<'a> CompletionContext<'a> {
170169
attribute_under_caret: None,
171170
previous_token: None,
172171
path_context: None,
173-
active_parameter: ActiveParameter::at(db, position),
174172
locals,
175173
incomplete_let: false,
176174
no_completion_required: false,

crates/ide_completion/src/render/enum_variant.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub(crate) fn render_variant(
2626
#[derive(Debug)]
2727
struct EnumRender<'a> {
2828
ctx: RenderContext<'a>,
29-
name: hir::Name,
3029
variant: hir::Variant,
3130
path: Option<hir::ModPath>,
3231
qualified_name: hir::ModPath,
@@ -58,7 +57,7 @@ impl<'a> EnumRender<'a> {
5857
),
5958
};
6059

61-
EnumRender { ctx, name, variant, path, qualified_name, short_qualified_name, variant_kind }
60+
EnumRender { ctx, variant, path, qualified_name, short_qualified_name, variant_kind }
6261
}
6362
fn render(self, import_to_add: Option<ImportEdit>) -> CompletionItem {
6463
let mut item = CompletionItem::new(

crates/ide_db/src/call_info.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,6 @@ pub struct ActiveParameter {
154154
}
155155

156156
impl ActiveParameter {
157-
pub fn at(db: &RootDatabase, position: FilePosition) -> Option<Self> {
158-
let sema = Semantics::new(db);
159-
let file = sema.parse(position.file_id);
160-
let file = file.syntax();
161-
let token = file.token_at_offset(position.offset).next()?;
162-
let token = sema.descend_into_macros(token);
163-
Self::at_token(&sema, token)
164-
}
165-
166157
pub fn at_token(sema: &Semantics<RootDatabase>, token: SyntaxToken) -> Option<Self> {
167158
let (signature, active_parameter) = call_info_impl(sema, token)?;
168159

crates/ide_ssr/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ pub struct SsrRule {
103103

104104
#[derive(Debug)]
105105
pub struct SsrPattern {
106-
raw: parsing::RawPattern,
107106
parsed_rules: Vec<parsing::ParsedRule>,
108107
}
109108

crates/ide_ssr/src/matching.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ pub struct Match {
6161
/// Information about a placeholder bound in a match.
6262
#[derive(Debug)]
6363
pub(crate) struct PlaceholderMatch {
64-
/// The node that the placeholder matched to. If set, then we'll search for further matches
65-
/// within this node. It isn't set when we match tokens within a macro call's token tree.
66-
pub(crate) node: Option<SyntaxNode>,
6764
pub(crate) range: FileRange,
6865
/// More matches, found within `node`.
6966
pub(crate) inner_matches: SsrMatches,
@@ -186,7 +183,7 @@ impl<'db, 'sema> Matcher<'db, 'sema> {
186183
self.validate_range(&original_range)?;
187184
matches_out.placeholder_values.insert(
188185
placeholder.ident.clone(),
189-
PlaceholderMatch::new(Some(code), original_range),
186+
PlaceholderMatch::from_range(original_range),
190187
);
191188
}
192189
return Ok(());
@@ -715,19 +712,14 @@ fn recording_match_fail_reasons() -> bool {
715712
}
716713

717714
impl PlaceholderMatch {
718-
fn new(node: Option<&SyntaxNode>, range: FileRange) -> Self {
715+
fn from_range(range: FileRange) -> Self {
719716
Self {
720-
node: node.cloned(),
721717
range,
722718
inner_matches: SsrMatches::default(),
723719
autoderef_count: 0,
724720
autoref_kind: ast::SelfParamKind::Owned,
725721
}
726722
}
727-
728-
fn from_range(range: FileRange) -> Self {
729-
Self::new(None, range)
730-
}
731723
}
732724

733725
impl NodeKind {
@@ -788,7 +780,6 @@ impl PatternIterator {
788780

789781
#[cfg(test)]
790782
mod tests {
791-
use super::*;
792783
use crate::{MatchFinder, SsrRule};
793784

794785
#[test]
@@ -803,14 +794,6 @@ mod tests {
803794
assert_eq!(matches.matches.len(), 1);
804795
assert_eq!(matches.matches[0].matched_node.text(), "foo(1+2)");
805796
assert_eq!(matches.matches[0].placeholder_values.len(), 1);
806-
assert_eq!(
807-
matches.matches[0].placeholder_values[&Var("x".to_string())]
808-
.node
809-
.as_ref()
810-
.unwrap()
811-
.text(),
812-
"1+2"
813-
);
814797

815798
let edits = match_finder.edits();
816799
assert_eq!(edits.len(), 1);

crates/ide_ssr/src/parsing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl FromStr for SsrPattern {
204204
fn from_str(pattern_str: &str) -> Result<SsrPattern, SsrError> {
205205
let raw_pattern = pattern_str.parse()?;
206206
let parsed_rules = ParsedRule::new(&raw_pattern, None)?;
207-
Ok(SsrPattern { raw: raw_pattern, parsed_rules })
207+
Ok(SsrPattern { parsed_rules })
208208
}
209209
}
210210

crates/proc_macro_api/src/process.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::{
1616

1717
#[derive(Debug)]
1818
pub(crate) struct ProcMacroProcessSrv {
19-
process: Process,
19+
_process: Process,
2020
stdin: ChildStdin,
2121
stdout: BufReader<ChildStdout>,
2222
}
@@ -29,7 +29,7 @@ impl ProcMacroProcessSrv {
2929
let mut process = Process::run(process_path, args)?;
3030
let (stdin, stdout) = process.stdio().expect("couldn't access child stdio");
3131

32-
let srv = ProcMacroProcessSrv { process, stdin, stdout };
32+
let srv = ProcMacroProcessSrv { _process: process, stdin, stdout };
3333

3434
Ok(srv)
3535
}

crates/vfs-notify/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use walkdir::WalkDir;
1818
pub struct NotifyHandle {
1919
// Relative order of fields below is significant.
2020
sender: Sender<Message>,
21-
thread: jod_thread::JoinHandle,
21+
_thread: jod_thread::JoinHandle,
2222
}
2323

2424
#[derive(Debug)]
@@ -35,7 +35,7 @@ impl loader::Handle for NotifyHandle {
3535
.name("VfsLoader".to_owned())
3636
.spawn(move || actor.run(receiver))
3737
.expect("failed to spawn thread");
38-
NotifyHandle { sender, thread }
38+
NotifyHandle { sender, _thread: thread }
3939
}
4040
fn set_config(&mut self, config: loader::Config) {
4141
self.sender.send(Message::Config(config)).unwrap()

0 commit comments

Comments
 (0)