Skip to content

Commit cf582d7

Browse files
committed
Rename Const/Owned in more places
1 parent c379280 commit cf582d7

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/librustc/middle/typeck/astconv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ fn conv_builtin_bounds(tcx: ty::ctxt, ast_bounds: &Option<OptVec<ast::TyParamBou
788788
}
789789
builtin_bounds
790790
},
791-
// ~Trait is sugar for ~Trait:Owned.
791+
// ~Trait is sugar for ~Trait:Send.
792792
(&None, ty::UniqTraitStore) => {
793793
let mut set = ty::EmptyBuiltinBounds(); set.add(ty::BoundSend); set
794794
}

src/test/compile-fail/trait-bounds-sugar.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
trait Foo {
1414
}
1515

16-
fn a(_x: ~Foo) { // should be same as ~Foo:Owned
16+
fn a(_x: ~Foo) { // should be same as ~Foo:Send
1717
}
1818

1919
fn b(_x: @Foo) { // should be same as ~Foo:'static
@@ -22,15 +22,15 @@ fn b(_x: @Foo) { // should be same as ~Foo:'static
2222
fn c(_x: &'static Foo) { // should be same as &'static Foo:'static
2323
}
2424

25-
fn d(x: ~Foo:Const) {
26-
a(x); //~ ERROR expected bounds `Owned`
25+
fn d(x: ~Foo:Freeze) {
26+
a(x); //~ ERROR expected bounds `Send`
2727
}
2828

29-
fn e(x: @Foo:Const) {
29+
fn e(x: @Foo:Freeze) {
3030
b(x); //~ ERROR expected bounds `'static`
3131
}
3232

33-
fn f(x: &'static Foo:Const) {
33+
fn f(x: &'static Foo:Freeze) {
3434
c(x); //~ ERROR expected bounds `'static`
3535
}
3636

src/test/run-pass/trait-bounds-in-arc.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
// Tests that a heterogeneous list of existential types can be put inside an ARC
12-
// and shared between tasks as long as all types fulfill Const+Owned.
12+
// and shared between tasks as long as all types fulfill Freeze+Send.
1313

1414
// xfail-fast
1515

@@ -64,10 +64,10 @@ fn main() {
6464
let dogge1 = Dogge { bark_decibels: 100, tricks_known: 42, name: ~"alan_turing" };
6565
let dogge2 = Dogge { bark_decibels: 55, tricks_known: 11, name: ~"albert_einstein" };
6666
let fishe = Goldfyshe { swim_speed: 998, name: ~"alec_guinness" };
67-
let arc = arc::ARC(~[~catte as ~Pet:Const+Owned,
68-
~dogge1 as ~Pet:Const+Owned,
69-
~fishe as ~Pet:Const+Owned,
70-
~dogge2 as ~Pet:Const+Owned]);
67+
let arc = arc::ARC(~[~catte as ~Pet:Freeze+Send,
68+
~dogge1 as ~Pet:Freeze+Send,
69+
~fishe as ~Pet:Freeze+Send,
70+
~dogge2 as ~Pet:Freeze+Send]);
7171
let (p1,c1) = comm::stream();
7272
let arc1 = cell::Cell::new(arc.clone());
7373
do task::spawn { check_legs(arc1.take()); c1.send(()); }
@@ -82,21 +82,21 @@ fn main() {
8282
p3.recv();
8383
}
8484

85-
fn check_legs(arc: arc::ARC<~[~Pet:Const+Owned]>) {
85+
fn check_legs(arc: arc::ARC<~[~Pet:Freeze+Send]>) {
8686
let mut legs = 0;
8787
for arc.get().iter().advance |pet| {
8888
legs += pet.num_legs();
8989
}
9090
assert!(legs == 12);
9191
}
92-
fn check_names(arc: arc::ARC<~[~Pet:Const+Owned]>) {
92+
fn check_names(arc: arc::ARC<~[~Pet:Freeze+Send]>) {
9393
for arc.get().iter().advance |pet| {
9494
do pet.name |name| {
9595
assert!(name[0] == 'a' as u8 && name[1] == 'l' as u8);
9696
}
9797
}
9898
}
99-
fn check_pedigree(arc: arc::ARC<~[~Pet:Const+Owned]>) {
99+
fn check_pedigree(arc: arc::ARC<~[~Pet:Freeze+Send]>) {
100100
for arc.get().iter().advance |pet| {
101101
assert!(pet.of_good_pedigree());
102102
}

0 commit comments

Comments
 (0)