Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow individual upvars to be inferred as by-value or by-ref in non-escaping closures #21604
Conversation
rust-highfive
assigned
eddyb
Jan 24, 2015
eddyb
reviewed
Jan 24, 2015
| @@ -100,8 +100,7 @@ fn load_unboxed_closure_environment<'blk, 'tcx>( | |||
| #[derive(PartialEq)] | |||
| pub enum ClosureKind<'tcx> { | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
eddyb
Jan 24, 2015
Member
On a second note, ClosureEnv can now become Closure(&'a [ty::Freevar]) | NotClosure, which seems more idiomatic.
eddyb
reviewed
Jan 24, 2015
| @@ -304,7 +304,7 @@ impl<'a, 'tcx> mc::Typer<'tcx> for FnCtxt<'a, 'tcx> { | |||
| } | |||
| fn type_moves_by_default(&self, span: Span, ty: Ty<'tcx>) -> bool { | |||
| let ty = self.infcx().resolve_type_vars_if_possible(&ty); | |||
| traits::type_known_to_meet_builtin_bound(self.infcx(), self, ty, ty::BoundCopy, span) | |||
| !traits::type_known_to_meet_builtin_bound(self.infcx(), self, ty, ty::BoundCopy, span) | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
eddyb
reviewed
Jan 24, 2015
| #[derive(PartialEq, Clone, RustcEncodable, RustcDecodable, Show, Copy)] | ||
| pub struct UpvarBorrow { | ||
| /// The kind of borrow: by-ref upvars have access to shared | ||
| /// immutable borrows, which are not part of the normal language |
This comment has been minimized.
This comment has been minimized.
eddyb
Jan 24, 2015
Member
"Shared immutable borrows" sounds like &T - did you mean to refer to &uniq T instead?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
r=me with nits fixed. There seems to be partial overlap with #21598, but I don't think it will be an issue. |
This comment has been minimized.
This comment has been minimized.
|
\o/ |
nikomatsakis
force-pushed the
nikomatsakis:closure-move-indiv-vars
branch
from
8ec5d3a
to
4bfba7e
Jan 27, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis did you mean to include @kvark's commit into this? |
This comment has been minimized.
This comment has been minimized.
|
Oh it's in master already. @bors r- until that's fixed. |
nikomatsakis
force-pushed the
nikomatsakis:closure-move-indiv-vars
branch
2 times, most recently
from
617dfb5
to
5272887
Jan 27, 2015
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@eddyb corrected |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added a commit
that referenced
this pull request
Jan 27, 2015
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@bors: retry |
nikomatsakis
force-pushed the
nikomatsakis:closure-move-indiv-vars
branch
from
5272887
to
e58a960
Jan 29, 2015
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jan 29, 2015
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Grr, this test failure is very strange! Certainly I didn't see it locally. |
nikomatsakis commentedJan 24, 2015
r? @eddyb