about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/lexer/diagnostics.rs
diff options
context:
space:
mode:
authorDaniPopes <57450786+DaniPopes@users.noreply.github.com>2023-04-10 22:02:52 +0200
committerDaniPopes <57450786+DaniPopes@users.noreply.github.com>2023-04-10 22:02:52 +0200
commit677357d32bd402ff1096803cb00b52124204af08 (patch)
treea0fba8dabec8265b98ad441f96d09c4603883a77 /compiler/rustc_parse/src/lexer/diagnostics.rs
parenta73288371e3fa0a610fbc11e7e8418017bdfde42 (diff)
downloadrust-677357d32bd402ff1096803cb00b52124204af08.tar.gz
rust-677357d32bd402ff1096803cb00b52124204af08.zip
Fix typos in compiler
Diffstat (limited to 'compiler/rustc_parse/src/lexer/diagnostics.rs')
-rw-r--r--compiler/rustc_parse/src/lexer/diagnostics.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/lexer/diagnostics.rs b/compiler/rustc_parse/src/lexer/diagnostics.rs
index c4b9fdc81c5..9e6d27bf036 100644
--- a/compiler/rustc_parse/src/lexer/diagnostics.rs
+++ b/compiler/rustc_parse/src/lexer/diagnostics.rs
@@ -21,7 +21,7 @@ pub struct TokenTreeDiagInfo {
     pub matching_block_spans: Vec<(Span, Span)>,
 }
 
-pub fn same_identation_level(sm: &SourceMap, open_sp: Span, close_sp: Span) -> bool {
+pub fn same_indentation_level(sm: &SourceMap, open_sp: Span, close_sp: Span) -> bool {
     match (sm.span_to_margin(open_sp), sm.span_to_margin(close_sp)) {
         (Some(open_padding), Some(close_padding)) => open_padding == close_padding,
         _ => false,
@@ -67,13 +67,13 @@ pub fn report_suspicious_mismatch_block(
     let mut matched_spans: Vec<(Span, bool)> = diag_info
         .matching_block_spans
         .iter()
-        .map(|&(open, close)| (open.with_hi(close.lo()), same_identation_level(sm, open, close)))
+        .map(|&(open, close)| (open.with_hi(close.lo()), same_indentation_level(sm, open, close)))
         .collect();
 
     // sort by `lo`, so the large block spans in the front
     matched_spans.sort_by_key(|(span, _)| span.lo());
 
-    // We use larger block whose identation is well to cover those inner mismatched blocks
+    // We use larger block whose indentation is well to cover those inner mismatched blocks
     // O(N^2) here, but we are on error reporting path, so it is fine
     for i in 0..matched_spans.len() {
         let (block_span, same_ident) = matched_spans[i];