Skip to content

Commit

Permalink
Remove unneeded allows - or make them expect instead.
Browse files Browse the repository at this point in the history
commit-id:3f0039b9
  • Loading branch information
orizi committed Oct 7, 2024
1 parent e09cc4d commit 2db4e6e
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 22 deletions.
1 change: 0 additions & 1 deletion crates/cairo-lang-casm/src/assembler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ pub enum Opcode {
}

/// The low level representation of a cairo instruction.
#[allow(dead_code)]
#[derive(Debug, Eq, PartialEq)]
pub struct InstructionRepr {
pub off0: i16,
Expand Down
1 change: 0 additions & 1 deletion crates/cairo-lang-casm/src/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ macro_rules! is_inc_ap {
};
}

#[allow(dead_code)]
#[derive(Default)]
pub struct CasmContext {
pub current_code_offset: usize,
Expand Down
14 changes: 5 additions & 9 deletions crates/cairo-lang-lowering/src/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,12 @@ impl DiagnosticEntry for LoweringDiagnostic {
&self.location.notes
}

#[allow(unreachable_patterns, clippy::single_match)]
fn location(&self, db: &Self::DbType) -> DiagnosticLocation {
match &self.kind {
LoweringDiagnosticKind::Unreachable { last_statement_ptr } => {
return self
.location
.stable_location
.diagnostic_location_until(db.upcast(), *last_statement_ptr);
}
_ => {}
if let LoweringDiagnosticKind::Unreachable { last_statement_ptr } = &self.kind {
return self
.location
.stable_location
.diagnostic_location_until(db.upcast(), *last_statement_ptr);
}
self.location.stable_location.diagnostic_location(db.upcast())
}
Expand Down
1 change: 0 additions & 1 deletion crates/cairo-lang-runner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ pub struct SierraCasmRunner {
type_sizes: TypeSizeMap,
/// The casm program matching the Sierra code.
casm_program: CairoProgram,
#[allow(dead_code)]
/// Mapping from class_hash to contract info.
starknet_contracts_info: OrderedHashMap<Felt252, ContractInfo>,
/// Whether to run the profiler when running using this runner.
Expand Down
2 changes: 1 addition & 1 deletion crates/cairo-lang-semantic/src/expr/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,7 @@ fn compute_expr_indexed_semantic(
/// call and Index operator differs in the diagnostics they emit. The function returns the
/// function_id to call, the trait containing the function, the self argument, with snapshots added
/// if needed, and the mutability of the self argument.
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
fn compute_method_function_call_data(
ctx: &mut ComputationContext<'_>,
candidate_traits: &[TraitId],
Expand Down
2 changes: 1 addition & 1 deletion crates/cairo-lang-sierra-ap-change/src/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<'a, TokenUsages: Fn(CostTokenType) -> usize> InvocationApChangeInfoProvider
#[derive(Clone, Debug)]
enum ApTrackingBase {
FunctionStart(FunctionId),
#[allow(dead_code)]
#[expect(dead_code)]
EnableStatement(StatementIdx),
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ impl KnownStack {
///
/// For example, merging the stacks [0, 1, 2, 3, 4] and [1, 9, 3, 4] (where the last element in
/// the top) will yield [3, 4] (1 will not be included because of the hole).
#[allow(dead_code)]
pub fn merge_with(&self, other: &Self) -> Self {
// Choose the new offset to be the maximum of the input offsets. This is somewhat arbitrary.
let new_offset = max(self.offset, other.offset);
Expand Down
2 changes: 0 additions & 2 deletions crates/cairo-lang-sierra-to-casm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

pub mod annotations;
pub mod circuit;
// TODO(ilya): Reduce the size of CompilationError.
#[allow(clippy::result_large_err)]
pub mod compiler;
pub mod environment;
pub mod invocations;
Expand Down
2 changes: 0 additions & 2 deletions crates/cairo-lang-starknet-classes/src/casm_contract_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,6 @@ impl CasmContractClass {
.0)
}

// TODO(ilya): Reduce the size of CompilationError.
#[allow(clippy::result_large_err)]
pub fn from_contract_class_with_debug_info(
contract_class: ContractClass,
add_pythonic_hints: bool,
Expand Down
4 changes: 2 additions & 2 deletions ensure-no_std/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub extern "C" fn _start() -> ! {
// NOTE: this should be initialized before use
static ALLOC: esp_alloc::EspHeap = esp_alloc::EspHeap::empty();

#[allow(unused_imports)]
#[expect(unused_imports)]
use cairo_lang_casm;
#[allow(unused_imports)]
#[expect(unused_imports)]
use cairo_lang_utils;
2 changes: 1 addition & 1 deletion tests/examples_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn example_dir_data() -> ExampleDirData {
}

#[rstest]
#[allow(unused_variables)]
#[expect(unused_variables)]
fn lowering_test(example_dir_data: &ExampleDirData) {}

/// Returns the path of the relevant test file.
Expand Down

0 comments on commit 2db4e6e

Please sign in to comment.