Skip to content
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 acvm-repo/acvm/tests/solver.proptest-regressions
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ cc 4fc0bd347d9f4967801e2e30c746d2f6c012882911f72e7e816d350a742ced28 # shrinks to
cc 04d8571793600c2023d7aba2d1dd8f0e2c82b6010130d95a193df02b07977712 # shrinks to inputs_distinct_inputs = ([], [(0, true)])
cc dbc57772b9450371db70f8aa06d10502bb1aef030448c6df467465937bc8916a # shrinks to inputs_distinct_inputs = ([(295, false), (0, false), (0, false), (0, false), (0, false), (0, false)], [(295, false), (0, false), (328, false), (237, true), (484, true), (69, false)])
cc ef68d2dc6f0d366dd69edf8eec02a7b9cd7d6888983cea45496516b6effca813 # shrinks to inputs_distinct_inputs = ([(40, false), (471, false), (56, false), (35, false), (104, false), (232, false), (252, false), (131, false), (437, true), (354, false), (235, false), (316, true), (364, true), (242, false), (436, true), (298, true), (360, true), (174, true), (295, false), (250, true), (178, true), (426, false), (78, false), (217, true), (296, true), (371, false), (349, true), (445, false), (221, false), (409, false), (59, false), (511, true), (482, false)], [(136, true), (228, true), (193, true), (190, true), (15, false), (399, false), (54, false), (195, true), (258, true), (99, false), (83, false), (383, true), (456, true), (409, true), (347, false), (183, false), (371, true), (410, true), (439, true), (175, true), (445, false), (165, false), (70, false), (2⁴×22, true), (339, true), (161, true), (313, false), (2⁴×23, true), (275, true), (278, true), (294, true), (284, true), (262, false)])
cc ff78ae2090837bce192e5793754b9143500f70cdc7c71dc196106f9b2a36186c # shrinks to x = (11511220462188010364630447054930908966505262974220186213005541104952868383229, false), y = (7441439834137017688138027683185021846617790109711995169214836794920459176455, false), z = (-7131467151439280878007322057486113659135907187574829308381607284375377895255, false), use_constant_xy = false, use_constant_yz = false
67 changes: 67 additions & 0 deletions noir_stdlib/src/convert.nr
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,36 @@ where
// docs:start:from-impls
// Unsigned integers

impl From<u8> for u16 {
fn from(value: u8) -> u16 {
value as u16
}
}

impl From<u8> for u32 {
fn from(value: u8) -> u32 {
value as u32
}
}

impl From<u16> for u32 {
fn from(value: u16) -> u32 {
value as u32
}
}

impl From<u8> for u64 {
fn from(value: u8) -> u64 {
value as u64
}
}

impl From<u16> for u64 {
fn from(value: u16) -> u64 {
value as u64
}
}

impl From<u32> for u64 {
fn from(value: u32) -> u64 {
value as u64
Expand All @@ -50,6 +69,13 @@ impl From<u8> for u128 {
value as u128
}
}

impl From<u16> for u128 {
fn from(value: u16) -> u128 {
value as u128
}
}

impl From<u32> for u128 {
fn from(value: u32) -> u128 {
value as u128
Expand All @@ -66,6 +92,13 @@ impl From<u8> for Field {
value as Field
}
}

impl From<u16> for Field {
fn from(value: u16) -> Field {
value as Field
}
}

impl From<u32> for Field {
fn from(value: u32) -> Field {
value as Field
Expand All @@ -85,17 +118,36 @@ impl From<u128> for Field {

// Signed integers

impl From<i8> for i16 {
fn from(value: i8) -> i16 {
value as i16
}
}

impl From<i8> for i32 {
fn from(value: i8) -> i32 {
value as i32
}
}

impl From<i16> for i32 {
fn from(value: i16) -> i32 {
value as i32
}
}

impl From<i8> for i64 {
fn from(value: i8) -> i64 {
value as i64
}
}

impl From<i16> for i64 {
fn from(value: i16) -> i64 {
value as i64
}
}

impl From<i32> for i64 {
fn from(value: i32) -> i64 {
value as i64
Expand All @@ -108,6 +160,11 @@ impl From<bool> for u8 {
value as u8
}
}
impl From<bool> for u16 {
fn from(value: bool) -> u16 {
value as u16
}
}
impl From<bool> for u32 {
fn from(value: bool) -> u32 {
value as u32
Expand All @@ -118,11 +175,21 @@ impl From<bool> for u64 {
value as u64
}
}
impl From<bool> for u128 {
fn from(value: bool) -> u128 {
value as u128
}
}
impl From<bool> for i8 {
fn from(value: bool) -> i8 {
value as i8
}
}
impl From<bool> for i16 {
fn from(value: bool) -> i16 {
value as i16
}
}
impl From<bool> for i32 {
fn from(value: bool) -> i32 {
value as i32
Expand Down
4 changes: 3 additions & 1 deletion tooling/nargo_cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const IGNORED_NARGO_EXPAND_COMPILE_SUCCESS_EMPTY_TESTS: [&str; 13] = [

/// These tests are ignored because of existing bugs in `nargo expand`.
/// As the bugs are fixed these tests should be removed from this list.
const IGNORED_NARGO_EXPAND_COMPILE_SUCCESS_NO_BUG_TESTS: [&str; 12] = [
const IGNORED_NARGO_EXPAND_COMPILE_SUCCESS_NO_BUG_TESTS: [&str; 13] = [
"noirc_frontend_tests_arithmetic_generics_checked_casts_do_not_prevent_canonicalization",
"noirc_frontend_tests_check_trait_as_type_as_fn_parameter",
"noirc_frontend_tests_check_trait_as_type_as_two_fn_parameters",
Expand All @@ -226,6 +226,8 @@ const IGNORED_NARGO_EXPAND_COMPILE_SUCCESS_NO_BUG_TESTS: [&str; 12] = [
// "noirc_frontend_tests_traits_as_trait_path_called_multiple_times_for_different_t_2",
// This creates a struct at comptime which, expanded, gives a visibility error
"noirc_frontend_tests_visibility_visibility_bug_inside_comptime",
// bug
"noirc_frontend_tests_traits_associated_constant_sum_of_other_constants_3",
];

const IGNORED_NARGO_EXPAND_COMPILE_SUCCESS_WITH_BUG_TESTS: [&str; 1] =
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading