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

Implement intra-crate static methods on anonymous trait implementations (e.g. Foo::new()) #3776

Closed
wants to merge 1 commit into from

Conversation

pcwalton
Copy link
Contributor

No description provided.

@pcwalton
Copy link
Contributor Author

r? @catamorphism

@catamorphism
Copy link
Contributor

Looks ok for the most part as far as I can tell, but it's a relatively large amount of code with relatively few comments. I'd just encourage adding more comments before you commit.

r+

@pcwalton
Copy link
Contributor Author

r? @catamorphism

@pcwalton pcwalton closed this Oct 17, 2012
RalfJung pushed a commit to RalfJung/rust that referenced this pull request Aug 5, 2024
Use Scalar consistently in foreign item emulation

Step 0 of rust-lang#3772

This just makes the code consistent. While we could also go for consistency the other way, that would only allow us to use integers in some cases where we use `Scalar` right now, because `Scalar` can also hold pointers where applicable.

There's also no danger in messing up (even though we do lose some compile-time checks), as `Scalar` knows the size of the integer stored within, so it will check that against the destination when it is written. In fact, this makes the checks much stronger compared with `write_int`, which just checks that the integer fits into the destination size.
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.

3 participants