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

feat: use consts for addrs #660

Merged
merged 2 commits into from
Sep 16, 2022
Merged

feat: use consts for addrs #660

merged 2 commits into from
Sep 16, 2022

Conversation

Stebalien
Copy link
Member

And expose actor IDs so we don't need to call .id().unwrap() to retrieve them.

And expose actor IDs so we don't need to call `.id().unwrap()` to
retrieve them.
@Stebalien
Copy link
Member Author

(happy to punt this if we don't want to do it now, it was just annoying me a bit)

macro_rules! define_singletons {
($($name:ident = $id:literal,)*) => {
$(
paste! {
Copy link
Member Author

Choose a reason for hiding this comment

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

This won't have any affect at runtime, it just allows us to concatenate identifiers at compile time.

runtime/src/lib.rs Outdated Show resolved Hide resolved
runtime/src/lib.rs Outdated Show resolved Hide resolved
@Stebalien
Copy link
Member Author

Rust thinks paste is unused, or some other import? Is this concerning?

Rust thinks lazy_static is unused. It's likely a rust 2018/2021 thing (2021 doesn't use extern crate statements).

Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

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

LGTM apart from the unused import thing. I would also be just as happy with a version that didn't use the macro.

@Stebalien
Copy link
Member Author

LGTM apart from the unused import thing. I would also be just as happy with a version that didn't use the macro.

@mriise found the issue and is pushing a fix

@mriise
Copy link
Contributor

mriise commented Sep 16, 2022

we also had a workaround for serde, which was fixed in rust-lang/rust#89738. that is now gone

@mriise mriise merged commit ff3d01f into master Sep 16, 2022
@mriise mriise deleted the feat/const-addrs branch September 16, 2022 01:24
Stebalien added a commit that referenced this pull request Sep 16, 2022
* feat: use consts for addrs

And expose actor IDs so we don't need to call `.id().unwrap()` to
retrieve them.

Co-authored-by: mriise <me@mriise.net>
Stebalien added a commit that referenced this pull request Sep 16, 2022
* feat: use consts for addrs

And expose actor IDs so we don't need to call `.id().unwrap()` to
retrieve them.

Co-authored-by: mriise <me@mriise.net>
shamb0 pushed a commit to shamb0/builtin-actors that referenced this pull request Jan 31, 2023
* feat: use consts for addrs

And expose actor IDs so we don't need to call `.id().unwrap()` to
retrieve them.

* remove old TODO and extern crate refs

Co-authored-by: mriise <me@mriise.net>
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.

4 participants