Skip to content

Commit 3d69e96

Browse files
committed
---
yaml --- r: 63694 b: refs/heads/snap-stage3 c: 22408d9 h: refs/heads/master v: v3
1 parent b0fdefc commit 3d69e96

File tree

203 files changed

+474
-553
lines changed

Some content is hidden

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

203 files changed

+474
-553
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 5d3ca4b8439d043dc77c19424348fac670acc46f
4+
refs/heads/snap-stage3: 22408d9ad536975002b4d43f232033eca4482741
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/tutorial-ffi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl<T: Owned> Unique<T> {
183183
184184
#[unsafe_destructor]
185185
impl<T: Owned> Drop for Unique<T> {
186-
fn finalize(&self) {
186+
fn drop(&self) {
187187
unsafe {
188188
let x = intrinsics::init(); // dummy value to swap in
189189
// moving the object out is needed to call the destructor

branches/snap-stage3/doc/tutorial.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,7 @@ types by the compiler, and may not be overridden:
20102010
> iterations of the language, and often still are.
20112011
20122012
Additionally, the `Drop` trait is used to define destructors. This
2013-
trait defines one method called `finalize`, which is automatically
2013+
trait defines one method called `drop`, which is automatically
20142014
called when a value of the type that implements this trait is
20152015
destroyed, either because the value went out of scope or because the
20162016
garbage collector reclaimed it.
@@ -2021,15 +2021,15 @@ struct TimeBomb {
20212021
}
20222022
20232023
impl Drop for TimeBomb {
2024-
fn finalize(&self) {
2024+
fn drop(&self) {
20252025
for self.explosivity.times {
20262026
println("blam!");
20272027
}
20282028
}
20292029
}
20302030
~~~
20312031

2032-
It is illegal to call `finalize` directly. Only code inserted by the compiler
2032+
It is illegal to call `drop` directly. Only code inserted by the compiler
20332033
may call it.
20342034

20352035
## Declaring and implementing traits

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,9 @@ pub fn make_test(config: &config, testfile: &Path) -> test::TestDescAndFn {
254254
}
255255

256256
pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
257-
258-
// Try to elide redundant long paths
259-
fn shorten(path: &Path) -> ~str {
260-
let filename = path.filename();
261-
let dir = path.pop().filename();
262-
fmt!("%s/%s", dir.get_or_default(~""), filename.get_or_default(~""))
263-
}
264-
265257
test::DynTestName(fmt!("[%s] %s",
266258
mode_str(config.mode),
267-
shorten(testfile)))
259+
testfile.to_str()))
268260
}
269261

270262
pub fn make_test_closure(config: &config, testfile: &Path) -> test::TestFn {

branches/snap-stage3/src/etc/vim/syntax/rust.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
" Language: Rust
33
" Maintainer: Patrick Walton <[email protected]>
44
" Maintainer: Ben Blum <[email protected]>
5-
" Last Change: 2013 Jun 14
5+
" Last Change: 2012 Jun 14
66

77
if version < 600
88
syntax clear
@@ -15,7 +15,7 @@ syn keyword rustOperator as
1515

1616
syn match rustAssert "\<assert\(\w\)*!"
1717
syn match rustFail "\<fail\(\w\)*!"
18-
syn keyword rustKeyword break copy do drop extern
18+
syn keyword rustKeyword break copy do extern
1919
syn keyword rustKeyword for if impl let log
2020
syn keyword rustKeyword copy do extern
2121
syn keyword rustKeyword for impl let log

branches/snap-stage3/src/libextra/arc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
* ~~~ {.rust}
2121
* extern mod std;
22-
* use extra::arc;
22+
* use std::arc;
2323
* let numbers=vec::from_fn(100, |ind| (ind as float)*rand::random());
2424
* let shared_numbers=arc::ARC(numbers);
2525
*
@@ -247,7 +247,7 @@ struct PoisonOnFail {
247247
}
248248

249249
impl Drop for PoisonOnFail {
250-
fn finalize(&self) {
250+
fn drop(&self) {
251251
unsafe {
252252
/* assert!(!*self.failed);
253253
-- might be false in case of cond.wait() */

branches/snap-stage3/src/libextra/arena.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub struct Arena {
7777

7878
#[unsafe_destructor]
7979
impl Drop for Arena {
80-
fn finalize(&self) {
80+
fn drop(&self) {
8181
unsafe {
8282
destroy_chunk(&self.head);
8383
for self.chunks.each |chunk| {

branches/snap-stage3/src/libextra/base64.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ impl<'self> ToBase64 for &'self [u8] {
3636
* # Example
3737
*
3838
* ~~~ {.rust}
39-
* extern mod extra;
40-
* use extra::base64::ToBase64;
39+
* extern mod std;
40+
* use std::base64::ToBase64;
4141
*
4242
* fn main () {
4343
* let str = [52,32].to_base64();
@@ -99,8 +99,8 @@ impl<'self> ToBase64 for &'self str {
9999
* # Example
100100
*
101101
* ~~~ {.rust}
102-
* extern mod extra;
103-
* use extra::base64::ToBase64;
102+
* extern mod std;
103+
* use std::base64::ToBase64;
104104
*
105105
* fn main () {
106106
* let str = "Hello, World".to_base64();
@@ -127,9 +127,9 @@ impl<'self> FromBase64 for &'self [u8] {
127127
* # Example
128128
*
129129
* ~~~ {.rust}
130-
* extern mod extra;
131-
* use extra::base64::ToBase64;
132-
* use extra::base64::FromBase64;
130+
* extern mod std;
131+
* use std::base64::ToBase64;
132+
* use std::base64::FromBase64;
133133
*
134134
* fn main () {
135135
* let str = [52,32].to_base64();
@@ -207,9 +207,9 @@ impl<'self> FromBase64 for &'self str {
207207
* This converts a string literal to base64 and back.
208208
*
209209
* ~~~ {.rust}
210-
* extern mod extra;
211-
* use extra::base64::ToBase64;
212-
* use extra::base64::FromBase64;
210+
* extern mod std;
211+
* use std::base64::ToBase64;
212+
* use std::base64::FromBase64;
213213
* use core::str;
214214
*
215215
* fn main () {

branches/snap-stage3/src/libextra/c_vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct DtorRes {
5757

5858
#[unsafe_destructor]
5959
impl Drop for DtorRes {
60-
fn finalize(&self) {
60+
fn drop(&self) {
6161
match self.dtor {
6262
option::None => (),
6363
option::Some(f) => f()

branches/snap-stage3/src/libextra/future.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* ~~~ {.rust}
1818
* # fn fib(n: uint) -> uint {42};
1919
* # fn make_a_sandwich() {};
20-
* let mut delayed_fib = extra::future::spawn (|| fib(5000) );
20+
* let mut delayed_fib = std::future::spawn (|| fib(5000) );
2121
* make_a_sandwich();
2222
* println(fmt!("fib(5000) = %?", delayed_fib.get()))
2323
* ~~~
@@ -44,7 +44,7 @@ pub struct Future<A> {
4444
// over ~fn's that have pipes and so forth within!
4545
#[unsafe_destructor]
4646
impl<A> Drop for Future<A> {
47-
fn finalize(&self) {}
47+
fn drop(&self) {}
4848
}
4949

5050
priv enum FutureState<A> {

branches/snap-stage3/src/libextra/net_ip.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub struct ParseAddrErr {
5555
*
5656
* # Arguments
5757
*
58-
* * ip - a `extra::net::ip::IpAddr`
58+
* * ip - a `std::net::ip::IpAddr`
5959
*/
6060
pub fn format_addr(ip: &IpAddr) -> ~str {
6161
match *ip {
@@ -80,7 +80,7 @@ pub fn format_addr(ip: &IpAddr) -> ~str {
8080
* Get the associated port
8181
*
8282
* # Arguments
83-
* * ip - a `extra::net::ip::IpAddr`
83+
* * ip - a `std::net::ip::IpAddr`
8484
*/
8585
pub fn get_port(ip: &IpAddr) -> uint {
8686
match *ip {

branches/snap-stage3/src/libextra/net_tcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub struct TcpSocket {
5757

5858
#[unsafe_destructor]
5959
impl Drop for TcpSocket {
60-
fn finalize(&self) {
60+
fn drop(&self) {
6161
tear_down_socket_data(self.socket_data)
6262
}
6363
}

branches/snap-stage3/src/libextra/rc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<T> Rc<T> {
6868

6969
#[unsafe_destructor]
7070
impl<T> Drop for Rc<T> {
71-
fn finalize(&self) {
71+
fn drop(&self) {
7272
unsafe {
7373
if self.ptr.is_not_null() {
7474
(*self.ptr).count -= 1;
@@ -220,7 +220,7 @@ impl<T> RcMut<T> {
220220

221221
#[unsafe_destructor]
222222
impl<T> Drop for RcMut<T> {
223-
fn finalize(&self) {
223+
fn drop(&self) {
224224
unsafe {
225225
if self.ptr.is_not_null() {
226226
(*self.ptr).count -= 1;

branches/snap-stage3/src/libextra/sort.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ mod big_tests {
12071207

12081208
#[unsafe_destructor]
12091209
impl<'self> Drop for LVal<'self> {
1210-
fn finalize(&self) {
1210+
fn drop(&self) {
12111211
let x = unsafe { local_data::local_data_get(self.key) };
12121212
match x {
12131213
Some(@y) => {

branches/snap-stage3/src/libextra/sync.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ struct SemReleaseGeneric<'self, Q> { sem: &'self Sem<Q> }
176176
#[doc(hidden)]
177177
#[unsafe_destructor]
178178
impl<'self, Q:Owned> Drop for SemReleaseGeneric<'self, Q> {
179-
fn finalize(&self) {
179+
fn drop(&self) {
180180
self.sem.release();
181181
}
182182
}
@@ -219,7 +219,7 @@ pub struct Condvar<'self> {
219219
}
220220

221221
#[unsafe_destructor]
222-
impl<'self> Drop for Condvar<'self> { fn finalize(&self) {} }
222+
impl<'self> Drop for Condvar<'self> { fn drop(&self) {} }
223223

224224
impl<'self> Condvar<'self> {
225225
/**
@@ -295,7 +295,7 @@ impl<'self> Condvar<'self> {
295295

296296
#[unsafe_destructor]
297297
impl<'self> Drop for CondvarReacquire<'self> {
298-
fn finalize(&self) {
298+
fn drop(&self) {
299299
unsafe {
300300
// Needs to succeed, instead of itself dying.
301301
do task::unkillable {
@@ -689,7 +689,7 @@ struct RWlockReleaseRead<'self> {
689689
#[doc(hidden)]
690690
#[unsafe_destructor]
691691
impl<'self> Drop for RWlockReleaseRead<'self> {
692-
fn finalize(&self) {
692+
fn drop(&self) {
693693
unsafe {
694694
do task::unkillable {
695695
let state = &mut *self.lock.state.get();
@@ -726,7 +726,7 @@ struct RWlockReleaseDowngrade<'self> {
726726
#[doc(hidden)]
727727
#[unsafe_destructor]
728728
impl<'self> Drop for RWlockReleaseDowngrade<'self> {
729-
fn finalize(&self) {
729+
fn drop(&self) {
730730
unsafe {
731731
do task::unkillable {
732732
let writer_or_last_reader;
@@ -769,12 +769,12 @@ fn RWlockReleaseDowngrade<'r>(lock: &'r RWlock)
769769
/// The "write permission" token used for rwlock.write_downgrade().
770770
pub struct RWlockWriteMode<'self> { priv lock: &'self RWlock }
771771
#[unsafe_destructor]
772-
impl<'self> Drop for RWlockWriteMode<'self> { fn finalize(&self) {} }
772+
impl<'self> Drop for RWlockWriteMode<'self> { fn drop(&self) {} }
773773

774774
/// The "read permission" token used for rwlock.write_downgrade().
775775
pub struct RWlockReadMode<'self> { priv lock: &'self RWlock }
776776
#[unsafe_destructor]
777-
impl<'self> Drop for RWlockReadMode<'self> { fn finalize(&self) {} }
777+
impl<'self> Drop for RWlockReadMode<'self> { fn drop(&self) {} }
778778

779779
impl<'self> RWlockWriteMode<'self> {
780780
/// Access the pre-downgrade rwlock in write mode.
@@ -1105,7 +1105,7 @@ mod tests {
11051105
}
11061106

11071107
impl Drop for SendOnFailure {
1108-
fn finalize(&self) {
1108+
fn drop(&self) {
11091109
self.c.send(());
11101110
}
11111111
}

branches/snap-stage3/src/libextra/task_pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub struct TaskPool<T> {
3535

3636
#[unsafe_destructor]
3737
impl<T> Drop for TaskPool<T> {
38-
fn finalize(&self) {
38+
fn drop(&self) {
3939
for self.channels.iter().advance |channel| {
4040
channel.send(Quit);
4141
}

branches/snap-stage3/src/librustc/back/passes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct PassManager {
2323
}
2424

2525
impl Drop for PassManager {
26-
fn finalize(&self) {
26+
fn drop(&self) {
2727
unsafe {
2828
llvm::LLVMDisposePassManager(self.llpm);
2929
}

branches/snap-stage3/src/librustc/lib/llvm.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,7 @@ pub struct target_data_res {
22162216
}
22172217

22182218
impl Drop for target_data_res {
2219-
fn finalize(&self) {
2219+
fn drop(&self) {
22202220
unsafe {
22212221
llvm::LLVMDisposeTargetData(self.TD);
22222222
}
@@ -2253,7 +2253,7 @@ pub struct pass_manager_res {
22532253
}
22542254

22552255
impl Drop for pass_manager_res {
2256-
fn finalize(&self) {
2256+
fn drop(&self) {
22572257
unsafe {
22582258
llvm::LLVMDisposePassManager(self.PM);
22592259
}
@@ -2289,7 +2289,7 @@ pub struct object_file_res {
22892289
}
22902290

22912291
impl Drop for object_file_res {
2292-
fn finalize(&self) {
2292+
fn drop(&self) {
22932293
unsafe {
22942294
llvm::LLVMDisposeObjectFile(self.ObjectFile);
22952295
}
@@ -2326,7 +2326,7 @@ pub struct section_iter_res {
23262326
}
23272327

23282328
impl Drop for section_iter_res {
2329-
fn finalize(&self) {
2329+
fn drop(&self) {
23302330
unsafe {
23312331
llvm::LLVMDisposeSectionIterator(self.SI);
23322332
}

0 commit comments

Comments
 (0)