From 33768696057288afdcd2da2a1c4f06053de31596 Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Sun, 30 Jan 2022 12:15:48 -0800 Subject: [PATCH] Format comments (#711) --- cmd/pen/src/package_builder.rs | 4 ++-- .../src/analysis/reference_count/conversion.rs | 15 ++++++++------- lib/mir/src/ir/let_recursive.rs | 6 +++--- lib/os-sync/ffi/library/src/open_file_options.rs | 3 ++- lib/os/ffi/application/src/main.rs | 3 ++- lib/os/ffi/library/src/open_file_options.rs | 3 ++- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/cmd/pen/src/package_builder.rs b/cmd/pen/src/package_builder.rs index 76223ed727..33875aee93 100644 --- a/cmd/pen/src/package_builder.rs +++ b/cmd/pen/src/package_builder.rs @@ -15,8 +15,8 @@ pub fn build(target_triple: Option<&str>, verbose: bool) -> Result<(), Box Result { - // Backend is expected to clone a function itself and its free variables at the very beginning - // of the function. + // Backend is expected to clone a function itself and its free variables at the + // very beginning of the function. let owned_variables = if global { None } else { @@ -59,13 +59,14 @@ fn convert_definition( )) } -// Here, we convert expressions tracking moved variables and cloning variables moved already. -// The basic rules are listed below. +// Here, we convert expressions tracking moved variables and cloning variables +// moved already. The basic rules are listed below. // // - The returned values of functions are moved. -// - Every input of expressions is moved including conditions of if expressions and records of record -// field operations. -// - Newly bound variables in let expressions are dropped if they are not moved in their expressions. +// - Every input of expressions is moved including conditions of if expressions +// and records of record field operations. +// - Newly bound variables in let expressions are dropped if they are not moved +// in their expressions. fn convert_expression( expression: &Expression, owned_variables: &FnvHashMap, diff --git a/lib/mir/src/ir/let_recursive.rs b/lib/mir/src/ir/let_recursive.rs index 915d82b41e..5236673420 100644 --- a/lib/mir/src/ir/let_recursive.rs +++ b/lib/mir/src/ir/let_recursive.rs @@ -12,9 +12,9 @@ use std::sync::Arc; // function calls. // - This requirement can be potentially removed by dropping every functions // used in function calls inside the functions themselves. -// - This is safe because only global function definitions can be -// recursive. -// - This recursion is necessary to compile "anonymous" loops in HIR effectively. +// - This is safe because only global function definitions can be recursive. +// - This recursion is necessary to compile "anonymous" loops in HIR +// effectively. // - e.g. list comprehension #[derive(Clone, Debug, PartialEq)] pub struct LetRecursive { diff --git a/lib/os-sync/ffi/library/src/open_file_options.rs b/lib/os-sync/ffi/library/src/open_file_options.rs index 64a77f3bb1..ab95408209 100644 --- a/lib/os-sync/ffi/library/src/open_file_options.rs +++ b/lib/os-sync/ffi/library/src/open_file_options.rs @@ -15,7 +15,8 @@ impl From for OpenOptions { fn from(options: OpenFileOptions) -> Self { let mut open_options = Self::new(); - // Set the create option after the create_new option because the latter is prioritized. + // Set the create option after the create_new option because the latter is + // prioritized. open_options .append(options.append) .create_new(options.create_new) diff --git a/lib/os/ffi/application/src/main.rs b/lib/os/ffi/application/src/main.rs index 4b5d6e4f1b..8724e12ba3 100644 --- a/lib/os/ffi/application/src/main.rs +++ b/lib/os/ffi/application/src/main.rs @@ -23,7 +23,8 @@ unsafe extern "C" fn _pen_os_main(_: &mut Stack, _: ContinuationFunction) -> ffi } fn main() { - // HACK Is it OK to call the _pen_os_main function with an extra argument of a closure environment? + // HACK Is it OK to call the _pen_os_main function with an extra argument of a + // closure environment? let code: ffi::Number = Runtime::new() .unwrap() diff --git a/lib/os/ffi/library/src/open_file_options.rs b/lib/os/ffi/library/src/open_file_options.rs index 9dbfd6b5e7..2887f69302 100644 --- a/lib/os/ffi/library/src/open_file_options.rs +++ b/lib/os/ffi/library/src/open_file_options.rs @@ -15,7 +15,8 @@ impl From for OpenOptions { fn from(options: OpenFileOptions) -> Self { let mut open_options = Self::new(); - // Set the create option after the create_new option because the latter is prioritized. + // Set the create option after the create_new option because the latter is + // prioritized. open_options .append(options.append) .create_new(options.create_new)