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

Fix #7013 by treating owned closures and traits as non-Const #7020

Closed
wants to merge 2 commits into from

Conversation

bill-myers
Copy link
Contributor

Fix #7013: the idea is that they can include arbitrary types, which may not be Const.

I'm not totally sure this is conceptually correct and catches all cases, please check.

Owned traits and closures can contain any type, including those that
do not satisfy Const, and thus must not satisfy Const themselves.
@brson
Copy link
Contributor

brson commented Jun 13, 2013

I r+'d this because it seems reasonable, but I know there are pending changes to the language here. Maybe @nikomatsakis or @catamorphism can take a peek.

@brson
Copy link
Contributor

brson commented Jun 13, 2013

Thanks!

@nikomatsakis
Copy link
Contributor

This change is ok, it's just not the full fix that will eventually be required (which is to consider the declared bounds of the closure; but also to remove owned closures altogether, at least if we stick with current plan).

@emberian
Copy link
Member

emberian commented Jul 7, 2013

@bill-myers needs a rebase

@emberian
Copy link
Member

emberian commented Aug 8, 2013

I'll rebase and reopen this tomorrow morning.

@emberian emberian closed this Aug 8, 2013
@emberian
Copy link
Member

emberian commented Aug 8, 2013

@nikomatsakis @catamorphism so rebasing this I came across the problem that TC_OWNED_CLOSURE has been removed from middle::ty entirely. I'm going to reopen, because I don't know enough to fix this.

@emberian emberian reopened this Aug 8, 2013
@catamorphism
Copy link
Contributor

#7013 seems to be fixed now; I added the test case as a commit in #8570. I'm closing this -- thanks for your effort, @bill-myers !

flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 8, 2021
…arth

Improve needless_collect output

changelog: Improve needless_collect output

Fixes rust-lang#6908
Partially addresses rust-lang#6164
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.

Unsoundness: ~Trait is considered Const, but shouldn't be
6 participants