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

On recursive ADT, provide indirection structured suggestion #72740

Merged
merged 3 commits into from
Jun 15, 2020

Conversation

estebank
Copy link
Contributor

No description provided.

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 29, 2020
Comment on lines 15 to 16
LL | enum MList { Cons(isize, &MList), Nil }
| ^
Copy link
Contributor Author

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> }
Copy link
Contributor

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.

Copy link
Contributor

@lcnr lcnr May 29, 2020

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 make Foo representable

and only add an example using Box.

Copy link
Contributor

@matthewjasper matthewjasper left a 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.

src/librustc_trait_selection/traits/error_reporting/mod.rs Outdated Show resolved Hide resolved
@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 31, 2020

📌 Commit c209040 has been approved by matthewjasper

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 31, 2020
RalfJung added a commit to RalfJung/rust that referenced this pull request Jun 1, 2020
…atthewjasper

On recursive ADT, provide indirection structured suggestion
RalfJung added a commit to RalfJung/rust that referenced this pull request Jun 6, 2020
…atthewjasper

On recursive ADT, provide indirection structured suggestion
@RalfJung
Copy link
Member

RalfJung commented Jun 6, 2020

Failed in https://github.com/rust-lang/rust/runs/744866295:

---- [ui] ui/issues/issue-72554.rs stdout ----
diff of stderr:

6	LL |     A(ElemDerived)
7	   |       ----------- recursive without indirection
8	   |
-	   = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `ElemDerived` representable
+	help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ElemDerived` representable
+	   |
+	LL |     A(Box<ElemDerived>)
+	   |       ^^^^           ^
10	
11	error: aborting due to previous error
12	

Probably needs a re-bless.
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 6, 2020
@estebank
Copy link
Contributor Author

@bors r=matthewjasper rebased

@bors
Copy link
Contributor

bors commented Jun 10, 2020

📌 Commit 03552ec has been approved by matthewjasper

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 10, 2020
RalfJung added a commit to RalfJung/rust that referenced this pull request Jun 11, 2020
…atthewjasper

On recursive ADT, provide indirection structured suggestion
RalfJung added a commit to RalfJung/rust that referenced this pull request Jun 12, 2020
…atthewjasper

On recursive ADT, provide indirection structured suggestion
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jun 12, 2020
…atthewjasper

On recursive ADT, provide indirection structured suggestion
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jun 13, 2020
…atthewjasper

On recursive ADT, provide indirection structured suggestion
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jun 14, 2020
…atthewjasper

On recursive ADT, provide indirection structured suggestion
RalfJung added a commit to RalfJung/rust that referenced this pull request Jun 15, 2020
…atthewjasper

On recursive ADT, provide indirection structured suggestion
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 15, 2020
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
@bors bors merged commit d97e8ca into rust-lang:master Jun 15, 2020
@estebank estebank deleted the recursive-indirection branch November 9, 2023 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants