Skip to content

Commit ef53747

Browse files
committed
---
yaml --- r: 139171 b: refs/heads/try2 c: 2cbfe6d h: refs/heads/master i: 139169: 48b4dbf 139167: 53d076a v: v3
1 parent 4f9f1cc commit ef53747

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+665
-511
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 334e9214216c481f9f4f7979fb33cebe518573a2
8+
refs/heads/try2: 2cbfe6d19d2feb531b746217a6313474755bf025
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/tutorial.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -579,29 +579,20 @@ Structs are quite similar to C structs and are even laid out the same way in
579579
memory (so you can read from a Rust struct in C, and vice-versa). Use the dot
580580
operator to access struct fields, as in `mypoint.x`.
581581

582-
~~~~
583-
struct Point {
584-
x: float,
585-
y: float
586-
}
587-
~~~~
588-
589582
Inherited mutability means that any field of a struct may be mutable, if the
590583
struct is in a mutable slot (or a field of a struct in a mutable slot, and
591584
so forth).
592585

593-
With a value (say, `mypoint`) of such a type in a mutable location, you can do
594-
`mypoint.y += 1.0`. But in an immutable location, such an assignment to a
595-
struct without inherited mutability would result in a type error.
596-
597-
~~~~ {.xfail-test}
598-
# struct Point { x: float, y: float }
599-
let mut mypoint = Point { x: 1.0, y: 1.0 };
600-
let origin = Point { x: 0.0, y: 0.0 };
601-
602-
mypoint.y += 1.0; // mypoint is mutable, and its fields as well
603-
origin.y += 1.0; // ERROR: assigning to immutable field
604586
~~~~
587+
struct Stack {
588+
content: ~[int],
589+
head: uint
590+
}
591+
~~~~
592+
593+
With a value (say, `mystack`) of such a type in a mutable location, you can do
594+
`mystack.head += 1`. But in an immutable location, such an assignment to a
595+
struct without inherited mutability would result in a type error.
605596

606597
`match` patterns destructure structs. The basic syntax is
607598
`Name { fieldname: pattern, ... }`:

branches/try2/mk/install.mk

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@ install-host: $(CSREQ$(ISTAGE)_T_$(CFG_BUILD_TRIPLE)_H_$(CFG_BUILD_TRIPLE))
113113
$(Q)$(call INSTALL,$(HB2),$(PHB),rustdoc$(X_$(CFG_BUILD_TRIPLE)))
114114
$(Q)$(call INSTALL,$(HB2),$(PHB),rusti$(X_$(CFG_BUILD_TRIPLE)))
115115
$(Q)$(call INSTALL,$(HB2),$(PHB),rust$(X_$(CFG_BUILD_TRIPLE)))
116-
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_LIBRUSTC_$(CFG_BUILD_TRIPLE)))
117-
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_LIBRUSTPKG_$(CFG_BUILD_TRIPLE)))
118-
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_LIBRUSTDOC_$(CFG_BUILD_TRIPLE)))
119-
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_LIBRUSTI_$(CFG_BUILD_TRIPLE)))
120-
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_LIBRUST_$(CFG_BUILD_TRIPLE)))
121116
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(CORELIB_GLOB_$(CFG_BUILD_TRIPLE)))
122117
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(STDLIB_GLOB_$(CFG_BUILD_TRIPLE)))
123118
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(LIBRUSTC_GLOB_$(CFG_BUILD_TRIPLE)))
@@ -142,11 +137,6 @@ uninstall:
142137
$(Q)rm -f $(PHB)/rust$(X_$(CFG_BUILD_TRIPLE))
143138
$(Q)rm -f $(PHB)/rustdoc$(X_$(CFG_BUILD_TRIPLE))
144139
$(Q)rm -f $(PHL)/$(CFG_RUSTLLVM_$(CFG_BUILD_TRIPLE))
145-
$(Q)rm -f $(PHL)/$(CFG_LIBRUSTPKG_$(CFG_BUILD_TRIPLE))
146-
$(Q)rm -f $(PHL)/$(CFG_LIBRUSTC_$(CFG_BUILD_TRIPLE))
147-
$(Q)rm -f $(PHL)/$(CFG_LIBRUSTDOC_$(CFG_BUILD_TRIPLE))
148-
$(Q)rm -f $(PHL)/$(CFG_LIBRUSTI_$(CFG_BUILD_TRIPLE))
149-
$(Q)rm -f $(PHL)/$(CFG_LIBRUST_$(CFG_BUILD_TRIPLE))
150140
$(Q)rm -f $(PHL)/$(CFG_RUNTIME_$(CFG_BUILD_TRIPLE))
151141
$(Q)for i in \
152142
$(call HOST_LIB_FROM_HL_GLOB,$(CORELIB_GLOB_$(CFG_BUILD_TRIPLE))) \

branches/try2/src/libcore/condition.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ struct Guard<T, U> {
8484
cond: &'self Condition/&self<T, U>
8585
}
8686

87-
#[unsafe_destructor]
8887
impl<T, U> Drop for Guard/&self<T, U> {
8988
fn finalize(&self) {
9089
unsafe {

branches/try2/src/libcore/core.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ pub use path::WindowsPath;
198198
pub use path::PosixPath;
199199

200200
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
201-
pub use str::{StrSlice};
201+
pub use str::{StrSlice, Trimmable};
202202
pub use container::{Container, Mutable};
203203
pub use vec::{CopyableVector, ImmutableVector};
204204
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};

branches/try2/src/libcore/io.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,17 +1230,15 @@ pub mod fsync {
12301230
arg: Arg<t>,
12311231
}
12321232

1233-
#[unsafe_destructor]
12341233
impl<T:Copy> Drop for Res<T> {
12351234
fn finalize(&self) {
1236-
match self.arg.opt_level {
1237-
None => (),
1238-
Some(level) => {
1239-
// fail hard if not succesful
1240-
fail_unless!(((self.arg.fsync_fn)(self.arg.val, level)
1241-
!= -1));
1242-
}
1235+
match self.arg.opt_level {
1236+
None => (),
1237+
Some(level) => {
1238+
// fail hard if not succesful
1239+
fail_unless!(((self.arg.fsync_fn)(self.arg.val, level) != -1));
12431240
}
1241+
}
12441242
}
12451243
}
12461244

branches/try2/src/libcore/managed.rs

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -49,43 +49,23 @@ pub pure fn mut_ptr_eq<T>(a: @mut T, b: @mut T) -> bool {
4949
}
5050

5151
#[cfg(notest)]
52-
impl<T:Eq> Eq for @T {
52+
impl<T:Eq> Eq for @const T {
5353
#[inline(always)]
54-
pure fn eq(&self, other: &@T) -> bool { *(*self) == *(*other) }
54+
pure fn eq(&self, other: &@const T) -> bool { *(*self) == *(*other) }
5555
#[inline(always)]
56-
pure fn ne(&self, other: &@T) -> bool { *(*self) != *(*other) }
56+
pure fn ne(&self, other: &@const T) -> bool { *(*self) != *(*other) }
5757
}
5858

5959
#[cfg(notest)]
60-
impl<T:Eq> Eq for @mut T {
60+
impl<T:Ord> Ord for @const T {
6161
#[inline(always)]
62-
pure fn eq(&self, other: &@mut T) -> bool { *(*self) == *(*other) }
62+
pure fn lt(&self, other: &@const T) -> bool { *(*self) < *(*other) }
6363
#[inline(always)]
64-
pure fn ne(&self, other: &@mut T) -> bool { *(*self) != *(*other) }
65-
}
66-
67-
#[cfg(notest)]
68-
impl<T:Ord> Ord for @T {
69-
#[inline(always)]
70-
pure fn lt(&self, other: &@T) -> bool { *(*self) < *(*other) }
71-
#[inline(always)]
72-
pure fn le(&self, other: &@T) -> bool { *(*self) <= *(*other) }
73-
#[inline(always)]
74-
pure fn ge(&self, other: &@T) -> bool { *(*self) >= *(*other) }
75-
#[inline(always)]
76-
pure fn gt(&self, other: &@T) -> bool { *(*self) > *(*other) }
77-
}
78-
79-
#[cfg(notest)]
80-
impl<T:Ord> Ord for @mut T {
81-
#[inline(always)]
82-
pure fn lt(&self, other: &@mut T) -> bool { *(*self) < *(*other) }
83-
#[inline(always)]
84-
pure fn le(&self, other: &@mut T) -> bool { *(*self) <= *(*other) }
64+
pure fn le(&self, other: &@const T) -> bool { *(*self) <= *(*other) }
8565
#[inline(always)]
86-
pure fn ge(&self, other: &@mut T) -> bool { *(*self) >= *(*other) }
66+
pure fn ge(&self, other: &@const T) -> bool { *(*self) >= *(*other) }
8767
#[inline(always)]
88-
pure fn gt(&self, other: &@mut T) -> bool { *(*self) > *(*other) }
68+
pure fn gt(&self, other: &@const T) -> bool { *(*self) > *(*other) }
8969
}
9070

9171
#[test]

branches/try2/src/libcore/option.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,6 @@ fn test_unwrap_resource() {
514514
i: @mut int,
515515
}
516516

517-
#[unsafe_destructor]
518517
impl ::ops::Drop for R {
519518
fn finalize(&self) { *(self.i) += 1; }
520519
}

branches/try2/src/libcore/pipes.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ struct BufferResource<T> {
350350
351351
}
352352
353-
#[unsafe_destructor]
354353
impl<T> ::ops::Drop for BufferResource<T> {
355354
fn finalize(&self) {
356355
unsafe {
@@ -446,17 +445,16 @@ pub fn try_recv<T:Owned,Tbuffer:Owned>(p: RecvPacketBuffered<T, Tbuffer>)
446445
let p_ = p.unwrap();
447446
let p = unsafe { &*p_ };
448447
449-
#[unsafe_destructor]
450448
struct DropState {
451449
p: &'self PacketHeader,
452450
453451
drop {
454-
unsafe {
455-
if task::failing() {
456-
self.p.state = Terminated;
457-
let old_task = swap_task(&mut self.p.blocked_task,
458-
ptr::null());
459-
if !old_task.is_null() {
452+
if task::failing() {
453+
self.p.state = Terminated;
454+
let old_task = swap_task(&mut self.p.blocked_task,
455+
ptr::null());
456+
if !old_task.is_null() {
457+
unsafe {
460458
rustrt::rust_task_deref(old_task);
461459
}
462460
}
@@ -775,7 +773,6 @@ pub struct SendPacketBuffered<T, Tbuffer> {
775773
mut buffer: Option<BufferResource<Tbuffer>>,
776774
}
777775
778-
#[unsafe_destructor]
779776
impl<T:Owned,Tbuffer:Owned> ::ops::Drop for SendPacketBuffered<T,Tbuffer> {
780777
fn finalize(&self) {
781778
//if self.p != none {
@@ -845,7 +842,6 @@ pub struct RecvPacketBuffered<T, Tbuffer> {
845842
mut buffer: Option<BufferResource<Tbuffer>>,
846843
}
847844
848-
#[unsafe_destructor]
849845
impl<T:Owned,Tbuffer:Owned> ::ops::Drop for RecvPacketBuffered<T,Tbuffer> {
850846
fn finalize(&self) {
851847
//if self.p != none {

branches/try2/src/libcore/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub use path::Path;
3636
pub use path::PosixPath;
3737
pub use path::WindowsPath;
3838
pub use ptr::Ptr;
39-
pub use str::{StrSlice, OwnedStr};
39+
pub use str::{StrSlice, Trimmable, OwnedStr};
4040
pub use to_bytes::IterBytes;
4141
pub use to_str::ToStr;
4242
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};

0 commit comments

Comments
 (0)