Skip to content
This repository was archived by the owner on May 4, 2024. It is now read-only.

Commit b904aa5

Browse files
committed
fix the typos
1 parent ea70797 commit b904aa5

File tree

29 files changed

+64
-64
lines changed

29 files changed

+64
-64
lines changed

language/move-binary-format/src/check_bounds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl<'a> BoundsChecker<'a> {
202202
check_bounds_impl(self.view.identifiers(), function_handle.name)?;
203203
check_bounds_impl(self.view.signatures(), function_handle.parameters)?;
204204
check_bounds_impl(self.view.signatures(), function_handle.return_)?;
205-
// function signature type paramters must be in bounds to the function type parameters
205+
// function signature type parameters must be in bounds to the function type parameters
206206
let type_param_count = function_handle.type_parameters.len();
207207
if let Some(sig) = self
208208
.view

language/move-model/src/builder/module_builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl<'env, 'translator> ModuleBuilder<'env, 'translator> {
216216

217217
/// Creates a SpecBlockContext from the given SpecBlockTarget. The context is used during
218218
/// definition analysis when visiting a schema block member (condition, invariant, etc.).
219-
/// This returns None if the SpecBlockTarget cannnot be resolved; error reporting happens
219+
/// This returns None if the SpecBlockTarget cannot be resolved; error reporting happens
220220
/// at caller side.
221221
fn get_spec_block_context<'pa>(
222222
&self,
@@ -2925,7 +2925,7 @@ impl<'env, 'translator> ModuleBuilder<'env, 'translator> {
29252925
} else {
29262926
// This is calling a function from the module we are currently translating.
29272927
// Need to recursively ensure we have computed used_spec_vars because of
2928-
// arbitrary call graphs, including cyclic. If visted_opt is not set,
2928+
// arbitrary call graphs, including cyclic. If visited_opt is not set,
29292929
// we know we already computed this.
29302930
if let Some(visited) = &mut visited_opt {
29312931
self.compute_state_usage_and_callees_for_fun(visited, fid.as_usize());

language/move-model/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub fn run_model_builder<
7979
}
8080

8181
/// Build the move model with default compilation flags and custom options and a set of provided
82-
/// named addreses.
82+
/// named addresses.
8383
/// This collects transitive dependencies for move sources from the provided directory list.
8484
pub fn run_model_builder_with_options<
8585
Paths: Into<MoveSymbol> + Clone,
@@ -386,7 +386,7 @@ fn script_into_module(compiled_script: CompiledScript) -> CompiledModule {
386386
}
387387
};
388388

389-
// Add a dummy adress if none exists.
389+
// Add a dummy address if none exists.
390390
let dummy_addr = AccountAddress::new([0xff; AccountAddress::LENGTH]);
391391
let dummy_addr_idx = match script
392392
.address_identifiers

language/move-model/src/model.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ pub struct GlobalEnv {
514514
pub intrinsics: IntrinsicsAnnotation,
515515
/// A type-indexed container for storing extension data in the environment.
516516
extensions: RefCell<BTreeMap<TypeId, Box<dyn Any>>>,
517-
/// The address of the standard and extension libaries.
517+
/// The address of the standard and extension libraries.
518518
stdlib_address: Option<BigUint>,
519519
extlib_address: Option<BigUint>,
520520
}
@@ -2285,12 +2285,12 @@ impl<'env> ModuleEnv<'env> {
22852285
}
22862286

22872287
/// Converts a constant to the specified type. The type must correspond to the expected
2288-
/// cannonical representation as defined in `move_core_types::values`
2288+
/// canonical representation as defined in `move_core_types::values`
22892289
pub fn get_constant_value(&self, constant: &VMConstant) -> MoveValue {
22902290
VMConstant::deserialize_constant(constant).unwrap()
22912291
}
22922292

2293-
/// Return the `AccountAdress` of this module
2293+
/// Return the `AccountAddress` of this module
22942294
pub fn self_address(&self) -> &AccountAddress {
22952295
self.data.module.address()
22962296
}
@@ -3272,7 +3272,7 @@ impl<'env> FunctionEnv<'env> {
32723272
self.definition_view().visibility()
32733273
}
32743274

3275-
/// Return true if the function is an entry fucntion
3275+
/// Return true if the function is an entry function
32763276
pub fn is_entry(&self) -> bool {
32773277
self.definition_view().is_entry()
32783278
}
@@ -3308,7 +3308,7 @@ impl<'env> FunctionEnv<'env> {
33083308

33093309
/// Returns true if the function is a script function
33103310
pub fn is_script(&self) -> bool {
3311-
// The main function of a scipt is a script function
3311+
// The main function of a script is a script function
33123312
self.module_env.is_script_module() || self.definition_view().is_entry()
33133313
}
33143314

language/move-model/src/simplifier/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mod pass_inline;
1919
pub use pass::SpecRewriter;
2020
use pass_inline::SpecPassInline;
2121

22-
/// Available simplifications passes to run after tbe model is built
22+
/// Available simplifications passes to run after the model is built
2323
#[derive(Clone, Debug, Serialize, Deserialize)]
2424
pub enum SimplificationPass {
2525
Inline,

language/move-prover/boogie-backend/src/boogie_wrapper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ impl ModelValue {
15181518
let struct_name = &boogie_struct_name(struct_env, inst);
15191519
let values = self
15201520
.extract_list(struct_name)
1521-
// It appears sometimes keys are represented witout, sometimes with enclosing
1521+
// It appears sometimes keys are represented without, sometimes with enclosing
15221522
// bars?
15231523
.or_else(|| self.extract_list(&format!("|{}|", struct_name)))?;
15241524
struct_env

language/move-prover/boogie-backend/src/bytecode_translator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ impl<'env> FunctionTranslator<'env> {
11931193
.iter()
11941194
.cloned()
11951195
.map(str_local)
1196-
// Add implict dest returns for &mut srcs:
1196+
// Add implicit dest returns for &mut srcs:
11971197
// f(x) --> x := f(x) if type(x) = &mut_
11981198
.chain(
11991199
srcs.iter()

language/move-prover/bytecode/src/access_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ impl AbsStructType {
770770
self.get_type().into_struct_tag(env)
771771
}
772772

773-
/// Substitue the open types in self.types with caller `type_actuals`
773+
/// Substitute the open types in self.types with caller `type_actuals`
774774
pub fn substitute_footprint(&mut self, type_actuals: &[Type]) {
775775
for t in self.types.iter_mut() {
776776
*t = t.instantiate(type_actuals)

language/move-prover/bytecode/src/dataflow_domains.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ impl<K: Ord + Clone, V: AbstractDomain + Clone + PartialEq> MapDomain<K, V> {
268268
/// but this is not available in OrdMap for obvious reasons (because entries are shared),
269269
/// so we need to use this pattern here instead.
270270
pub fn update_values(&mut self, mut f: impl FnMut(&mut V)) {
271-
// Commpute the key-values which actually changed. If the change is small, we preserve
271+
// Compute the key-values which actually changed. If the change is small, we preserve
272272
// structure sharing.
273273
let new_values = self
274274
.iter()

language/move-prover/bytecode/src/number_operation_analysis.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl NumberOperationState {
132132
}
133133
}
134134

135-
fn vector_table_funs_name_propogate_to_dest(callee_name: &str) -> bool {
135+
fn vector_table_funs_name_propagate_to_dest(callee_name: &str) -> bool {
136136
callee_name.contains("borrow")
137137
|| callee_name.contains("borrow_mut")
138138
|| callee_name.contains("pop_back")
@@ -142,15 +142,15 @@ fn vector_table_funs_name_propogate_to_dest(callee_name: &str) -> bool {
142142
|| callee_name.contains("spec_get")
143143
}
144144

145-
fn vector_funs_name_propogate_to_srcs(callee_name: &str) -> bool {
145+
fn vector_funs_name_propagate_to_srcs(callee_name: &str) -> bool {
146146
callee_name == "contains"
147147
|| callee_name == "index_of"
148148
|| callee_name == "append"
149149
|| callee_name == "push_back"
150150
|| callee_name == "insert"
151151
}
152152

153-
fn table_funs_name_propogate_to_srcs(callee_name: &str) -> bool {
153+
fn table_funs_name_propagate_to_srcs(callee_name: &str) -> bool {
154154
callee_name == "add" || callee_name == "borrow_mut_with_default" || callee_name == "upsert"
155155
}
156156

@@ -301,7 +301,7 @@ impl<'a> NumberOperationAnalysis<'a> {
301301
let oper_first =
302302
global_state.get_node_num_oper(args[0].node_id());
303303
// First argument is the target vector and the return type has the same NumberOperation type
304-
if vector_table_funs_name_propogate_to_dest(&callee_name) {
304+
if vector_table_funs_name_propagate_to_dest(&callee_name) {
305305
global_state.update_node_oper(*id, oper_first, true);
306306
} else {
307307
global_state.update_node_oper(*id, Bottom, allow_merge);
@@ -1035,7 +1035,7 @@ impl<'a> TransferFunctions for NumberOperationAnalysis<'a> {
10351035
.get_temp_index_oper(cur_mid, cur_fid, srcs[0], baseline_flag)
10361036
.unwrap();
10371037
// Bitwise is specified explicitly in the fun or struct spec
1038-
if vector_table_funs_name_propogate_to_dest(&callee_name) {
1038+
if vector_table_funs_name_propagate_to_dest(&callee_name) {
10391039
if *first_oper == Bitwise {
10401040
// Do not consider the method remove_return_key where the first return value is k
10411041
for dest in dests.iter() {
@@ -1050,7 +1050,7 @@ impl<'a> TransferFunctions for NumberOperationAnalysis<'a> {
10501050
let mut second_oper = first_oper;
10511051
let mut src_idx = 0;
10521052
if module_env.is_std_vector()
1053-
&& vector_funs_name_propogate_to_srcs(&callee_name)
1053+
&& vector_funs_name_propagate_to_srcs(&callee_name)
10541054
{
10551055
assert!(srcs.len() > 1);
10561056
second_oper = global_state
@@ -1062,7 +1062,7 @@ impl<'a> TransferFunctions for NumberOperationAnalysis<'a> {
10621062
)
10631063
.unwrap();
10641064
src_idx = 1;
1065-
} else if table_funs_name_propogate_to_srcs(&callee_name) {
1065+
} else if table_funs_name_propagate_to_srcs(&callee_name) {
10661066
assert!(srcs.len() > 2);
10671067
second_oper = global_state
10681068
.get_temp_index_oper(

language/move-prover/bytecode/src/read_write_set_analysis.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,8 @@ impl ReadWriteSetState {
899899
pub fn normalize(&self, env: &GlobalEnv) -> ReadWriteSet {
900900
let mut analysis_result = ReadWriteSet::new();
901901
self.accesses.iter_paths(|access_path, access| {
902-
let access_pathes = access_path.normalize(env);
903-
for concrete_access_path in access_pathes {
902+
let access_paths = access_path.normalize(env);
903+
for concrete_access_path in access_paths {
904904
analysis_result.add_access_path(concrete_access_path, *access);
905905
}
906906
});

language/move-prover/doc/user/docgen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ decorated as follows:
124124
positives, as the generator does not analyze the syntax right now.
125125

126126
- Identifiers are attempted to resolve against the documented code and on success, hyperlinked to the declaration.
127-
For example, within the `DiemAccount` module, all occurences of `T`, `Self::T`, `DiemAccount::T`, and
127+
For example, within the `DiemAccount` module, all occurrences of `T`, `Self::T`, `DiemAccount::T`, and
128128
`0x1::DiemAccount:T` will resolve into a link to the declaration. This resolution is heuristic and may have
129129
positive and negative false positives. Specifically, it currently does not consider aliases and use-declarations.
130130

language/move-prover/interpreter/src/concrete/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ impl EvalState {
13281328
.cloned()
13291329
}
13301330

1331-
/// Populate a global state with the resources saved by the given memmory label
1331+
/// Populate a global state with the resources saved by the given memory label
13321332
pub fn register_memory(&self, label: &MemoryLabel, global_state: &mut GlobalState) {
13331333
for inst_map in self.saved_memory.get(label).unwrap().values() {
13341334
for (inst, account_map) in inst_map {

language/move-stdlib/tests/vector_tests.move

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,9 @@ module std::vector_tests {
425425
assert!(index == 1, 1);
426426
}
427427

428-
// index_of will return the index first occurence that is equal
428+
// index_of will return the index first occurrence that is equal
429429
#[test]
430-
fun index_of_nonempty_has_multiple_occurences() {
430+
fun index_of_nonempty_has_multiple_occurrences() {
431431
let v = V::empty();
432432
V::push_back(&mut v, false);
433433
V::push_back(&mut v, true);

language/move-vm/integration-tests/src/tests/bad_storage_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ fn test_malformed_resource() {
105105
let (changeset, _) = sess.finish().unwrap();
106106
storage.apply(changeset).unwrap();
107107

108-
// Execut the second script and make sure it succeeds. This script simply checks
109-
// that the published resource is what we expect it to be. This inital run is to ensure
108+
// Execute the second script and make sure it succeeds. This script simply checks
109+
// that the published resource is what we expect it to be. This initial run is to ensure
110110
// the testing environment is indeed free of errors without external interference.
111111
let mut script_blob = vec![];
112112
s2.serialize(&mut script_blob).unwrap();

language/move-vm/runtime/src/interpreter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,14 +467,14 @@ impl Interpreter {
467467
} else {
468468
Err(self.set_location(PartialVMError::new(StatusCode::UNKNOWN_INVARIANT_VIOLATION_ERROR)
469469
.with_message(
470-
format!("Private/Friend function invokation error, caller: {:?}::{:?}, callee: {:?}::{:?}", caller_id, caller.name(), callee_id, callee.name()),
470+
format!("Private/Friend function invocation error, caller: {:?}::{:?}, callee: {:?}::{:?}", caller_id, caller.name(), callee_id, callee.name()),
471471
)))
472472
}
473473
}
474474
_ => Err(self.set_location(
475475
PartialVMError::new(StatusCode::UNKNOWN_INVARIANT_VIOLATION_ERROR)
476476
.with_message(format!(
477-
"Private/Friend function invokation error caller: {:?}, callee {:?}",
477+
"Private/Friend function invocation error caller: {:?}, callee {:?}",
478478
caller.name(),
479479
callee.name()
480480
)),

language/move-vm/runtime/src/loader.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,15 +2525,15 @@ struct FunctionInstantiation {
25252525
struct StructDef {
25262526
// struct field count
25272527
field_count: u16,
2528-
// `ModuelCache::structs` global table index
2528+
// `ModuleCache::structs` global table index
25292529
idx: CachedStructIndex,
25302530
}
25312531

25322532
#[derive(Debug)]
25332533
struct StructInstantiation {
25342534
// struct field count
25352535
field_count: u16,
2536-
// `ModuelCache::structs` global table index. It is the generic type.
2536+
// `ModuleCache::structs` global table index. It is the generic type.
25372537
def: CachedStructIndex,
25382538
instantiation: Vec<Type>,
25392539
}
@@ -2542,15 +2542,15 @@ struct StructInstantiation {
25422542
#[derive(Debug)]
25432543
struct FieldHandle {
25442544
offset: usize,
2545-
// `ModuelCache::structs` global table index. It is the generic type.
2545+
// `ModuleCache::structs` global table index. It is the generic type.
25462546
owner: CachedStructIndex,
25472547
}
25482548

25492549
// A field instantiation. The offset is the only used information when operating on a field
25502550
#[derive(Debug)]
25512551
struct FieldInstantiation {
25522552
offset: usize,
2553-
// `ModuelCache::structs` global table index. It is the generic type.
2553+
// `ModuleCache::structs` global table index. It is the generic type.
25542554
#[allow(unused)]
25552555
owner: CachedStructIndex,
25562556
instantiation: Vec<Type>,

language/move-vm/runtime/src/move_vm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ impl MoveVM {
4343
/// Right now it is the caller's responsibility to ensure cache coherence of the Move VM Loader
4444
/// - When a module gets published in a Move VM Session, and then gets used by another
4545
/// transaction, it will be loaded into the code cache and stay there even if the resulted
46-
/// effects do not get commited back to the storage when the Session ends.
46+
/// effects do not get committed back to the storage when the Session ends.
4747
/// - As a result, if one wants to have multiple sessions at a time, one needs to make sure
4848
/// none of them will try to publish a module. In other words, if there is a module publishing
4949
/// Session it must be the only Session existing.
5050
/// - In general, a new Move VM needs to be created whenever the storage gets modified by an
51-
/// outer envrionment, or otherwise the states may be out of sync. There are a few exceptional
51+
/// outer environment, or otherwise the states may be out of sync. There are a few exceptional
5252
/// cases where this may not be necessary, with the most notable one being the common module
5353
/// publishing flow: you can keep using the same Move VM if you publish some modules in a Session
5454
/// and apply the effects to the storage when the Session ends.

language/move-vm/runtime/src/unit_tests/vm_arguments_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ fn call_missing_item() {
800800
let module = empty_module();
801801
let id = &module.self_id();
802802
let function_name = IdentStr::new("foo").unwrap();
803-
// mising module
803+
// missing module
804804
let move_vm = MoveVM::new(vec![]).unwrap();
805805
let mut remote_view = RemoteStore::new();
806806
let mut session = move_vm.new_session(&remote_view);

language/move-vm/types/src/natives/function.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! ) -> PartialVMResult<NativeResult>;`
1414
//!
1515
//! arguments are passed with first argument at position 0 and so forth.
16-
//! Popping values from `arguments` gives the aguments in reverse order (last first).
16+
//! Popping values from `arguments` gives the arguments in reverse order (last first).
1717
//! This module contains the declarations and utilities to implement a native
1818
//! function.
1919
@@ -57,7 +57,7 @@ impl NativeResult {
5757

5858
/// Failed execution. The failure is a runtime failure in the function and not an invariant
5959
/// failure of the VM which would raise a `PartialVMError` error directly.
60-
/// The only thing the funciton can specify is its abort code, as if it had invoked the `Abort`
60+
/// The only thing the function can specify is its abort code, as if it had invoked the `Abort`
6161
/// bytecode instruction
6262
pub fn err(cost: InternalGas, abort_code: u64) -> Self {
6363
NativeResult::Abort { cost, abort_code }

language/move-vm/types/src/values/values_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3225,7 +3225,7 @@ impl Value {
32253225
* Destructors
32263226
*
32273227
**************************************************************************************/
3228-
// Locals may contain reference values that points to the same cotnainer through Rc, hencing forming
3228+
// Locals may contain reference values that points to the same container through Rc, hencing forming
32293229
// a cycle. Therefore values need to be manually taken out of the Locals in order to not leak memory.
32303230
impl Drop for Locals {
32313231
fn drop(&mut self) {
@@ -3243,7 +3243,7 @@ impl Container {
32433243
use Container::*;
32443244

32453245
match self {
3246-
Locals(_) => unreachable!("Should not ba able to visit a Locals container directly"),
3246+
Locals(_) => unreachable!("Should not be able to visit a Locals container directly"),
32473247
Vec(r) => {
32483248
let r = r.borrow();
32493249
if visitor.visit_vec(depth, r.len()) {

language/testing-infra/test-generation/src/abstract_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ impl InstantiableModule {
414414
/// An AbstractState represents an abstract view of the execution of the
415415
/// Move VM. Rather than considering values of items on the stack or in
416416
/// the locals, we only consider their type, represented by a `AbstractValue`
417-
/// and their availibility, represented by the `BorrowState`.
417+
/// and their availability, represented by the `BorrowState`.
418418
#[derive(Debug, Clone)]
419419
pub struct AbstractState {
420420
/// A Vector of `AbstractValue`s representing the VM value stack

0 commit comments

Comments
 (0)