Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 2024_07 edition. #5923

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions corelib/src/prelude.cairo
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
mod v2023_01;
mod v2023_10;
mod v2024_07;
22 changes: 22 additions & 0 deletions corelib/src/prelude/v2024_07.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
pub use core::{assert, bool, felt252, usize};

pub use core::array::{Array, ArrayTrait, Span, SpanTrait, ToSpanTrait};
pub use core::box::{Box, BoxTrait};
pub use core::bytes_31::{Bytes31Trait, bytes31};
pub use core::byte_array::{ByteArray, ByteArrayTrait};
pub use core::clone::Clone;
pub use core::dict::Felt252DictTrait;
pub use core::integer::{i128, i16, i32, i64, i8, u128, u16, u256, u32, u64, u8};
pub use core::nullable::{Nullable, NullableTrait};
pub use core::option::{Option, OptionTrait};
pub use core::panics::{Panic, PanicResult, panic};
pub use core::result::{Result, ResultTrait};
pub use core::serde::Serde;
pub use core::{starknet, starknet::System};
pub use core::traits::{
Add, Copy, Default, Destruct, Div, DivRem, Drop, Felt252DictValue, Into, Mul, Neg, Not,
PanicDestruct, PartialEq, PartialOrd, Rem, Sub, TryInto
};

pub use core::zeroable::NonZero;
pub use core::ops::Deref;
7 changes: 5 additions & 2 deletions crates/cairo-lang-filesystem/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,32 @@ pub enum Edition {
V2023_10,
#[serde(rename = "2023_11")]
V2023_11,
#[serde(rename = "2024_07")]
V2024_07,
}
impl Edition {
/// Returns the latest stable edition.
///
/// This Cairo edition is recommended for use in new projects and, in case of existing projects,
/// to migrate to when possible.
pub const fn latest() -> Self {
Self::V2023_11
Self::V2024_07
}

/// The name of the prelude submodule of `core::prelude` for this compatibility version.
pub fn prelude_submodule_name(&self) -> &str {
match self {
Self::V2023_01 => "v2023_01",
Self::V2023_10 | Self::V2023_11 => "v2023_10",
Self::V2024_07 => "v2024_07",
}
}

/// Whether to ignore visibility modifiers.
pub fn ignore_visibility(&self) -> bool {
match self {
Self::V2023_01 | Self::V2023_10 => true,
Self::V2023_11 => false,
Self::V2023_11 | Self::V2024_07 => false,
}
}
}
Expand Down