-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
On recursive ADT, provide indirection structured suggestion #72740
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
LL | enum MList { Cons(isize, &MList), Nil } | ||
| ^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This suggestion isn't entirely correct, but if used the compiler will correctly tell you to write
enum MList<'a> { Cons(isize, &'a MList), Nil }
so I think it is ok.
| | ||
LL | struct Foo<T> { foo: Box<Option<Option<Foo<T>>>>, marker: marker::PhantomData<T> } | ||
| ^^^^ ^ | ||
LL | struct Foo<T> { foo: Rc<Option<Option<Foo<T>>>>, marker: marker::PhantomData<T> } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These suggestions are now fairly long. While I don't have a strong opinion here, it may be better to only mention Box
and &
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or thinking more about it, I would prefer if we keep
help: insert indirection (e.g., a
Box
,Rc
, or&
) at some point to makeFoo
representable
and only add an example using Box
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also a bit concerned by the length of this suggestion.
9bc1ea2
to
c209040
Compare
@bors r+ |
📌 Commit c209040 has been approved by |
…atthewjasper On recursive ADT, provide indirection structured suggestion
…atthewjasper On recursive ADT, provide indirection structured suggestion
Failed in https://github.com/rust-lang/rust/runs/744866295:
Probably needs a re-bless. |
c209040
to
03552ec
Compare
@bors r=matthewjasper rebased |
📌 Commit 03552ec has been approved by |
…atthewjasper On recursive ADT, provide indirection structured suggestion
…atthewjasper On recursive ADT, provide indirection structured suggestion
…atthewjasper On recursive ADT, provide indirection structured suggestion
…atthewjasper On recursive ADT, provide indirection structured suggestion
…atthewjasper On recursive ADT, provide indirection structured suggestion
…atthewjasper On recursive ADT, provide indirection structured suggestion
Rollup of 10 pull requests Successful merges: - rust-lang#72707 (Use min_specialization in the remaining rustc crates) - rust-lang#72740 (On recursive ADT, provide indirection structured suggestion) - rust-lang#72879 (Miri: avoid tracking current location three times) - rust-lang#72938 (Stabilize Option::zip) - rust-lang#73086 (Rename "cyclone" to "apple-a7" per changes in upstream LLVM) - rust-lang#73104 (Example about explicit mutex dropping) - rust-lang#73139 (Add methods to go from a nul-terminated Vec<u8> to a CString) - rust-lang#73296 (Remove vestigial CI job msvc-aux.) - rust-lang#73304 (Revert heterogeneous SocketAddr PartialEq impls) - rust-lang#73331 (extend network support for HermitCore) Failed merges: r? @ghost
No description provided.