Skip to content

Commit 9875828

Browse files
committed
---
yaml --- r: 124382 b: refs/heads/snap-stage3 c: 6867d91 h: refs/heads/master v: v3
1 parent 69b1c8b commit 9875828

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
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: 32cb44bfff3facbded5fd9cc74af3f02e81565a8
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: c6c1a22c563e0840f0efcccfe01a496114ac6ef0
4+
refs/heads/snap-stage3: 6867d91d20a77ad9be4288829cedec2a8c2b72ba
55
refs/heads/try: dff46952ab5c4567d1b5b35bfbd8befc45cdd38e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ fn check_struct_safe_for_destructor(cx: &mut Context,
8787
span: Span,
8888
struct_did: DefId) {
8989
let struct_tpt = ty::lookup_item_type(cx.tcx, struct_did);
90-
if !struct_tpt.generics.has_type_params(subst::TypeSpace) {
90+
if !struct_tpt.generics.has_type_params(subst::TypeSpace)
91+
&& !struct_tpt.generics.has_region_params(subst::TypeSpace) {
9192
let struct_ty = ty::mk_struct(cx.tcx, struct_did,
9293
subst::Substs::empty());
9394
if !ty::type_is_sendable(cx.tcx, struct_ty) {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,10 @@ impl Generics {
984984
pub fn has_type_params(&self, space: subst::ParamSpace) -> bool {
985985
!self.types.is_empty_in(space)
986986
}
987+
988+
pub fn has_region_params(&self, space: subst::ParamSpace) -> bool {
989+
!self.regions.is_empty_in(space)
990+
}
987991
}
988992

989993
/// When type checking, we use the `ParameterEnvironment` to track

0 commit comments

Comments
 (0)