From c6920f9d5461576ca747c6da0df4decb7e62f2c1 Mon Sep 17 00:00:00 2001 From: Micah Date: Fri, 29 Nov 2024 21:42:19 -0600 Subject: [PATCH] remove excess changes --- .../src/name_resolution/diagnostics.rs | 4 ---- crates/hir-analysis/src/ty/diagnostics.rs | 20 ------------------- crates/hir/src/diagnostics.rs | 9 --------- crates/hir/src/lower/parse.rs | 4 ---- crates/language-server/Cargo.toml | 2 +- crates/library/std/src/math.fe | 1 - .../fixtures/features/numeric_sizes.fe | 12 +++++------ 7 files changed, 7 insertions(+), 45 deletions(-) diff --git a/crates/hir-analysis/src/name_resolution/diagnostics.rs b/crates/hir-analysis/src/name_resolution/diagnostics.rs index 5cad02b437..136ea417f8 100644 --- a/crates/hir-analysis/src/name_resolution/diagnostics.rs +++ b/crates/hir-analysis/src/name_resolution/diagnostics.rs @@ -286,8 +286,4 @@ impl<'db> DiagnosticVoucher<'db> for NameResDiag<'db> { CompleteDiagnostic::new(self.severity(), message, sub_diags, vec![], error_code) } - - // fn clone_box(&self) -> Box> { - // Box::new(self.clone()) - // } } diff --git a/crates/hir-analysis/src/ty/diagnostics.rs b/crates/hir-analysis/src/ty/diagnostics.rs index e92ad4dd9b..71bd85ae28 100644 --- a/crates/hir-analysis/src/ty/diagnostics.rs +++ b/crates/hir-analysis/src/ty/diagnostics.rs @@ -518,10 +518,6 @@ impl<'db> DiagnosticVoucher<'db> for TyLowerDiag<'db> { CompleteDiagnostic::new(severity, message, sub_diags, vec![], error_code) } - - // fn clone_box(&self) -> Box { - // Box::new(self.clone()) - // } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -1578,10 +1574,6 @@ impl<'db> DiagnosticVoucher<'db> for BodyDiag<'db> { CompleteDiagnostic::new(severity, message, sub_diags, vec![], error_code) } - - // fn clone_box(&self) -> Box + '_> { - // Box::new(self.clone()) - // } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -1680,10 +1672,6 @@ impl<'db> DiagnosticVoucher<'db> for TraitLowerDiag<'db> { CompleteDiagnostic::new(severity, message, sub_diags, vec![], error_code) } - - // fn clone_box(&self) -> Box { - // Box::new(self.clone()) - // } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -1898,10 +1886,6 @@ impl<'db> DiagnosticVoucher<'db> for TraitConstraintDiag<'db> { CompleteDiagnostic::new(severity, message, sub_diags, vec![], error_code) } - - // fn clone_box(&self) -> Box { - // Box::new(self.clone()) - // } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -2378,8 +2362,4 @@ impl<'db> DiagnosticVoucher<'db> for ImplDiag<'db> { CompleteDiagnostic::new(severity, message, sub_diags, vec![], error_code) } - - // fn clone_box(&self) -> Box { - // Box::new(self.clone()) - // } } diff --git a/crates/hir/src/diagnostics.rs b/crates/hir/src/diagnostics.rs index 55e86ccfe4..f16e8469a1 100644 --- a/crates/hir/src/diagnostics.rs +++ b/crates/hir/src/diagnostics.rs @@ -24,7 +24,6 @@ pub trait DiagnosticVoucher<'db>: Send { fn error_code(&self) -> GlobalErrorCode; /// Makes a [`CompleteDiagnostic`]. fn to_complete(&self, db: &'db dyn SpannedHirDb) -> CompleteDiagnostic; - // fn clone_box(&self) -> Box<&'db dyn DiagnosticVoucher>; } impl<'db> DiagnosticVoucher<'db> for CompleteDiagnostic { @@ -35,10 +34,6 @@ impl<'db> DiagnosticVoucher<'db> for CompleteDiagnostic { fn to_complete(&self, _db: &dyn SpannedHirDb) -> CompleteDiagnostic { self.clone() } - - // fn clone_box(&self) -> Box<&'db dyn DiagnosticVoucher> { - // Box::new(&self.clone()) - // } } impl<'db> DiagnosticVoucher<'db> for Box + 'db> { @@ -49,8 +44,4 @@ impl<'db> DiagnosticVoucher<'db> for Box + 'db> { fn to_complete(&self, db: &'db dyn SpannedHirDb) -> CompleteDiagnostic { self.as_ref().to_complete(db) } - - // fn clone_box(&self) -> Box { - // self.as_ref().clone_box() - // } } diff --git a/crates/hir/src/lower/parse.rs b/crates/hir/src/lower/parse.rs index 75f6428f2c..407082b595 100644 --- a/crates/hir/src/lower/parse.rs +++ b/crates/hir/src/lower/parse.rs @@ -54,8 +54,4 @@ impl<'db> DiagnosticVoucher<'db> for ParserError { error_code, ) } - - // fn clone_box(&self) -> Box { - // Box::new(self.clone()) - // } } diff --git a/crates/language-server/Cargo.toml b/crates/language-server/Cargo.toml index a6c6dcd335..5bb895a178 100644 --- a/crates/language-server/Cargo.toml +++ b/crates/language-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fe-language-server" -version = "0.23.0" +version = "0.26.0" edition = "2021" authors = ["The Fe Developers "] license = "Apache-2.0" diff --git a/crates/library/std/src/math.fe b/crates/library/std/src/math.fe index 79f6317f03..bc37ee6739 100644 --- a/crates/library/std/src/math.fe +++ b/crates/library/std/src/math.fe @@ -1,4 +1,3 @@ - pub fn min(_ x: u256, _ y: u256) -> u256 { if x < y { return x diff --git a/crates/test-files/fixtures/features/numeric_sizes.fe b/crates/test-files/fixtures/features/numeric_sizes.fe index 9773757e61..fdec05e3a9 100644 --- a/crates/test-files/fixtures/features/numeric_sizes.fe +++ b/crates/test-files/fixtures/features/numeric_sizes.fe @@ -27,8 +27,8 @@ const U128_MAX: u128 = 340282366920938463463374607431768211455 const I256_MIN: i256 = -57896044618658097711785492504343953926634992332820282019728792003956564819968 const I256_MAX: i256 = 57896044618658097711785492504343953926634992332820282019728792003956564819967 -const u256_MIN: u256 = 0 -const u256_MAX: u256 = 115792089237316195423570985008687907853269984665640564039457584007913129639935 +const U256_MIN: u256 = 0 +const U256_MAX: u256 = 115792089237316195423570985008687907853269984665640564039457584007913129639935 contract Foo { @@ -38,7 +38,7 @@ contract Foo { assert u32::min() == U32_MIN assert u64::min() == U64_MIN assert u128::min() == U128_MIN - assert u256::min() == u256_MIN + assert u256::min() == U256_MIN // TODO: Investigate why these can't be compared against their const values assert i8::min() == get_i8_const_min() assert i16::min() == get_i16_const_min() @@ -52,7 +52,7 @@ contract Foo { assert u32::max() == U32_MAX assert u64::max() == U64_MAX assert u128::max() == U128_MAX - assert u256::max() == u256_MAX + assert u256::max() == U256_MAX assert i8::max() == I8_MAX assert i16::max() == I16_MAX @@ -106,7 +106,7 @@ contract Foo { } pub fn get_u256_const_min() -> u256 { - return u256_MIN + return U256_MIN } pub fn get_i8_min() -> i8 { @@ -202,7 +202,7 @@ contract Foo { } pub fn get_u256_const_max() -> u256 { - return u256_MAX + return U256_MAX } pub fn get_i8_max() -> i8 {