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

Update cairo through xtask #182

Closed
wants to merge 1 commit into from
Closed
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
84 changes: 56 additions & 28 deletions Cargo.lock

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

28 changes: 1 addition & 27 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,4 @@ test-case = "3.0"
# on some of them directly.
# This ensures no duplicate instances of Cairo crates are pulled in by mistake.
[patch.crates-io]
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-eq-solver = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-plugins = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-proc-macros = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-sierra-ap-change = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-sierra-gas = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-syntax-codegen = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-test-utils = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "aa2c34d04a340ae4b22d000a225150c68172613c" }
cairo-lang-syntax-codegen = { git = "https://github.com/starkware-libs/cairo", rev = "b3bb598ff815e8e2b2d8418c9bb916578873805e" }
2 changes: 1 addition & 1 deletion crates/cairo-lint-core/src/lints/bool_comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn check_bool_comparison(
// Check if the function call is the bool partial eq function (==).
if !expr_func
.function
.full_path(db)
.full_name(db)
.contains("core::BoolPartialEq::")
{
return;
Expand Down
14 changes: 7 additions & 7 deletions crates/cairo-lint-core/src/lints/int_op_one.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn check_int_op_one(
}

// Check if the function call is the bool greater or equal (>=) or lower or equal (<=).
let full_name = expr_func.function.full_path(db);
let full_name = expr_func.function.full_name(db);
if !full_name.contains("core::integer::")
|| (!full_name.contains("PartialOrd::ge") && !full_name.contains("PartialOrd::le"))
{
Expand All @@ -47,7 +47,7 @@ pub fn check_int_op_one(
// x >= y + 1
if check_is_variable(lhs, arenas)
&& check_is_add_or_sub_one(db, rhs, arenas, "::add")
&& expr_func.function.full_path(db).contains("::ge")
&& expr_func.function.full_name(db).contains("::ge")
{
diagnostics.push(PluginDiagnostic {
stable_ptr: expr_func.stable_ptr.untyped(),
Expand All @@ -59,7 +59,7 @@ pub fn check_int_op_one(
// x - 1 >= y
if check_is_add_or_sub_one(db, lhs, arenas, "::sub")
&& check_is_variable(rhs, arenas)
&& expr_func.function.full_path(db).contains("::ge")
&& expr_func.function.full_name(db).contains("::ge")
{
diagnostics.push(PluginDiagnostic {
stable_ptr: expr_func.stable_ptr.untyped(),
Expand All @@ -71,7 +71,7 @@ pub fn check_int_op_one(
// x + 1 <= y
if check_is_add_or_sub_one(db, lhs, arenas, "::add")
&& check_is_variable(rhs, arenas)
&& expr_func.function.full_path(db).contains("::le")
&& expr_func.function.full_name(db).contains("::le")
{
diagnostics.push(PluginDiagnostic {
stable_ptr: expr_func.stable_ptr.untyped(),
Expand All @@ -83,7 +83,7 @@ pub fn check_int_op_one(
// x <= y - 1
if check_is_variable(lhs, arenas)
&& check_is_add_or_sub_one(db, rhs, arenas, "::sub")
&& expr_func.function.full_path(db).contains("::le")
&& expr_func.function.full_name(db).contains("::le")
{
diagnostics.push(PluginDiagnostic {
stable_ptr: expr_func.stable_ptr.untyped(),
Expand Down Expand Up @@ -114,8 +114,8 @@ fn check_is_add_or_sub_one(
return false;
};

// Check is addition or substraction
let full_name = func_call.function.full_path(db);
// Check is addition or subtraction
let full_name = func_call.function.full_name(db);
if !full_name.contains("core::integer::") && !full_name.contains(operation)
|| func_call.args.len() != 2
{
Expand Down
2 changes: 1 addition & 1 deletion crates/cairo-lint-core/src/lints/manual/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn is_expected_function(expr: &Expr, db: &dyn SemanticGroup, func_name: &str
let Expr::FunctionCall(func_call) = expr else {
return false;
};
func_call.function.full_path(db).as_str() == func_name
func_call.function.full_name(db).as_str() == func_name
}

/// Checks if the inner_pattern in the input `Pattern::Enum` matches the given argument name.
Expand Down
Loading
Loading