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

Add phantom attribute. #5381

Merged
merged 1 commit into from
Apr 9, 2024
Merged

Add phantom attribute. #5381

merged 1 commit into from
Apr 9, 2024

Conversation

ilyalesokhin-starkware
Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware commented Apr 9, 2024

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 6 files at r1.
Reviewable status: 2 of 6 files reviewed, 2 unresolved discussions (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-semantic/src/expr/compute.rs line 805 at r1 (raw file):

                    CannotCreateInstancesOfPhantomTypes,
                );
            }

.

Suggestion:

            if let Some(attr) = concrete_enum_id.find_attr(db, PHANTOM_ATTR)? {
                ctx.diagnostics.report(
                    syntax,
                    CannotCreateInstancesOfPhantomTypes,
                );
            }

crates/cairo-lang-semantic/src/expr/compute.rs line 1927 at r1 (raw file):

        ctx.diagnostics
            .report_by_ptr(attr.id_stable_ptr.untyped(), CannotCreateInstancesOfPhantomTypes);
    }

the error should appear at the usage - not the attr.

Suggestion:

    if let Some(attr) = concrete_struct_id.find_attr(db, PHANTOM_ATTR)? {
        ctx.diagnostics
            .report(ctor_syntax, CannotCreateInstancesOfPhantomTypes);
    }

Copy link
Contributor Author

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 6 files reviewed, 2 unresolved discussions (waiting on @orizi)


crates/cairo-lang-semantic/src/expr/compute.rs line 805 at r1 (raw file):

Previously, orizi wrote…

.

Done.


crates/cairo-lang-semantic/src/expr/compute.rs line 1927 at r1 (raw file):

Previously, orizi wrote…

the error should appear at the usage - not the attr.

Done.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 6 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)

@ilyalesokhin-starkware ilyalesokhin-starkware added this pull request to the merge queue Apr 9, 2024
Merged via the queue into main with commit e375707 Apr 9, 2024
42 of 43 checks passed
@orizi orizi deleted the ilya/phantom_attr branch April 17, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants