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

[WIP] Add error messages for unsupported macro features on compilation #3993

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cojmeister
Copy link

This PR is in response to issue #3945

Returning an error message when calling an unsupported macro feature in compilation.

Currently only doing so for weakref.

Copy link

codspeed-hq bot commented Mar 25, 2024

CodSpeed Performance Report

Merging #3993 will not alter performance

Comparing cojmeister:add-error-messages-for-unsupported-macro-features-on-compilation (5bb7425) with main (7d319a9)

Summary

✅ 65 untouched benchmarks

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks, looking like the right direction for sure. You should also have a look at tests/test_compile_error.rs and in particular tests/ui/abi3_nativetype_inheritance.rs as an example of how we check error messages for the abi3 feature.

Comment on lines +187 to +191
if is_abi3() && python_version >= PY_3_9 {
set_option!(weakref);
} else {
return Err(syn::Error::new((weakref.span()), "`weakref` not supported until python 3.9 or graeter",));
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if is_abi3() && python_version >= PY_3_9 {
set_option!(weakref);
} else {
return Err(syn::Error::new((weakref.span()), "`weakref` not supported until python 3.9 or graeter",));
}
if python_version >= PY_3_9 || !is_abi3() {
set_option!(weakref);
} else {
return Err(syn::Error::new((weakref.span()), "`weakref` not supported with `abi3` until python 3.9 or graeter",));
}

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.

None yet

2 participants