Move transparent_newtype to use include!#5612
Conversation
I don't personally use rust-analyzer and I really want to not care but in reality this seems like a show stopper? FWIW I think we should put the include!("../../includes/newtype.rs"); // Explained in `REPO_DIR/docs/README.md`.
// Defined in `REPO_DIR/includes/newtype.rs`.
transparent_newtype! {
...
}And writing a README (if we ever do this). |
|
I'm using helix with rust-analyzer and it This seems fine to me. At some point, if the language is going to be this hostile as to have no specialization, overboaring coherence rules, no useful syntax for doing blanket impls, and no codegen, we should just switch languages. But my feeling is that "some IDEs show spurious errors" is the least worst of all worlds. |
b798d04 to
40fd3a0
Compare
|
I've fixed up the docs CI errors, moved the uses of |
|
Perhaps throw an SPDX licence comment on the new file. // SPDX-License-Identifier: CC0-1.0 |
|
I rekon we can undraft, merge, YOLO! |
40fd3a0 to
56c73d9
Compare
56c73d9 to
a03d64f
Compare
a03d64f to
f9eddd2
Compare
|
Still needs rebase mate. |
|
Yep, I know. My local master was out of date. The macro is now causing lint errors in the unsafe parts, so I'm trying to figure that out. |
f9eddd2 to
ca6f2c5
Compare
|
Sorry, wrong button. Looks like it needs an API update. |
API update is broken on master. It's fixed in #5764 . I can rebase after to fix the CI if you'd like. |
ca6f2c5 to
baa342d
Compare
include/newtype.rs
Outdated
| internals::_emit_alloc! { | ||
| $(#[$($from_box_attr)*])* | ||
| #[inline] | ||
| #[allow(clippy::ptr_as_ptr)] |
There was a problem hiding this comment.
FTR I had to look this lint up. I wrestled with it for a bit but couldn't come up with anything other than this solution.
Perhaps use this?
#[allow(clippy::ptr_as_ptr)] // Cannot use `cast()` because size of `Self` is not know at compile time. There was a problem hiding this comment.
FTR I like to comment on less well known attributes to save the next guy investigating why the attribute is there or checking if it has become stale.
baa342d to
c0c49f1
Compare
|
c0c49f1 needs rebase |
|
I have gotten my local CI to like the |
bbb1a9b to
1839853
Compare
|
Also, for those new to the project -- this kind of shit is one reason we don't enforce rustfmt here. |
1839853 to
88b9a60
Compare
I made a variation on it in #5919 that he ACK'ed after I added some skips. I've cherry-picked that in here in place of the plain format patch. If you'd still prefer to have it elsewhere to keep the non-automated changes separate, then I can open another PR for the formatting changes. |
|
Its easy enough to review, I personally don't mind how or where it goes in. |
In hashes, a handful of the transparent_newtype invocations for hashes use doc comments that are missing backticks around names or are generally unclean. These should be normalised to suit typical style. Adjust doc comments on sha256t, sha256d, muhash and siphash hash newtypes.
The transparent_newtype macro from internals is one of many cross-crate macros which we'd like to remove over time. Copy transparent_newtype macro to include directory. Replace all uses of internals::transparent_newtype with include! calls and direct usage of the macro.
88b9a60 to
ac8f61f
Compare
|
Rebased because the formatting is fixed by #5927 |
The transparent_newtype macro from internals is one of many cross-crate macros which we'd like to remove over time.
Contributes to #5596