Skip to content

Commit bd51c48

Browse files
U-NOV2010\eugalsEvgeny Sologubov
authored andcommitted
---
yaml --- r: 83246 b: refs/heads/try c: dfa3f5f h: refs/heads/master v: v3
1 parent fa45c79 commit bd51c48

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0e4d1fc8cae42e15e00f71d9f439b01bb25a86ae
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
5-
refs/heads/try: 2927ab13df9436ae2042866885ea0b9d29cdcedc
5+
refs/heads/try: dfa3f5fa8d20bc970843c88bc5cbca398a26ce7c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/trans/type_.rs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -278,23 +278,12 @@ impl Type {
278278

279279
pub fn opaque_trait(ctx: &CrateContext, store: ty::TraitStore) -> Type {
280280
let tydesc_ptr = ctx.tydesc_type.ptr_to();
281-
match store {
282-
ty::BoxTraitStore => {
283-
Type::struct_(
284-
[ tydesc_ptr, Type::opaque_box(ctx).ptr_to() ],
285-
false)
286-
}
287-
ty::UniqTraitStore => {
288-
Type::struct_(
289-
[ tydesc_ptr, Type::unique(ctx, &Type::i8()).ptr_to()],
290-
false)
291-
}
292-
ty::RegionTraitStore(*) => {
293-
Type::struct_(
294-
[ tydesc_ptr, Type::i8().ptr_to() ],
295-
false)
296-
}
297-
}
281+
let box_ty = match store {
282+
ty::BoxTraitStore => Type::opaque_box(ctx),
283+
ty::UniqTraitStore => Type::unique(ctx, &Type::i8()),
284+
ty::RegionTraitStore(*) => Type::i8()
285+
};
286+
Type::struct_([tydesc_ptr, box_ty.ptr_to()], false)
298287
}
299288

300289
pub fn kind(&self) -> TypeKind {

0 commit comments

Comments
 (0)