Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Feb 22, 2025
1 parent 16d728d commit 5329852
Show file tree
Hide file tree
Showing 142 changed files with 1,218 additions and 1,009 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exclude = ["benchmark", "cmd/test", "examples", "packages", "test", "tmp"]
resolver = "2"

[workspace.package]
edition = "2021"
edition = "2024"

[profile.release]
lto = true
2 changes: 1 addition & 1 deletion cmd/pen/src/module_formatter.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{
error::Error,
io::{stdin, stdout, Read, Write},
io::{Read, Write, stdin, stdout},
};

const STDIN_PATH: &str = "<stdin>";
Expand Down
2 changes: 1 addition & 1 deletion cmd/pen/src/package_documentation_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{
use app::package_documentation_generator::DocumentationPackage;
use std::{
error::Error,
io::{stdout, Write},
io::{Write, stdout},
rc::Rc,
};

Expand Down
6 changes: 3 additions & 3 deletions lib/app/src/common/file_path_resolver.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use super::package_id_calculator;
use crate::{
ApplicationConfiguration,
common::module_id_calculator,
infra::{
FilePath, FilePathConfiguration, ARCHIVE_DIRECTORY, BUILD_SCRIPT_DIRECTORY,
EXTERNAL_PACKAGE_DIRECTORY, OBJECT_DIRECTORY, TEST_DIRECTORY,
ARCHIVE_DIRECTORY, BUILD_SCRIPT_DIRECTORY, EXTERNAL_PACKAGE_DIRECTORY, FilePath,
FilePathConfiguration, OBJECT_DIRECTORY, TEST_DIRECTORY,
},
ApplicationConfiguration,
};

const MAIN_ARCHIVE_BASENAME: &str = "main";
Expand Down
4 changes: 2 additions & 2 deletions lib/app/src/external_package_topological_sorter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{error::ApplicationError, PackageConfiguration};
use petgraph::{algo::toposort, Graph};
use crate::{PackageConfiguration, error::ApplicationError};
use petgraph::{Graph, algo::toposort};
use std::{collections::BTreeMap, error::Error};

pub fn sort(
Expand Down
3 changes: 2 additions & 1 deletion lib/app/src/package_build_script_compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ mod module_target_collector;
mod test_module_target_collector;

use crate::{
ApplicationConfiguration, PackageType,
common::file_path_resolver,
external_package_configuration_reader, external_package_topological_sorter,
infra::{FilePath, Infrastructure, MainModuleTarget},
module_target_source_resolver, package_name_formatter, prelude_interface_file_finder,
system_package_finder, ApplicationConfiguration, PackageType,
system_package_finder,
};
use std::error::Error;

Expand Down
3 changes: 2 additions & 1 deletion lib/app/src/package_builder.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use super::application_configuration::ApplicationConfiguration;
use crate::{
PackageType,
common::file_path_resolver,
error::ApplicationError,
infra::{FilePath, Infrastructure},
package_build_script_compiler, PackageType,
package_build_script_compiler,
};
use std::error::Error;

Expand Down
2 changes: 1 addition & 1 deletion lib/app/src/package_creator.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::{
ApplicationConfiguration,
common::file_path_resolver,
infra::{FilePath, Infrastructure},
package_configuration::{PackageConfiguration, PackageType},
ApplicationConfiguration,
};
use std::{collections::BTreeMap, error::Error};

Expand Down
3 changes: 2 additions & 1 deletion lib/app/src/package_test_builder.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use crate::{
ApplicationConfiguration,
common::file_path_resolver,
error::ApplicationError,
infra::{FilePath, Infrastructure},
package_build_script_compiler, ApplicationConfiguration,
package_build_script_compiler,
};
use std::error::Error;

Expand Down
3 changes: 2 additions & 1 deletion lib/app/src/test_runner.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use crate::{
ApplicationConfiguration,
common::file_path_resolver,
error::ApplicationError,
infra::{FilePath, Infrastructure},
package_test_builder, ApplicationConfiguration,
package_test_builder,
};
use std::error::Error;

Expand Down
2 changes: 1 addition & 1 deletion lib/ast-hir/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ mod tests {
test::{FunctionDefinitionFake, ModuleFake, TypeAliasFake, TypeDefinitionFake},
types,
};
use position::{test::PositionFake, Position};
use position::{Position, test::PositionFake};
use pretty_assertions::assert_eq;

fn compile_module(
Expand Down
2 changes: 1 addition & 1 deletion lib/ast-hir/src/imported_module/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn validate(module: &ImportedModule) -> Result<(), CompileError> {
#[cfg(test)]
mod tests {
use super::*;
use position::{test::PositionFake, Position};
use position::{Position, test::PositionFake};

#[test]
fn validate_undefined_name() {
Expand Down
2 changes: 1 addition & 1 deletion lib/ast-hir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn transform_module(module: &ir::Module, prefix: &str) -> Result<ir::Module, Com
mod tests {
use super::*;
use hir::test::ModuleFake;
use position::{test::PositionFake, Position};
use position::{Position, test::PositionFake};

#[test]
fn compile_empty_module() {
Expand Down
2 changes: 1 addition & 1 deletion lib/ast-hir/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ fn compile_if(
mod tests {
use super::*;
use hir::test::ModuleFake;
use position::{test::PositionFake, Position};
use position::{Position, test::PositionFake};
use pretty_assertions::assert_eq;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion lib/ast-hir/src/module_prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub fn compile(import: &ast::Import) -> String {
#[cfg(test)]
mod tests {
use super::*;
use position::{test::PositionFake, Position};
use position::{Position, test::PositionFake};

#[test]
fn calculate_prefix_for_internal_module_import() {
Expand Down
2 changes: 1 addition & 1 deletion lib/ast-hir/src/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub fn compile(number: &Number) -> Result<f64, CompileError> {
#[cfg(test)]
mod tests {
use super::*;
use position::{test::PositionFake, Position};
use position::{Position, test::PositionFake};

#[test]
fn compile_binary() {
Expand Down
2 changes: 1 addition & 1 deletion lib/ast/src/ast/if_branch.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{expression::Expression, Block};
use super::{Block, expression::Expression};
use std::rc::Rc;

#[derive(Clone, Debug, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion lib/ast/src/ast/if_list.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{expression::Expression, Block};
use super::{Block, expression::Expression};
use position::Position;
use std::rc::Rc;

Expand Down
2 changes: 1 addition & 1 deletion lib/ast/src/ast/if_map.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{expression::Expression, Block};
use super::{Block, expression::Expression};
use position::Position;
use std::rc::Rc;

Expand Down
2 changes: 1 addition & 1 deletion lib/ast/src/ast/if_type.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{expression::Expression, if_type_branch::IfTypeBranch, Block};
use super::{Block, expression::Expression, if_type_branch::IfTypeBranch};
use position::Position;
use std::rc::Rc;

Expand Down
2 changes: 1 addition & 1 deletion lib/ast/src/ast/list_comprehension.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::expression::Expression;
use crate::{types::Type, ListComprehensionBranch};
use crate::{ListComprehensionBranch, types::Type};
use position::Position;
use std::rc::Rc;

Expand Down
2 changes: 1 addition & 1 deletion lib/ast/src/ast/module.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::{
function_definition::FunctionDefinition, type_definition::TypeDefinition, ForeignImport, Import,
ForeignImport, Import, function_definition::FunctionDefinition, type_definition::TypeDefinition,
};
use position::Position;

Expand Down
2 changes: 1 addition & 1 deletion lib/ast/src/ast/record.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{expression::Expression, RecordField};
use super::{RecordField, expression::Expression};
use position::Position;
use std::rc::Rc;

Expand Down
2 changes: 1 addition & 1 deletion lib/doc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ fn compile_last_block_comment(context: &Context, position: &Position) -> Option<
mod tests {
use super::*;
use indoc::indoc;
use position::{test::PositionFake, Position};
use position::{Position, test::PositionFake};

const TEST_LANGUAGE: &str = "pen";

Expand Down
2 changes: 1 addition & 1 deletion lib/ffi-macro/src/attribute_list.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use syn::{
Meta, Result, Token,
parse::{Parse, ParseStream},
punctuated::Punctuated,
Meta, Result, Token,
};

pub struct AttributeList {
Expand Down
2 changes: 1 addition & 1 deletion lib/ffi-macro/src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use proc_macro::TokenStream;
use quote::quote;
use std::error::Error;
use syn::{
parse_quote, FnArg, Ident, ItemFn, Pat, Path, PathArguments, PathSegment, ReturnType, Type,
FnArg, Ident, ItemFn, Pat, Path, PathArguments, PathSegment, ReturnType, Type, parse_quote,
};

pub fn generate(
Expand Down
2 changes: 1 addition & 1 deletion lib/ffi-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use self::attribute_list::AttributeList;
use proc_macro::TokenStream;
use quote::quote;
use std::error::Error;
use syn::{parse_macro_input, ItemFn, ItemStruct};
use syn::{ItemFn, ItemStruct, parse_macro_input};

#[proc_macro_attribute]
pub fn bindgen(attributes: TokenStream, item: TokenStream) -> TokenStream {
Expand Down
2 changes: 1 addition & 1 deletion lib/ffi-macro/src/utilities.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::attribute_list::AttributeList;
use quote::quote;
use std::error::Error;
use syn::{parse::Parse, parse_str, Expr, ExprLit, Ident, Lit, Meta, Path};
use syn::{Expr, ExprLit, Ident, Lit, Meta, Path, parse::Parse, parse_str};

const DEFAULT_CRATE_NAME: &str = "ffi";

Expand Down
2 changes: 1 addition & 1 deletion lib/ffi/src/any.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{import, Boolean, ByteString, Error, List, Number, TypeInformation};
use crate::{Boolean, ByteString, Error, List, Number, TypeInformation, import};

import!(pen_ffi_any_is_boolean, fn(any: Any) -> Boolean);
import!(pen_ffi_any_is_error, fn(any: Any) -> Boolean);
Expand Down
2 changes: 1 addition & 1 deletion lib/ffi/src/arc/arc_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use alloc::alloc::{alloc, dealloc};
use core::{
alloc::Layout,
ptr::{drop_in_place, null},
sync::atomic::{fence, AtomicIsize, Ordering},
sync::atomic::{AtomicIsize, Ordering, fence},
};

const UNIQUE_COUNT: isize = 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/ffi/src/closure.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::Arc;
use core::{
mem::{transmute, ManuallyDrop},
mem::{ManuallyDrop, transmute},
ops::Deref,
sync::atomic::{AtomicPtr, Ordering},
};
Expand Down
4 changes: 2 additions & 2 deletions lib/ffi/src/cps/async_stack.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{async_stack_action::AsyncStackAction, CpsError, Stack};
use super::{CpsError, Stack, async_stack_action::AsyncStackAction};
use alloc::{vec, vec::Vec};
use core::{
future::Future,
Expand Down Expand Up @@ -178,7 +178,7 @@ unsafe impl<V: Sync> Sync for AsyncStack<V> {}
mod tests {
use super::*;
use core::{
future::{ready, Ready},
future::{Ready, ready},
ptr::null,
task::{RawWaker, RawWakerVTable, Waker},
};
Expand Down
2 changes: 1 addition & 1 deletion lib/ffi/src/future/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ macro_rules! call {
#[cfg(test)]
mod tests {
use crate::{
cps::{AsyncStack, ContinuationFunction},
ByteString, Closure, Number,
cps::{AsyncStack, ContinuationFunction},
};
use core::future::ready;

Expand Down
2 changes: 1 addition & 1 deletion lib/ffi/src/future/call_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ macro_rules! call_function {
#[cfg(test)]
mod tests {
use crate::{
cps::{AsyncStack, ContinuationFunction},
ByteString, Number,
cps::{AsyncStack, ContinuationFunction},
};
use core::future::ready;

Expand Down
2 changes: 1 addition & 1 deletion lib/ffi/src/future/from_closure.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
cps::{AsyncStack, ContinuationFunction, StepFunction},
Closure,
cps::{AsyncStack, ContinuationFunction, StepFunction},
};
use core::{future::poll_fn, intrinsics::transmute, task::Poll};

Expand Down
2 changes: 1 addition & 1 deletion lib/ffi/src/future/stream.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{future, import, Any, Arc, Boolean, Closure, List};
use crate::{Any, Arc, Boolean, Closure, List, future, import};
use futures::Stream;

import!(pen_ffi_list_first_rest, async fn(list: List) -> Arc<FirstRest>);
Expand Down
2 changes: 1 addition & 1 deletion lib/ffi/src/future/to_closure.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
cps::{AsyncStack, ContinuationFunction},
Closure,
cps::{AsyncStack, ContinuationFunction},
};
use alloc::boxed::Box;
use core::{future::Future, pin::Pin, task::Poll};
Expand Down
2 changes: 1 addition & 1 deletion lib/ffi/src/list.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{import, Any, Arc, Closure};
use crate::{Any, Arc, Closure, import};

import!(pen_ffi_list_create, fn() -> List);
import!(pen_ffi_list_lazy, fn(xs: Closure) -> List);
Expand Down
Loading

0 comments on commit 5329852

Please sign in to comment.