Skip to content

Commit

Permalink
Add 2024_07 edition.
Browse files Browse the repository at this point in the history
commit-id:8e9758d5
  • Loading branch information
gilbens-starkware committed Jul 1, 2024
1 parent 1266e61 commit 186a0ee
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
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

0 comments on commit 186a0ee

Please sign in to comment.