Skip to content

Commit 5612054

Browse files
pcwaltonemberian
authored andcommitted
---
yaml --- r: 66393 b: refs/heads/master c: d350981 h: refs/heads/master i: 66391: bdbf6d6 v: v3
1 parent 0e75125 commit 5612054

File tree

10 files changed

+35
-28
lines changed

10 files changed

+35
-28
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: 607b91d5f94b352f953a8503a03af50d6d4aff3b
2+
refs/heads/master: d350981c0e8daa778d9760ba0e19b3157026e743
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/librustc/metadata/tydecode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ fn parse_bounds(st: &mut PState, conv: conv_did) -> ty::ParamBounds {
560560
param_bounds.builtin_bounds.add(ty::BoundCopy);
561561
}
562562
'K' => {
563-
param_bounds.builtin_bounds.add(ty::BoundConst);
563+
param_bounds.builtin_bounds.add(ty::BoundFreeze);
564564
}
565565
'O' => {
566566
param_bounds.builtin_bounds.add(ty::BoundStatic);

trunk/src/librustc/metadata/tyencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ fn enc_bounds(w: @io::Writer, cx: @ctxt, bs: &ty::ParamBounds) {
403403
match bound {
404404
ty::BoundSend => w.write_char('S'),
405405
ty::BoundCopy => w.write_char('C'),
406-
ty::BoundConst => w.write_char('K'),
406+
ty::BoundFreeze => w.write_char('K'),
407407
ty::BoundStatic => w.write_char('O'),
408408
ty::BoundSized => w.write_char('Z'),
409409
}

trunk/src/librustc/middle/kind.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use syntax::{visit, ast_util};
3131
//
3232
// send: Things that can be sent on channels or included in spawned closures.
3333
// copy: Things that can be copied.
34-
// const: Things thare are deeply immutable. They are guaranteed never to
34+
// freeze: Things thare are deeply immutable. They are guaranteed never to
3535
// change, and can be safely shared without copying between tasks.
3636
// 'static: Things that do not contain borrowed pointers.
3737
//
@@ -40,12 +40,12 @@ use syntax::{visit, ast_util};
4040
//
4141
// Copy includes boxes, closure and unique types containing copyable types.
4242
//
43-
// Const include scalar types, things without non-const fields, and pointers
44-
// to const things.
43+
// Freeze include scalar types, things without non-const fields, and pointers
44+
// to freezable things.
4545
//
4646
// This pass ensures that type parameters are only instantiated with types
4747
// whose kinds are equal or less general than the way the type parameter was
48-
// annotated (with the `send`, `copy` or `const` keyword).
48+
// annotated (with the `Send`, `Copy` or `Freeze` bound).
4949
//
5050
// It also verifies that noncopyable kinds are not copied. Sendability is not
5151
// applied, since none of our language primitives send. Instead, the sending

trunk/src/librustc/middle/lang_items.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
// Language items are items that represent concepts intrinsic to the language
1414
// itself. Examples are:
1515
//
16-
// * Traits that specify "kinds"; e.g. "const", "copy", "send".
16+
// * Traits that specify "kinds"; e.g. "Freeze", "Copy", "Send".
1717
//
18-
// * Traits that represent operators; e.g. "add", "sub", "index".
18+
// * Traits that represent operators; e.g. "Add", "Sub", "Index".
1919
//
2020
// * Functions called by the compiler itself.
2121

@@ -99,7 +99,7 @@ impl LanguageItems {
9999

100100
pub fn item_name(index: uint) -> &'static str {
101101
match index {
102-
0 => "const",
102+
0 => "freeze",
103103
1 => "copy",
104104
2 => "send",
105105
3 => "sized",

trunk/src/librustc/middle/ty.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ pub enum BuiltinBound {
687687
BoundCopy,
688688
BoundStatic,
689689
BoundSend,
690-
BoundConst,
690+
BoundFreeze,
691691
BoundSized,
692692
}
693693

@@ -700,7 +700,7 @@ pub fn AllBuiltinBounds() -> BuiltinBounds {
700700
set.add(BoundCopy);
701701
set.add(BoundStatic);
702702
set.add(BoundSend);
703-
set.add(BoundConst);
703+
set.add(BoundFreeze);
704704
set.add(BoundSized);
705705
set
706706
}
@@ -1838,7 +1838,7 @@ impl TypeContents {
18381838
match bb {
18391839
BoundCopy => self.is_copy(cx),
18401840
BoundStatic => self.is_static(cx),
1841-
BoundConst => self.is_const(cx),
1841+
BoundFreeze => self.is_freezable(cx),
18421842
BoundSend => self.is_sendable(cx),
18431843
BoundSized => self.is_sized(cx),
18441844
}
@@ -1877,11 +1877,11 @@ impl TypeContents {
18771877
self.intersects(TC_MANAGED)
18781878
}
18791879

1880-
pub fn is_const(&self, cx: ctxt) -> bool {
1881-
!self.intersects(TypeContents::nonconst(cx))
1880+
pub fn is_freezable(&self, cx: ctxt) -> bool {
1881+
!self.intersects(TypeContents::nonfreezable(cx))
18821882
}
18831883

1884-
pub fn nonconst(_cx: ctxt) -> TypeContents {
1884+
pub fn nonfreezable(_cx: ctxt) -> TypeContents {
18851885
TC_MUTABLE
18861886
}
18871887

@@ -1990,8 +1990,8 @@ pub fn type_is_sendable(cx: ctxt, t: ty::t) -> bool {
19901990
type_contents(cx, t).is_sendable(cx)
19911991
}
19921992

1993-
pub fn type_is_const(cx: ctxt, t: ty::t) -> bool {
1994-
type_contents(cx, t).is_const(cx)
1993+
pub fn type_is_freezable(cx: ctxt, t: ty::t) -> bool {
1994+
type_contents(cx, t).is_freezable(cx)
19951995
}
19961996

19971997
pub fn type_contents(cx: ctxt, ty: t) -> TypeContents {
@@ -2045,7 +2045,7 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents {
20452045
let _i = indenter();
20462046

20472047
let result = match get(ty).sty {
2048-
// Scalar and unique types are sendable, constant, and durable
2048+
// Scalar and unique types are sendable, freezable, and durable
20492049
ty_nil | ty_bot | ty_bool | ty_int(_) | ty_uint(_) | ty_float(_) |
20502050
ty_bare_fn(_) | ty_ptr(_) => {
20512051
TC_NONE
@@ -2317,7 +2317,7 @@ pub fn type_contents(cx: ctxt, ty: t) -> TypeContents {
23172317
BoundCopy => TypeContents::noncopyable(cx),
23182318
BoundStatic => TypeContents::nonstatic(cx),
23192319
BoundSend => TypeContents::nonsendable(cx),
2320-
BoundConst => TypeContents::nonconst(cx),
2320+
BoundFreeze => TypeContents::nonfreezable(cx),
23212321
// The dynamic-size bit can be removed at pointer-level, etc.
23222322
BoundSized => TypeContents::dynamically_sized(cx),
23232323
};

trunk/src/librustc/middle/typeck/astconv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,8 +818,8 @@ pub fn try_add_builtin_trait(tcx: ty::ctxt,
818818
} else if trait_def_id == li.copy_trait() {
819819
builtin_bounds.add(ty::BoundCopy);
820820
true
821-
} else if trait_def_id == li.const_trait() {
822-
builtin_bounds.add(ty::BoundConst);
821+
} else if trait_def_id == li.freeze_trait() {
822+
builtin_bounds.add(ty::BoundFreeze);
823823
true
824824
} else if trait_def_id == li.sized_trait() {
825825
builtin_bounds.add(ty::BoundSized);

trunk/src/librustc/util/ppaux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ impl Repr for ty::ParamBounds {
576576
ty::BoundCopy => ~"Copy",
577577
ty::BoundStatic => ~"'static",
578578
ty::BoundSend => ~"Send",
579-
ty::BoundConst => ~"Const",
579+
ty::BoundFreeze => ~"Freeze",
580580
ty::BoundSized => ~"Sized",
581581
});
582582
}
@@ -782,7 +782,7 @@ impl UserString for ty::BuiltinBound {
782782
ty::BoundCopy => ~"Copy",
783783
ty::BoundStatic => ~"'static",
784784
ty::BoundSend => ~"Send",
785-
ty::BoundConst => ~"Const",
785+
ty::BoundFreeze => ~"Freeze",
786786
ty::BoundSized => ~"Sized",
787787
}
788788
}

trunk/src/libstd/kinds.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ The 4 kinds are
2727
* Owned - owned types and types containing owned types. These types
2828
may be transferred across task boundaries.
2929
30-
* Const - types that are deeply immutable. Const types are used for
31-
freezable data structures.
30+
* Freeze - types that are deeply immutable.
3231
3332
`Copy` types include both implicitly copyable types that the compiler
3433
will copy automatically and non-implicitly copyable types that require
@@ -56,9 +55,16 @@ pub trait Owned {
5655
// empty.
5756
}
5857

58+
#[cfg(stage0)]
5959
#[lang="const"]
6060
pub trait Const {
61-
// Empty.
61+
// empty.
62+
}
63+
64+
#[cfg(not(stage0))]
65+
#[lang="freeze"]
66+
pub trait Const {
67+
// empty.
6268
}
6369

6470
#[lang="sized"]

trunk/src/libstd/prelude.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ Rust's prelude has three main parts:
2929

3030
// Reexported core operators
3131
pub use either::{Either, Left, Right};
32-
pub use kinds::{Const, Copy, Owned, Sized};
32+
pub use kinds::{Copy, Sized};
33+
pub use kinds::{Const, Owned};
3334
pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
3435
pub use ops::{BitAnd, BitOr, BitXor};
3536
pub use ops::{Drop};

0 commit comments

Comments
 (0)