Skip to content

Commit c90d8b0

Browse files
committed
---
yaml --- r: 124119 b: refs/heads/master c: 6867d91 h: refs/heads/master i: 124117: 5085aaf 124115: 798eb67 124111: 33668f9 v: v3
1 parent 58cbb98 commit c90d8b0

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,5 +1,5 @@
11
---
2-
refs/heads/master: c6c1a22c563e0840f0efcccfe01a496114ac6ef0
2+
refs/heads/master: 6867d91d20a77ad9be4288829cedec2a8c2b72ba
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: afbcbbc77ffc6b10053bc543daf7d2e05d68cc01
55
refs/heads/try: 296eb104620b346d88bc4a2c2ab7693e6d3db019

trunk/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) {

trunk/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)