Skip to content

Commit 5b0807c

Browse files
committed
---
yaml --- r: 66315 b: refs/heads/master c: c37ccac h: refs/heads/master i: 66313: e15f56c 66311: 59e55a9 v: v3
1 parent fb1b274 commit 5b0807c

File tree

175 files changed

+1033
-594
lines changed

Some content is hidden

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

175 files changed

+1033
-594
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: 8918461fc41576664719c12ce7d655aaad2c78d1
2+
refs/heads/master: c37ccac9313b52a8f4299b370fe33b0fbe202db4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/configure

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -834,9 +834,7 @@ do
834834
LLVM_TARGET="--target=$t"
835835

836836
# Disable unused LLVM features
837-
LLVM_OPTS="$LLVM_DBG_OPTS --disable-docs \
838-
--enable-bindings=none --disable-threads \
839-
--disable-pthreads"
837+
LLVM_OPTS="$LLVM_DBG_OPTS --disable-docs --enable-bindings=none"
840838

841839
case "$CFG_C_COMPILER" in
842840
("ccache clang")

trunk/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

trunk/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

trunk/mk/target.mk

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
# this exists can be found on issue #2400
1414
export CFG_COMPILER_TRIPLE
1515

16+
# The standard libraries should be held up to a higher standard than any old
17+
# code, make sure that these common warnings are denied by default. These can
18+
# be overridden during development temporarily. For stage0, we allow all these
19+
# to suppress warnings which may be bugs in stage0 (should be fixed in stage1+)
20+
# NOTE: add "-A warnings" after snapshot to WFLAGS_ST0
21+
WFLAGS_ST0 = -A unrecognized-lint
22+
WFLAGS_ST1 = -D warnings
23+
WFLAGS_ST2 = -D warnings
24+
1625
# TARGET_STAGE_N template: This defines how target artifacts are built
1726
# for all stage/target architecture combinations. The arguments:
1827
# $(1) is the stage
@@ -39,15 +48,15 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2)): \
3948
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
4049
| $$(TLIB$(1)_T_$(2)_H_$(3))/
4150
@$$(call E, compile_and_link: $$@)
42-
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< && touch $$@
51+
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) -o $$@ $$< && touch $$@
4352

4453
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_EXTRALIB_$(2)): \
4554
$$(EXTRALIB_CRATE) $$(EXTRALIB_INPUTS) \
4655
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_STDLIB_$(2)) \
4756
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
4857
| $$(TLIB$(1)_T_$(2)_H_$(3))/
4958
@$$(call E, compile_and_link: $$@)
50-
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< && touch $$@
59+
$$(STAGE$(1)_T_$(2)_H_$(3)) $$(WFLAGS_ST$(1)) -o $$@ $$< && touch $$@
5160

5261
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBSYNTAX_$(3)): \
5362
$$(LIBSYNTAX_CRATE) $$(LIBSYNTAX_INPUTS) \

trunk/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

trunk/src/libextra/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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() */

trunk/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| {

trunk/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()

trunk/src/libextra/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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> {

trunk/src/libextra/io_util.rs

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

1111
use core::io::{Reader, BytesReader};
1212
use core::io;
13+
use core::cast;
1314

1415
/// An implementation of the io::Reader interface which reads a buffer of bytes
1516
pub struct BufReader {
@@ -29,10 +30,13 @@ impl BufReader {
2930
}
3031

3132
fn as_bytes_reader<A>(&self, f: &fn(&BytesReader) -> A) -> A {
33+
// XXX FIXME(#5723)
34+
let bytes = ::core::util::id::<&[u8]>(self.buf);
35+
let bytes: &'static [u8] = unsafe { cast::transmute(bytes) };
3236
// Recreating the BytesReader state every call since
3337
// I can't get the borrowing to work correctly
3438
let bytes_reader = BytesReader {
35-
bytes: ::core::util::id::<&[u8]>(self.buf),
39+
bytes: bytes,
3640
pos: @mut *self.pos
3741
};
3842

trunk/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
}

trunk/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;

trunk/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) => {

trunk/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
}

trunk/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
}

trunk/src/libextra/term.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
use core::prelude::*;
1616

1717
use core::io;
18-
use core::os;
1918

20-
use terminfo::*;
21-
use terminfo::searcher::open;
22-
use terminfo::parser::compiled::parse;
23-
use terminfo::parm::{expand, Number, Variables};
19+
#[cfg(not(target_os = "win32"))] use core::os;
20+
#[cfg(not(target_os = "win32"))] use terminfo::*;
21+
#[cfg(not(target_os = "win32"))] use terminfo::searcher::open;
22+
#[cfg(not(target_os = "win32"))] use terminfo::parser::compiled::parse;
23+
#[cfg(not(target_os = "win32"))] use terminfo::parm::{expand, Number, Variables};
2424

2525
// FIXME (#2807): Windows support.
2626

@@ -122,10 +122,10 @@ impl Terminal {
122122
return Ok(Terminal {out: out, color_supported: false});
123123
}
124124

125-
pub fn fg(&self, color: u8) {
125+
pub fn fg(&self, _color: u8) {
126126
}
127127

128-
pub fn bg(&self, color: u8) {
128+
pub fn bg(&self, _color: u8) {
129129
}
130130

131131
pub fn reset(&self) {

trunk/src/libextra/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ type MonitorMsg = (TestDesc, TestResult);
423423
424424
fn run_tests(opts: &TestOpts,
425425
tests: ~[TestDescAndFn],
426-
callback: @fn(e: TestEvent)) {
426+
callback: &fn(e: TestEvent)) {
427427
428428
let filtered_tests = filter_tests(opts, tests);
429429
let filtered_descs = filtered_tests.map(|t| copy t.desc);

trunk/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
}

trunk/src/librustc/driver/driver.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,22 @@ pub fn compile_rest(sess: Session,
188188
*sess.building_library = session::building_library(
189189
sess.opts.crate_type, crate_opt.unwrap(), sess.opts.test);
190190

191+
// strip before expansion to allow macros to depend on
192+
// configuration variables e.g/ in
193+
//
194+
// #[macro_escape] #[cfg(foo)]
195+
// mod bar { macro_rules! baz!(() => {{}}) }
196+
//
197+
// baz! should not use this definition unless foo is enabled.
198+
crate_opt = Some(time(time_passes, ~"configuration 1", ||
199+
front::config::strip_unconfigured_items(crate_opt.unwrap())));
200+
191201
crate_opt = Some(time(time_passes, ~"expansion", ||
192202
syntax::ext::expand::expand_crate(sess.parse_sess, copy cfg,
193203
crate_opt.unwrap())));
194204

195-
crate_opt = Some(time(time_passes, ~"configuration", ||
205+
// strip again, in case expansion added anything with a #[cfg].
206+
crate_opt = Some(time(time_passes, ~"configuration 2", ||
196207
front::config::strip_unconfigured_items(crate_opt.unwrap())));
197208

198209
crate_opt = Some(time(time_passes, ~"maybe building test harness", ||

trunk/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
}

trunk/src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
959959
encode_attributes(ebml_w, item.attrs);
960960
match ty.node {
961961
ast::ty_path(path, bounds, _) if path.idents.len() == 1 => {
962-
assert!(bounds.is_empty());
962+
assert!(bounds.is_none());
963963
encode_impl_type_basename(ecx, ebml_w,
964964
ast_util::path_to_ident(path));
965965
}

0 commit comments

Comments
 (0)