Skip to content

Commit dce682f

Browse files
pcwaltonemberian
authored andcommitted
---
yaml --- r: 66394 b: refs/heads/master c: 1eec3bb h: refs/heads/master v: v3
1 parent 5612054 commit dce682f

File tree

20 files changed

+43
-43
lines changed

20 files changed

+43
-43
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: d350981c0e8daa778d9760ba0e19b3157026e743
2+
refs/heads/master: 1eec3bba13fef50324d1a7542713b3189a627547
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libextra/arc.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ impl<'self> Condvar<'self> {
112112
pub struct ARC<T> { x: UnsafeAtomicRcBox<T> }
113113

114114
/// Create an atomically reference counted wrapper.
115-
pub fn ARC<T:Const + Owned>(data: T) -> ARC<T> {
115+
pub fn ARC<T:Freeze + Owned>(data: T) -> ARC<T> {
116116
ARC { x: UnsafeAtomicRcBox::new(data) }
117117
}
118118

119119
/**
120120
* Access the underlying data in an atomically reference counted
121121
* wrapper.
122122
*/
123-
impl<T:Const+Owned> ARC<T> {
123+
impl<T:Freeze+Owned> ARC<T> {
124124
pub fn get<'a>(&'a self) -> &'a T {
125125
unsafe { &*self.x.get_immut() }
126126
}
@@ -133,7 +133,7 @@ impl<T:Const+Owned> ARC<T> {
133133
* object. However, one of the `arc` objects can be sent to another task,
134134
* allowing them to share the underlying data.
135135
*/
136-
impl<T:Const + Owned> Clone for ARC<T> {
136+
impl<T:Freeze + Owned> Clone for ARC<T> {
137137
fn clone(&self) -> ARC<T> {
138138
ARC { x: self.x.clone() }
139139
}
@@ -282,14 +282,14 @@ struct RWARC<T> {
282282
}
283283

284284
/// Create a reader/writer ARC with the supplied data.
285-
pub fn RWARC<T:Const + Owned>(user_data: T) -> RWARC<T> {
285+
pub fn RWARC<T:Freeze + Owned>(user_data: T) -> RWARC<T> {
286286
rw_arc_with_condvars(user_data, 1)
287287
}
288288
/**
289289
* Create a reader/writer ARC with the supplied data and a specified number
290290
* of condvars (as sync::rwlock_with_condvars).
291291
*/
292-
pub fn rw_arc_with_condvars<T:Const + Owned>(
292+
pub fn rw_arc_with_condvars<T:Freeze + Owned>(
293293
user_data: T,
294294
num_condvars: uint) -> RWARC<T>
295295
{
@@ -299,7 +299,7 @@ pub fn rw_arc_with_condvars<T:Const + Owned>(
299299
RWARC { x: UnsafeAtomicRcBox::new(data), }
300300
}
301301

302-
impl<T:Const + Owned> RWARC<T> {
302+
impl<T:Freeze + Owned> RWARC<T> {
303303
/// Duplicate a rwlock-protected ARC, as arc::clone.
304304
pub fn clone(&self) -> RWARC<T> {
305305
RWARC {
@@ -309,7 +309,7 @@ impl<T:Const + Owned> RWARC<T> {
309309

310310
}
311311

312-
impl<T:Const + Owned> RWARC<T> {
312+
impl<T:Freeze + Owned> RWARC<T> {
313313
/**
314314
* Access the underlying data mutably. Locks the rwlock in write mode;
315315
* other readers and writers will block.
@@ -435,7 +435,7 @@ impl<T:Const + Owned> RWARC<T> {
435435
// lock it. This wraps the unsafety, with the justification that the 'lock'
436436
// field is never overwritten; only 'failed' and 'data'.
437437
#[doc(hidden)]
438-
fn borrow_rwlock<T:Const + Owned>(state: *const RWARCInner<T>) -> *RWlock {
438+
fn borrow_rwlock<T:Freeze + Owned>(state: *const RWARCInner<T>) -> *RWlock {
439439
unsafe { cast::transmute(&const (*state).lock) }
440440
}
441441

@@ -452,7 +452,7 @@ pub struct RWReadMode<'self, T> {
452452
token: sync::RWlockReadMode<'self>,
453453
}
454454

455-
impl<'self, T:Const + Owned> RWWriteMode<'self, T> {
455+
impl<'self, T:Freeze + Owned> RWWriteMode<'self, T> {
456456
/// Access the pre-downgrade RWARC in write mode.
457457
pub fn write<U>(&mut self, blk: &fn(x: &mut T) -> U) -> U {
458458
match *self {
@@ -493,7 +493,7 @@ impl<'self, T:Const + Owned> RWWriteMode<'self, T> {
493493
}
494494
}
495495

496-
impl<'self, T:Const + Owned> RWReadMode<'self, T> {
496+
impl<'self, T:Freeze + Owned> RWReadMode<'self, T> {
497497
/// Access the post-downgrade rwlock in read mode.
498498
pub fn read<U>(&self, blk: &fn(x: &T) -> U) -> U {
499499
match *self {

trunk/src/libextra/rc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
/** Task-local reference counted smart pointers
1414
1515
Task-local reference counted smart pointers are an alternative to managed boxes with deterministic
16-
destruction. They are restricted to containing types that are either `Owned` or `Const` (or both) to
16+
destruction. They are restricted to containing types that are either `Owned` or `Freeze` (or both) to
1717
prevent cycles.
1818
19-
Neither `Rc<T>` or `RcMut<T>` is ever `Owned` and `RcMut<T>` is never `Const`. If `T` is `Const`, a
19+
Neither `Rc<T>` or `RcMut<T>` is ever `Owned` and `RcMut<T>` is never `Freeze`. If `T` is `Freeze`, a
2020
cycle cannot be created with `Rc<T>` because there is no way to modify it after creation.
2121
2222
*/
@@ -56,7 +56,7 @@ pub fn rc_from_owned<T: Owned>(value: T) -> Rc<T> {
5656
}
5757

5858
// FIXME: #6516: should be a static method
59-
pub fn rc_from_const<T: Const>(value: T) -> Rc<T> {
59+
pub fn rc_from_const<T: Freeze>(value: T) -> Rc<T> {
6060
unsafe { Rc::new(value) }
6161
}
6262

@@ -190,7 +190,7 @@ pub fn rc_mut_from_owned<T: Owned>(value: T) -> RcMut<T> {
190190
}
191191

192192
// FIXME: #6516: should be a static method
193-
pub fn rc_mut_from_const<T: Const>(value: T) -> RcMut<T> {
193+
pub fn rc_mut_from_const<T: Freeze>(value: T) -> RcMut<T> {
194194
unsafe { RcMut::new(value) }
195195
}
196196

trunk/src/librustc/middle/borrowck/doc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,14 +539,14 @@ mutable borrowed pointers.
539539
540540
### Restrictions for loans of const aliasable pointees
541541
542-
Const pointers are read-only. There may be `&mut` or `&` aliases, and
542+
Freeze pointers are read-only. There may be `&mut` or `&` aliases, and
543543
we can not prevent *anything* but moves in that case. So the
544544
`RESTRICTIONS` function is only defined if `ACTIONS` is the empty set.
545545
Because moves from a `&const` or `@const` lvalue are never legal, it
546546
is not necessary to add any restrictions at all to the final
547547
result.
548548
549-
RESTRICTIONS(*LV, []) = [] // R-Deref-Const-Borrowed
549+
RESTRICTIONS(*LV, []) = [] // R-Deref-Freeze-Borrowed
550550
TYPE(LV) = &const Ty or @const Ty
551551
552552
### Restrictions for loans of mutable borrowed pointees

trunk/src/librustc/middle/borrowck/gather_loans/restrictions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl RestrictionsContext {
125125

126126
mc::cat_deref(_, _, mc::region_ptr(m_const, _)) |
127127
mc::cat_deref(_, _, mc::gc_ptr(m_const)) => {
128-
// R-Deref-Const-Borrowed
128+
// R-Deref-Freeze-Borrowed
129129
self.check_no_mutability_control(cmt, restrictions);
130130
Safe
131131
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ pub fn ty_generics(ccx: &CrateCtxt,
11651165
* enum consisting of a newtyped Ty or a region) to ty's
11661166
* notion of ty param bounds, which can either be user-defined
11671167
* traits, or one of the four built-in traits (formerly known
1168-
* as kinds): Const, Copy, and Send.
1168+
* as kinds): Freeze, Copy, and Send.
11691169
*/
11701170

11711171
let mut param_bounds = ty::ParamBounds {

trunk/src/librustdoc/markdown_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pub fn header_kind(doc: doc::ItemTag) -> ~str {
152152
~"Function"
153153
}
154154
doc::ConstTag(_) => {
155-
~"Const"
155+
~"Freeze"
156156
}
157157
doc::EnumTag(_) => {
158158
~"Enum"
@@ -786,7 +786,7 @@ mod test {
786786
#[test]
787787
fn should_write_const_header() {
788788
let markdown = render(~"static a: bool = true;");
789-
assert!(markdown.contains("## Const `a`\n\n"));
789+
assert!(markdown.contains("## Freeze `a`\n\n"));
790790
}
791791

792792
#[test]

trunk/src/libstd/clone.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ by convention implementing the `Clone` trait and calling the
2222
2323
*/
2424

25-
use core::kinds::Const;
25+
use core::kinds::Freeze;
2626

2727
/// A common trait for cloning an object.
2828
pub trait Clone {
@@ -113,16 +113,16 @@ impl<T: DeepClone> DeepClone for ~T {
113113
}
114114

115115
// FIXME: #6525: should also be implemented for `T: Owned + DeepClone`
116-
impl<T: Const + DeepClone> DeepClone for @T {
117-
/// Return a deep copy of the managed box. The `Const` trait is required to prevent performing
116+
impl<T: Freeze + DeepClone> DeepClone for @T {
117+
/// Return a deep copy of the managed box. The `Freeze` trait is required to prevent performing
118118
/// a deep clone of a potentially cyclical type.
119119
#[inline]
120120
fn deep_clone(&self) -> @T { @(**self).deep_clone() }
121121
}
122122

123123
// FIXME: #6525: should also be implemented for `T: Owned + DeepClone`
124-
impl<T: Const + DeepClone> DeepClone for @mut T {
125-
/// Return a deep copy of the managed box. The `Const` trait is required to prevent performing
124+
impl<T: Freeze + DeepClone> DeepClone for @mut T {
125+
/// Return a deep copy of the managed box. The `Freeze` trait is required to prevent performing
126126
/// a deep clone of a potentially cyclical type.
127127
#[inline]
128128
fn deep_clone(&self) -> @mut T { @mut (**self).deep_clone() }

trunk/src/libstd/kinds.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ pub trait Owned {
5757

5858
#[cfg(stage0)]
5959
#[lang="const"]
60-
pub trait Const {
60+
pub trait Freeze {
6161
// empty.
6262
}
6363

6464
#[cfg(not(stage0))]
6565
#[lang="freeze"]
66-
pub trait Const {
66+
pub trait Freeze {
6767
// empty.
6868
}
6969

trunk/src/libstd/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Rust's prelude has three main parts:
3030
// Reexported core operators
3131
pub use either::{Either, Left, Right};
3232
pub use kinds::{Copy, Sized};
33-
pub use kinds::{Const, Owned};
33+
pub use kinds::{Freeze, Owned};
3434
pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
3535
pub use ops::{BitAnd, BitOr, BitXor};
3636
pub use ops::{Drop};

trunk/src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ pub static crate_node_id: node_id = 0;
147147
// The AST represents all type param bounds as types.
148148
// typeck::collect::compute_bounds matches these against
149149
// the "special" built-in traits (see middle::lang_items) and
150-
// detects Copy, Send, Owned, and Const.
150+
// detects Copy, Send, Owned, and Freeze.
151151
pub enum TyParamBound {
152152
TraitTyParamBound(@trait_ref),
153153
RegionTyParamBound

trunk/src/libsyntax/parse/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ pub mod keywords {
563563
// Strict keywords
564564
As,
565565
Break,
566-
Const,
566+
Freeze,
567567
Copy,
568568
Do,
569569
Else,

trunk/src/libsyntax/util/interner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub struct Interner<T> {
2121
}
2222

2323
// when traits can extend traits, we should extend index<uint,T> to get []
24-
impl<T:Eq + IterBytes + Hash + Const + Copy> Interner<T> {
24+
impl<T:Eq + IterBytes + Hash + Freeze + Copy> Interner<T> {
2525
pub fn new() -> Interner<T> {
2626
Interner {
2727
map: @mut HashMap::new(),

trunk/src/test/auxiliary/issue-2526.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ struct arc_destruct<T> {
2020
}
2121

2222
#[unsafe_destructor]
23-
impl<T:Const> Drop for arc_destruct<T> {
23+
impl<T:Freeze> Drop for arc_destruct<T> {
2424
fn drop(&self) {}
2525
}
2626

27-
fn arc_destruct<T:Const>(data: int) -> arc_destruct<T> {
27+
fn arc_destruct<T:Freeze>(data: int) -> arc_destruct<T> {
2828
arc_destruct {
2929
_data: data
3030
}
3131
}
3232

33-
fn arc<T:Const>(_data: T) -> arc_destruct<T> {
33+
fn arc<T:Freeze>(_data: T) -> arc_destruct<T> {
3434
arc_destruct(0)
3535
}
3636

trunk/src/test/compile-fail/issue-2611-4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct E {
2020
}
2121

2222
impl A for E {
23-
fn b<F:Copy + Const,G>(_x: F) -> F { fail!() } //~ ERROR type parameter 0 requires `Const`
23+
fn b<F:Copy + Freeze,G>(_x: F) -> F { fail!() } //~ ERROR type parameter 0 requires `Freeze`
2424
}
2525

2626
fn main() {}

trunk/src/test/compile-fail/issue-3177-mutable-struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// xfail-test
1212
// error-pattern: instantiating a type parameter with an incompatible type
13-
struct S<T:Const> {
13+
struct S<T:Freeze> {
1414
s: T,
1515
cant_nest: ()
1616
}

trunk/src/test/compile-fail/mutable-enum.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#[mutable]
1212
enum Foo { A }
1313

14-
fn bar<T: Const>(_: T) {}
14+
fn bar<T: Freeze>(_: T) {}
1515

1616
fn main() {
1717
let x = A;
18-
bar(x); //~ ERROR instantiating a type parameter with an incompatible type `Foo`, which does not fulfill `Const`
18+
bar(x); //~ ERROR instantiating a type parameter with an incompatible type `Foo`, which does not fulfill `Freeze`
1919
}

trunk/src/test/compile-fail/mutable-struct.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#[mutable]
1212
struct Foo { a: int }
1313

14-
fn bar<T: Const>(_: T) {}
14+
fn bar<T: Freeze>(_: T) {}
1515

1616
fn main() {
1717
let x = Foo { a: 5 };
18-
bar(x); //~ ERROR instantiating a type parameter with an incompatible type `Foo`, which does not fulfill `Const`
18+
bar(x); //~ ERROR instantiating a type parameter with an incompatible type `Foo`, which does not fulfill `Freeze`
1919
}

trunk/src/test/run-pass/const-bound.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// are const.
1313

1414

15-
fn foo<T:Copy + Const>(x: T) -> T { x }
15+
fn foo<T:Copy + Freeze>(x: T) -> T { x }
1616

1717
struct F { field: int }
1818

trunk/src/test/run-pass/issue-2611-3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// than the traits require.
1313

1414
trait A {
15-
fn b<C:Copy + Const,D>(x: C) -> C;
15+
fn b<C:Copy + Freeze,D>(x: C) -> C;
1616
}
1717

1818
struct E {

0 commit comments

Comments
 (0)