From a35c659036eb1d33530b7e3933c2038aaf232e18 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Fri, 20 Dec 2024 15:00:13 +0800 Subject: [PATCH] fix typos --- c2rust-analyze/src/context.rs | 2 +- c2rust-refactor/src/analysis/ownership/constraint.rs | 2 +- c2rust-refactor/tests/misc/analysis_type_eq.rs | 10 +++++----- c2rust-transpile/src/c_ast/mod.rs | 2 +- c2rust-transpile/src/translator/assembly.rs | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/c2rust-analyze/src/context.rs b/c2rust-analyze/src/context.rs index 0857831dd7..200373bd95 100644 --- a/c2rust-analyze/src/context.rs +++ b/c2rust-analyze/src/context.rs @@ -1118,7 +1118,7 @@ impl<'a, 'tcx> AnalysisCtxt<'a, 'tcx> { /// - let r1 = std::ptr::addr_of!(x.field); /// - let r2 = &x.field; /// - let r3 = &(*p).field; - /// The following will NOT satisfy that critera: + /// The following will NOT satisfy that criteria: /// - let r1 = x.field; /// - let r2 = x.field + y; pub fn has_field_projection(&self, rv: &Rvalue<'tcx>) -> bool { diff --git a/c2rust-refactor/src/analysis/ownership/constraint.rs b/c2rust-refactor/src/analysis/ownership/constraint.rs index ecb0847f7b..61126dfda0 100644 --- a/c2rust-refactor/src/analysis/ownership/constraint.rs +++ b/c2rust-refactor/src/analysis/ownership/constraint.rs @@ -618,7 +618,7 @@ impl<'lty, 'tcx> ConstraintSet<'lty> { for (i, &pi) in ps.iter().enumerate() { // This check handles cycles. Suppose `a <= b <= c <= a` and `d <= e`. We'd // like to replace `min(a, b, c, d, e)` with `min(a, d)`. Without this check, - // we would end up with `min()`, becuase `a` eliminates `b` and `c`, `b` and + // we would end up with `min()`, because `a` eliminates `b` and `c`, `b` and // `c` eliminate `a`, and `d` and `e` remove each other. This check doesn't // cause us to miss any valid removals because if `a <= b` and `b <= x` then // also `a <= x`. diff --git a/c2rust-refactor/tests/misc/analysis_type_eq.rs b/c2rust-refactor/tests/misc/analysis_type_eq.rs index 1d6e9aaf30..16e016740b 100644 --- a/c2rust-refactor/tests/misc/analysis_type_eq.rs +++ b/c2rust-refactor/tests/misc/analysis_type_eq.rs @@ -75,20 +75,20 @@ fn do_printf() { } } -struct Clonable1 { +struct Cloneable1 { x: i32, y: i32, } -impl Clonable1 { +impl Cloneable1 { fn get_x(&self) -> i32 { self.x } } -impl Clone for Clonable1 { +impl Clone for Cloneable1 { fn clone(&self) -> Self { - Clonable1 { + Cloneable1 { x: self.x, y: self.y, } @@ -96,7 +96,7 @@ impl Clone for Clonable1 { } #[derive(Clone)] -struct Clonable2 { +struct Cloneable2 { x: i32, y: i32, } diff --git a/c2rust-transpile/src/c_ast/mod.rs b/c2rust-transpile/src/c_ast/mod.rs index 9a7a1f6c1b..b9ef673add 100644 --- a/c2rust-transpile/src/c_ast/mod.rs +++ b/c2rust-transpile/src/c_ast/mod.rs @@ -1682,7 +1682,7 @@ pub enum CTypeKind { Half, BFloat16, - // ARM Scalable Vector Extention types + // ARM Scalable Vector Extension types // TODO: represent all the individual types in AArch64SVEACLETypes.def UnhandledSveType, } diff --git a/c2rust-transpile/src/translator/assembly.rs b/c2rust-transpile/src/translator/assembly.rs index 7d4654c9ac..f9414cea52 100644 --- a/c2rust-transpile/src/translator/assembly.rs +++ b/c2rust-transpile/src/translator/assembly.rs @@ -752,7 +752,7 @@ impl<'c> Translation<'c> { // Extract expression let in_expr = in_expr.map(|(i, operand)| (i, operand.expression)); - // For inouts, change the dirspec to include 'in' + // For inputs, change the dirspec to include 'in' if in_expr.is_some() { dir_spec = dir_spec.with_in(); }