Skip to content

Commit 94ef079

Browse files
committed
treat owned traits and closures as non-Const, fixes rust-lang#7013
Owned traits and closures can contain any type, including those that do not satisfy Const, and thus must not satisfy Const themselves.
1 parent 7a2afb7 commit 94ef079

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ pub impl TypeContents {
19401940
}
19411941

19421942
fn nonconst(_cx: ctxt) -> TypeContents {
1943-
TC_MUTABLE
1943+
TC_MUTABLE + TC_OWNED_CLOSURE
19441944
}
19451945

19461946
fn moves_by_default(&self, cx: ctxt) -> bool {

0 commit comments

Comments
 (0)