Skip to content

Commit 6b3f1ee

Browse files
committed
---
yaml --- r: 167295 b: refs/heads/try c: 9ac9d7a h: refs/heads/master i: 167293: 5a7d6a9 167291: 7a0d27f 167287: ce77f72 167279: 1fbb277 167263: 555ee36 167231: c9c70e3 167167: 3fba59a v: v3
1 parent 7c49ed8 commit 6b3f1ee

File tree

315 files changed

+6516
-4057
lines changed

Some content is hidden

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

315 files changed

+6516
-4057
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 023dfb0c898d851dee6ace2f8339b73b5287136b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 023dfb0c898d851dee6ace2f8339b73b5287136b
5-
refs/heads/try: 6ca45c3871fa5f32c2a5fa755b549727e4aa6a5c
5+
refs/heads/try: 9ac9d7af3b60c8536034a41434ab52e6261d8c24
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/mk/cfg/x86_64-unknown-dragonfly.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ CFG_LIB_NAME_x86_64-unknown-dragonfly=lib$(1).so
77
CFG_STATIC_LIB_NAME_x86_64-unknown-dragonfly=lib$(1).a
88
CFG_LIB_GLOB_x86_64-unknown-dragonfly=lib$(1)-*.so
99
CFG_LIB_DSYM_GLOB_x86_64-unknown-dragonfly=$(1)-*.dylib.dSYM
10-
CFG_JEMALLOC_CFLAGS_x86_64-unknown-dragonfly := -I/usr/include -I/usr/local/include $(CFLAGS)
11-
CFG_GCCISH_CFLAGS_x86_64-unknown-dragonfly := -Wall -Werror -g -fPIC -I/usr/include -I/usr/local/include $(CFLAGS)
12-
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-dragonfly := -shared -fPIC -g -pthread -lrt
10+
CFG_JEMALLOC_CFLAGS_x86_64-unknown-dragonfly := -m64 -I/usr/include -I/usr/local/include $(CFLAGS)
11+
CFG_GCCISH_CFLAGS_x86_64-unknown-dragonfly := -Wall -Werror -g -fPIC -m64 -I/usr/include -I/usr/local/include $(CFLAGS)
12+
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-dragonfly := -shared -fPIC -g -pthread -lrt -m64
1313
CFG_GCCISH_DEF_FLAG_x86_64-unknown-dragonfly := -Wl,--export-dynamic,--dynamic-list=
1414
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-dragonfly := -Wl,-whole-archive
1515
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-dragonfly := -Wl,-no-whole-archive

branches/try/mk/crates.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ DOC_CRATES := $(filter-out rustc, \
122122
$(filter-out rustc_borrowck, \
123123
$(filter-out rustc_resolve, \
124124
$(filter-out rustc_driver, \
125-
$(filter-out syntax, $(CRATES))))))))
125+
$(filter-out log, \
126+
$(filter-out regex, \
127+
$(filter-out regex_macros, \
128+
$(filter-out getopts, \
129+
$(filter-out time, \
130+
$(filter-out syntax, $(CRATES)))))))))))))
126131
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \
127132
rustc_typeck rustc_driver syntax
128133

branches/try/mk/docs.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ LIB_DOC_DEP_$(1) = \
236236
$$(RSINPUTS_$(1)) \
237237
$$(RUSTDOC_EXE) \
238238
$$(foreach dep,$$(RUST_DEPS_$(1)), \
239-
$$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep) \
239+
$$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep)) \
240+
$$(foreach dep,$$(filter $$(DOC_CRATES), $$(RUST_DEPS_$(1))), \
240241
doc/$$(dep)/)
241242
else
242243
LIB_DOC_DEP_$(1) = $$(CRATEFILE_$(1)) $$(RSINPUTS_$(1))

branches/try/mk/rt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ $$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
180180
AR="$$(AR_$(1))" \
181181
RANLIB="$$(AR_$(1)) s" \
182182
CPPFLAGS="-I $(S)src/rt/" \
183-
EXTRA_CFLAGS="-g1"
183+
EXTRA_CFLAGS="-g1 -ffunction-sections -fdata-sections"
184184
$$(Q)$$(MAKE) -C "$$(JEMALLOC_BUILD_DIR_$(1))" build_lib_static
185185

186186
ifeq ($$(CFG_DISABLE_JEMALLOC),)

branches/try/src/compiletest/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fn parse_expected(last_nonfollow_error: Option<uint>,
6767
re: &Regex) -> Option<(WhichLine, ExpectedError)> {
6868
re.captures(line).and_then(|caps| {
6969
let adjusts = caps.name("adjusts").unwrap_or("").len();
70-
let kind = caps.name("kind").unwrap_or("").to_ascii_lower();
70+
let kind = caps.name("kind").unwrap_or("").to_ascii_lowercase();
7171
let msg = caps.name("msg").unwrap_or("").trim().to_string();
7272
let follow = caps.name("follow").unwrap_or("").len() > 0;
7373

branches/try/src/compiletest/runtest.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ use util::logv;
2121
#[cfg(target_os = "windows")]
2222
use util;
2323

24+
#[cfg(target_os = "windows")]
25+
use std::ascii::AsciiExt;
2426
use std::io::File;
2527
use std::io::fs::PathExtensions;
2628
use std::io::fs;
@@ -985,22 +987,9 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
985987
format!("{}:{}:", testfile.display(), ee.line)
986988
}).collect::<Vec<String> >();
987989

988-
#[cfg(target_os = "windows")]
989-
fn to_lower( s : &str ) -> String {
990-
let i = s.chars();
991-
let c : Vec<char> = i.map( |c| {
992-
if c.is_ascii() {
993-
c.to_ascii().to_lowercase().as_char()
994-
} else {
995-
c
996-
}
997-
} ).collect();
998-
String::from_chars(c.as_slice())
999-
}
1000-
1001990
#[cfg(windows)]
1002991
fn prefix_matches( line : &str, prefix : &str ) -> bool {
1003-
to_lower(line).as_slice().starts_with(to_lower(prefix).as_slice())
992+
line.to_ascii_lowercase().starts_with(prefix.to_ascii_lowercase().as_slice())
1004993
}
1005994

1006995
#[cfg(unix)]

branches/try/src/doc/guide.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,10 +1604,6 @@ let a = [1i, 2i, 3i]; // a: [int, ..3]
16041604
let mut m = [1i, 2i, 3i]; // mut m: [int, ..3]
16051605
```
16061606

1607-
You can create an array with a given number of elements, all initialized to the
1608-
same value, with `[val, ..N]` syntax. The compiler ensures that arrays are
1609-
always initialized.
1610-
16111607
There's a shorthand for initializing each element of an array to the same
16121608
value. In this example, each element of `a` will be initialized to `0i`:
16131609

branches/try/src/doc/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ fn main() {
483483
for i in range(0u, 3u) {
484484
let number = numbers.clone();
485485
Thread::spawn(move || {
486-
let mut array = number.lock();
486+
let mut array = number.lock().unwrap();
487487
488488
(*array)[i] += 1;
489489

branches/try/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ names, and invoked through a consistent syntax: `name!(...)`. Examples include:
640640
* `stringify!` : pretty-print the Rust expression given as an argument
641641
* `include!` : include the Rust expression in the given file
642642
* `include_str!` : include the contents of the given file as a string
643-
* `include_bin!` : include the contents of the given file as a binary blob
643+
* `include_bytes!` : include the contents of the given file as a binary blob
644644
* `error!`, `warn!`, `info!`, `debug!` : provide diagnostic information.
645645

646646
All of the above extensions are expressions with values.

branches/try/src/etc/rustup.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,18 @@ validate_opt() {
229229
done
230230
}
231231

232+
create_tmp_dir() {
233+
local TMP_DIR=./rustup-tmp-install
234+
235+
rm -Rf "${TMP_DIR}"
236+
need_ok "failed to remove temporary installation directory"
237+
238+
mkdir -p "${TMP_DIR}"
239+
need_ok "failed to create create temporary installation directory"
240+
241+
echo $TMP_DIR
242+
}
243+
232244
probe_need CFG_CURL curl
233245
probe_need CFG_TAR tar
234246
probe_need CFG_FILE file
@@ -401,7 +413,9 @@ then
401413
CFG_INSTALL_FLAGS="${CFG_INSTALL_FLAGS} --prefix=${CFG_PREFIX}"
402414
fi
403415

404-
CFG_TMP_DIR="./rustup-tmp-install"
416+
CFG_TMP_DIR=$(mktemp -d 2>/dev/null \
417+
|| mktemp -d -t 'rustup-tmp-install' 2>/dev/null \
418+
|| create_tmp_dir)
405419

406420
RUST_URL="https://static.rust-lang.org/dist"
407421
RUST_PACKAGE_NAME=rust-nightly
@@ -424,9 +438,6 @@ download_package() {
424438

425439
msg "Downloading ${remote_tarball} to ${local_tarball}"
426440

427-
mkdir -p "${CFG_TMP_DIR}"
428-
need_ok "failed to create create download directory"
429-
430441
"${CFG_CURL}" -f -o "${local_tarball}" "${remote_tarball}"
431442
if [ $? -ne 0 ]
432443
then

branches/try/src/etc/snapshot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def scrub(b):
3737
"macos": ["bin/rustc"],
3838
"winnt": ["bin/rustc.exe"],
3939
"freebsd": ["bin/rustc"],
40+
"dragonfly": ["bin/rustc"],
4041
}
4142

4243
winnt_runtime_deps_32 = ["libgcc_s_dw2-1.dll",
@@ -86,6 +87,8 @@ def get_kernel(triple):
8687
return "macos"
8788
if os_name == "freebsd":
8889
return "freebsd"
90+
if os_name == "dragonfly":
91+
return "dragonfly"
8992
return "linux"
9093

9194
def get_cpu(triple):

branches/try/src/liballoc/arc.rs

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
//! let five = five.clone();
5959
//!
6060
//! Thread::spawn(move || {
61-
//! let mut number = five.lock();
61+
//! let mut number = five.lock().unwrap();
6262
//!
6363
//! *number += 1;
6464
//!
@@ -76,11 +76,11 @@ use core::default::Default;
7676
use core::kinds::{Sync, Send};
7777
use core::mem::{min_align_of, size_of, drop};
7878
use core::mem;
79+
use core::nonzero::NonZero;
7980
use core::ops::{Drop, Deref};
8081
use core::option::Option;
8182
use core::option::Option::{Some, None};
82-
use core::ptr::RawPtr;
83-
use core::ptr;
83+
use core::ptr::{mod, PtrExt};
8484
use heap::deallocate;
8585

8686
/// An atomically reference counted wrapper for shared state.
@@ -114,9 +114,13 @@ use heap::deallocate;
114114
pub struct Arc<T> {
115115
// FIXME #12808: strange name to try to avoid interfering with
116116
// field accesses of the contained type via Deref
117-
_ptr: *mut ArcInner<T>,
117+
_ptr: NonZero<*mut ArcInner<T>>,
118118
}
119119

120+
unsafe impl<T: Sync + Send> Send for Arc<T> { }
121+
unsafe impl<T: Sync + Send> Sync for Arc<T> { }
122+
123+
120124
/// A weak pointer to an `Arc`.
121125
///
122126
/// Weak pointers will not keep the data inside of the `Arc` alive, and can be used to break cycles
@@ -126,16 +130,22 @@ pub struct Arc<T> {
126130
pub struct Weak<T> {
127131
// FIXME #12808: strange name to try to avoid interfering with
128132
// field accesses of the contained type via Deref
129-
_ptr: *mut ArcInner<T>,
133+
_ptr: NonZero<*mut ArcInner<T>>,
130134
}
131135

136+
unsafe impl<T: Sync + Send> Send for Weak<T> { }
137+
unsafe impl<T: Sync + Send> Sync for Weak<T> { }
138+
132139
struct ArcInner<T> {
133140
strong: atomic::AtomicUint,
134141
weak: atomic::AtomicUint,
135142
data: T,
136143
}
137144

138-
impl<T: Sync + Send> Arc<T> {
145+
unsafe impl<T: Sync + Send> Send for ArcInner<T> {}
146+
unsafe impl<T: Sync + Send> Sync for ArcInner<T> {}
147+
148+
impl<T> Arc<T> {
139149
/// Constructs a new `Arc<T>`.
140150
///
141151
/// # Examples
@@ -155,7 +165,7 @@ impl<T: Sync + Send> Arc<T> {
155165
weak: atomic::AtomicUint::new(1),
156166
data: data,
157167
};
158-
Arc { _ptr: unsafe { mem::transmute(x) } }
168+
Arc { _ptr: unsafe { NonZero::new(mem::transmute(x)) } }
159169
}
160170

161171
/// Downgrades the `Arc<T>` to a `Weak<T>` reference.
@@ -184,7 +194,7 @@ impl<T> Arc<T> {
184194
// pointer is valid. Furthermore, we know that the `ArcInner` structure itself is `Sync`
185195
// because the inner data is `Sync` as well, so we're ok loaning out an immutable pointer
186196
// to these contents.
187-
unsafe { &*self._ptr }
197+
unsafe { &**self._ptr }
188198
}
189199
}
190200

@@ -271,7 +281,7 @@ impl<T: Send + Sync + Clone> Arc<T> {
271281
// pointer that will ever be returned to T. Our reference count is guaranteed to be 1 at
272282
// this point, and we required the Arc itself to be `mut`, so we're returning the only
273283
// possible reference to the inner data.
274-
let inner = unsafe { &mut *self._ptr };
284+
let inner = unsafe { &mut **self._ptr };
275285
&mut inner.data
276286
}
277287
}
@@ -306,7 +316,8 @@ impl<T: Sync + Send> Drop for Arc<T> {
306316
fn drop(&mut self) {
307317
// This structure has #[unsafe_no_drop_flag], so this drop glue may run more than once (but
308318
// it is guaranteed to be zeroed after the first if it's run more than once)
309-
if self._ptr.is_null() { return }
319+
let ptr = *self._ptr;
320+
if ptr.is_null() { return }
310321

311322
// Because `fetch_sub` is already atomic, we do not need to synchronize with other threads
312323
// unless we are going to delete the object. This same logic applies to the below
@@ -336,7 +347,7 @@ impl<T: Sync + Send> Drop for Arc<T> {
336347

337348
if self.inner().weak.fetch_sub(1, atomic::Release) == 1 {
338349
atomic::fence(atomic::Acquire);
339-
unsafe { deallocate(self._ptr as *mut u8, size_of::<ArcInner<T>>(),
350+
unsafe { deallocate(ptr as *mut u8, size_of::<ArcInner<T>>(),
340351
min_align_of::<ArcInner<T>>()) }
341352
}
342353
}
@@ -376,7 +387,7 @@ impl<T: Sync + Send> Weak<T> {
376387
#[inline]
377388
fn inner(&self) -> &ArcInner<T> {
378389
// See comments above for why this is "safe"
379-
unsafe { &*self._ptr }
390+
unsafe { &**self._ptr }
380391
}
381392
}
382393

@@ -432,14 +443,16 @@ impl<T: Sync + Send> Drop for Weak<T> {
432443
/// } // implicit drop
433444
/// ```
434445
fn drop(&mut self) {
446+
let ptr = *self._ptr;
447+
435448
// see comments above for why this check is here
436-
if self._ptr.is_null() { return }
449+
if ptr.is_null() { return }
437450

438451
// If we find out that we were the last weak pointer, then its time to deallocate the data
439452
// entirely. See the discussion in Arc::drop() about the memory orderings
440453
if self.inner().weak.fetch_sub(1, atomic::Release) == 1 {
441454
atomic::fence(atomic::Acquire);
442-
unsafe { deallocate(self._ptr as *mut u8, size_of::<ArcInner<T>>(),
455+
unsafe { deallocate(ptr as *mut u8, size_of::<ArcInner<T>>(),
443456
min_align_of::<ArcInner<T>>()) }
444457
}
445458
}
@@ -587,6 +600,7 @@ mod tests {
587600
use std::str::Str;
588601
use std::sync::atomic;
589602
use std::task;
603+
use std::kinds::Send;
590604
use std::vec::Vec;
591605
use super::{Arc, Weak, weak_count, strong_count};
592606
use std::sync::Mutex;
@@ -708,7 +722,7 @@ mod tests {
708722

709723
let a = Arc::new(Cycle { x: Mutex::new(None) });
710724
let b = a.clone().downgrade();
711-
*a.x.lock() = Some(b);
725+
*a.x.lock().unwrap() = Some(b);
712726

713727
// hopefully we don't double-free (or leak)...
714728
}

branches/try/src/liballoc/boxed.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use core::hash::{mod, Hash};
1919
use core::kinds::Sized;
2020
use core::mem;
2121
use core::option::Option;
22+
use core::ptr::Unique;
2223
use core::raw::TraitObject;
2324
use core::result::Result;
2425
use core::result::Result::{Ok, Err};
@@ -44,7 +45,7 @@ pub static HEAP: () = ();
4445
/// A type that represents a uniquely-owned value.
4546
#[lang = "owned_box"]
4647
#[unstable = "custom allocators will add an additional type parameter (with default)"]
47-
pub struct Box<T>(*mut T);
48+
pub struct Box<T>(Unique<T>);
4849

4950
#[stable]
5051
impl<T: Default> Default for Box<T> {

branches/try/src/liballoc/heap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use core::ptr::RawPtr;
11+
use core::ptr::PtrExt;
1212

1313
// FIXME: #13996: mark the `allocate` and `reallocate` return value as `noalias`
1414

@@ -371,7 +371,7 @@ mod imp {
371371
mod test {
372372
extern crate test;
373373
use self::test::Bencher;
374-
use core::ptr::RawPtr;
374+
use core::ptr::PtrExt;
375375
use heap;
376376

377377
#[test]

0 commit comments

Comments
 (0)