Skip to content

Commit

Permalink
Fix more typos
Browse files Browse the repository at this point in the history
  • Loading branch information
sanxiyn committed Aug 9, 2022
1 parent a4d8603 commit 1c57e0b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lang/step.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ It also ensures that the pointer is dereferenceable.

```rust
impl Machine {
fn eval_place(&mut self, expr @ Deref { operand, .. }: PlaceExpr) -> NdResult<Place> {
fn eval_place(&mut self, Deref { operand, .. }: PlaceExpr) -> NdResult<Place> {
let Value::Ptr(p) = self.eval_value(operand)? else {
panic!("dereferencing a non-pointer")
};
Expand Down
2 changes: 1 addition & 1 deletion lang/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ enum Terminator {
Call {
callee: FnName,
/// The arguments to pass, and which ABIs to use for that.
arguments: List<(ValueExpr, ArgABi)>,
arguments: List<(ValueExpr, ArgAbi)>,
/// The place to put the return value into, and which ABI to use for that.
ret: (PlaceExpr, ArgAbi),
/// The block to jump to when this call returns.
Expand Down
2 changes: 1 addition & 1 deletion lang/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Note that MiniRust types play a somewhat different role than Rust types:
every Rust type corresponds to a MiniRust type, but MiniRust types are merely annotated at various operations to define how [values](values.md) are represented in memory.
Basically, they only define a (de)serialization format -- the **representation relation**, define by an "encode" function to turn values into byte lists, and a "decode" function for the opposite operation.
In particular, MiniRust is by design *not type-safe*.
However, the representation relation is a key part of the language, since it forms the interface between the low-level and high-level view of data, between lists if (abstract) bytes and [values](values.md).
However, the representation relation is a key part of the language, since it forms the interface between the low-level and high-level view of data, between lists of (abstract) bytes and [values](values.md).
For pointer types (references and raw pointers), we types also contain a "mutability", which does not affect the representation relation but can be relevant for the aliasing rules.
(We might want to organize this differently in the future, and remove mutability from types.)

Expand Down
4 changes: 2 additions & 2 deletions lang/well-formed.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl Statement {
locals
}
StorageDead(local) => {
if func.ret.0 == local || func.args.iter().any(|(arg_name, _abi) arg_name == local) {
if func.ret.0 == local || func.args.iter().any(|(arg_name, _abi)| arg_name == local) {
// Trying to mark an argument or the return local as dead.
throw!();
}
Expand Down Expand Up @@ -353,7 +353,7 @@ impl Function {
impl Program {
fn check(self) -> Option<()> {
// Ensure the start function exists, and takes no arguments.
let func = self.functions.get(start)?;
let func = self.functions.get(self.start)?;
if func.args.len() > 0 { return None; }
// Check all the functions.
for function in self.functions.values() {
Expand Down

0 comments on commit 1c57e0b

Please sign in to comment.