Skip to content

Commit c80b52a

Browse files
committed
---
yaml --- r: 63729 b: refs/heads/snap-stage3 c: f8c892a h: refs/heads/master i: 63727: 174f1d6 v: v3
1 parent 3f9aabb commit c80b52a

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 108739f533efd1a4faca62db1afb611f22c5f5f2
4+
refs/heads/snap-stage3: f8c892ab966e37c7fb8936ace6c7d40c8642f6ab
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/ty.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,16 +2249,23 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents {
22492249
}
22502250

22512251
fn closure_contents(cty: &ClosureTy) -> TypeContents {
2252+
// Closure contents are just like trait contents, but with potentially
2253+
// even more stuff.
22522254
let st = match cty.sigil {
2253-
ast::BorrowedSigil => TC_BORROWED_POINTER,
2254-
ast::ManagedSigil => TC_MANAGED,
2255-
ast::OwnedSigil => if cty.bounds.contains_elem(BoundCopy) {
2256-
TC_OWNED_POINTER
2257-
} else {
2258-
TC_OWNED_POINTER + TC_NONCOPY_TRAIT
2259-
}
2255+
ast::BorrowedSigil =>
2256+
trait_contents(RegionTraitStore(cty.region), m_imm, cty.bounds)
2257+
+ TC_BORROWED_POINTER, // might be an env packet even if static
2258+
ast::ManagedSigil =>
2259+
trait_contents(BoxTraitStore, m_imm, cty.bounds),
2260+
ast::OwnedSigil =>
2261+
trait_contents(UniqTraitStore, m_imm, cty.bounds),
22602262
};
2263+
// FIXME(#3569): This borrowed_contents call should be taken care of in
2264+
// trait_contents, after ~Traits and @Traits can have region bounds too.
2265+
// This one here is redundant for &fns but important for ~fns and @fns.
22612266
let rt = borrowed_contents(cty.region, m_imm);
2267+
// This also prohibits "@once fn" from being copied, which allows it to
2268+
// be called. Neither way really makes much sense.
22622269
let ot = match cty.onceness {
22632270
ast::Once => TC_ONCE_CLOSURE,
22642271
ast::Many => TC_NONE

0 commit comments

Comments
 (0)