Skip to content

Commit a99dd36

Browse files
committed
review
1 parent 5290542 commit a99dd36

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

compiler/rustc_mir_transform/src/gvn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//! _b = some other value // also has VnIndex i
2828
//! ```
2929
//!
30-
//! We consider it to be replacable by:
30+
//! We consider it to be replaceable by:
3131
//! ```ignore (MIR)
3232
//! _a = some value // has VnIndex i
3333
//! // some MIR

compiler/rustc_mir_transform/src/ref_prop.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ fn compute_replacement<'tcx>(
134134
// reborrowed references.
135135
let mut storage_to_remove = BitSet::new_empty(body.local_decls.len());
136136

137-
let fully_replacable_locals = fully_replacable_locals(ssa);
137+
let fully_replaceable_locals = fully_replaceable_locals(ssa);
138138

139139
// Returns true iff we can use `place` as a pointee.
140140
//
@@ -200,7 +200,7 @@ fn compute_replacement<'tcx>(
200200
let needs_unique = ty.is_mutable_ptr();
201201

202202
// If this a mutable reference that we cannot fully replace, mark it as unknown.
203-
if needs_unique && !fully_replacable_locals.contains(local) {
203+
if needs_unique && !fully_replaceable_locals.contains(local) {
204204
debug!("not fully replaceable");
205205
continue;
206206
}
@@ -299,7 +299,7 @@ fn compute_replacement<'tcx>(
299299

300300
// This a reborrow chain, recursively allow the replacement.
301301
//
302-
// This also allows to detect cases where `target.local` is not replacable,
302+
// This also allows to detect cases where `target.local` is not replaceable,
303303
// and mark it as such.
304304
if let &[PlaceElem::Deref] = &target.projection[..] {
305305
assert!(perform_opt);
@@ -309,7 +309,7 @@ fn compute_replacement<'tcx>(
309309
} else if perform_opt {
310310
self.allowed_replacements.insert((target.local, loc));
311311
} else if needs_unique {
312-
// This mutable reference is not fully replacable, so drop it.
312+
// This mutable reference is not fully replaceable, so drop it.
313313
self.targets[place.local] = Value::Unknown;
314314
}
315315
}
@@ -322,22 +322,22 @@ fn compute_replacement<'tcx>(
322322

323323
/// Compute the set of locals that can be fully replaced.
324324
///
325-
/// We consider a local to be replacable iff it's only used in a `Deref` projection `*_local` or
325+
/// We consider a local to be replaceable iff it's only used in a `Deref` projection `*_local` or
326326
/// non-use position (like storage statements and debuginfo).
327-
fn fully_replacable_locals(ssa: &SsaLocals) -> BitSet<Local> {
328-
let mut replacable = BitSet::new_empty(ssa.num_locals());
327+
fn fully_replaceable_locals(ssa: &SsaLocals) -> BitSet<Local> {
328+
let mut replaceable = BitSet::new_empty(ssa.num_locals());
329329

330330
// First pass: for each local, whether its uses can be fully replaced.
331331
for local in ssa.locals() {
332332
if ssa.num_direct_uses(local) == 0 {
333-
replacable.insert(local);
333+
replaceable.insert(local);
334334
}
335335
}
336336

337337
// Second pass: a local can only be fully replaced if all its copies can.
338-
ssa.meet_copy_equivalence(&mut replacable);
338+
ssa.meet_copy_equivalence(&mut replaceable);
339339

340-
replacable
340+
replaceable
341341
}
342342

343343
/// Utility to help performing substitution of `*pattern` by `target`.

compiler/rustc_pattern_analysis/src/usefulness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
//! [`Constructor::is_covered_by`].
103103
//!
104104
//! Note 1: variable bindings (like the `x` in `Some(x)`) match anything, so we treat them as wildcards.
105-
//! Note 2: this only applies to matchable values. For example a value of type `Rc<u64>` can't be
105+
//! Note 2: this only applies to matcheable values. For example a value of type `Rc<u64>` can't be
106106
//! deconstructed that way.
107107
//!
108108
//!

typos.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
[files]
22
extend-exclude = [
3-
# ./compiler excludes
3+
# exclude git (sub)modules and generated content
44
"compiler/rustc_codegen_gcc",
55
"compiler/rustc_codegen_cranelift",
66
"compiler/rustc_baked_icu_data",
77
]
88

99
[default.extend-words]
10+
# add exclusions here, lines should be like `x = 'x'`,
11+
# where `x` is excuded word.
12+
#
13+
# Also see docs: https://github.com/crate-ci/typos/blob/v1.28.2/docs/reference.md
1014
thir = "thir"
1115
padd = "padd"
1216
rplace = "rplace"
@@ -24,7 +28,6 @@ parm = "parm"
2428
EXCED = "EXCED"
2529
Shortern = "Shortern"
2630
unparseable = "unparseable"
27-
replacable = "replacable"
2831
matcheable = "matcheable"
2932

3033
[default]

0 commit comments

Comments
 (0)