Skip to content

Commit 9178175

Browse files
committed
---
yaml --- r: 166589 b: refs/heads/snap-stage3 c: f1e37f9 h: refs/heads/master i: 166587: 6175c9a v: v3
1 parent b968f72 commit 9178175

File tree

246 files changed

+3222
-4808
lines changed

Some content is hidden

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

246 files changed

+3222
-4808
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: 18842f89f084c52588fe7cffe07f87bf6e90796a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: fea5aa656ff4349f4d3e1fea1447d26986762ae1
4+
refs/heads/snap-stage3: f1e37f98930c69718f8e07168ac6e4feaff03ffe
55
refs/heads/try: f5d619caf9f32458680fae55526b99582ca682dd
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/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 := -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
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
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/snap-stage3/mk/crates.mk

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,7 @@ DOC_CRATES := $(filter-out rustc, \
122122
$(filter-out rustc_borrowck, \
123123
$(filter-out rustc_resolve, \
124124
$(filter-out rustc_driver, \
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)))))))))))))
125+
$(filter-out syntax, $(CRATES))))))))
131126
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \
132127
rustc_typeck rustc_driver syntax
133128

branches/snap-stage3/mk/docs.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ 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)) \
240-
$$(foreach dep,$$(filter $$(DOC_CRATES), $$(RUST_DEPS_$(1))), \
239+
$$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep) \
241240
doc/$$(dep)/)
242241
else
243242
LIB_DOC_DEP_$(1) = $$(CRATEFILE_$(1)) $$(RSINPUTS_$(1))

branches/snap-stage3/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 -ffunction-sections -fdata-sections"
183+
EXTRA_CFLAGS="-g1"
184184
$$(Q)$$(MAKE) -C "$$(JEMALLOC_BUILD_DIR_$(1))" build_lib_static
185185

186186
ifeq ($$(CFG_DISABLE_JEMALLOC),)

branches/snap-stage3/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_lowercase();
70+
let kind = caps.name("kind").unwrap_or("").to_ascii_lower();
7171
let msg = caps.name("msg").unwrap_or("").trim().to_string();
7272
let follow = caps.name("follow").unwrap_or("").len() > 0;
7373

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

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

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

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+
9901001
#[cfg(windows)]
9911002
fn prefix_matches( line : &str, prefix : &str ) -> bool {
992-
line.to_ascii_lowercase().starts_with(prefix.to_ascii_lowercase().as_slice())
1003+
to_lower(line).as_slice().starts_with(to_lower(prefix).as_slice())
9931004
}
9941005

9951006
#[cfg(unix)]

branches/snap-stage3/src/etc/rustup.sh

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -229,18 +229,6 @@ 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-
244232
probe_need CFG_CURL curl
245233
probe_need CFG_TAR tar
246234
probe_need CFG_FILE file
@@ -413,9 +401,7 @@ then
413401
CFG_INSTALL_FLAGS="${CFG_INSTALL_FLAGS} --prefix=${CFG_PREFIX}"
414402
fi
415403

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

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

439425
msg "Downloading ${remote_tarball} to ${local_tarball}"
440426

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

branches/snap-stage3/src/etc/snapshot.py

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

4342
winnt_runtime_deps_32 = ["libgcc_s_dw2-1.dll",
@@ -87,8 +86,6 @@ def get_kernel(triple):
8786
return "macos"
8887
if os_name == "freebsd":
8988
return "freebsd"
90-
if os_name == "dragonfly":
91-
return "dragonfly"
9289
return "linux"
9390

9491
def get_cpu(triple):

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

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -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;
8079
use core::ops::{Drop, Deref};
8180
use core::option::Option;
8281
use core::option::Option::{Some, None};
83-
use core::ptr::{mod, RawPtr};
82+
use core::ptr::RawPtr;
83+
use core::ptr;
8484
use heap::deallocate;
8585

8686
/// An atomically reference counted wrapper for shared state.
@@ -114,13 +114,9 @@ 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: NonZero<*mut ArcInner<T>>,
117+
_ptr: *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-
124120
/// A weak pointer to an `Arc`.
125121
///
126122
/// Weak pointers will not keep the data inside of the `Arc` alive, and can be used to break cycles
@@ -130,22 +126,16 @@ unsafe impl<T: Sync + Send> Sync for Arc<T> { }
130126
pub struct Weak<T> {
131127
// FIXME #12808: strange name to try to avoid interfering with
132128
// field accesses of the contained type via Deref
133-
_ptr: NonZero<*mut ArcInner<T>>,
129+
_ptr: *mut ArcInner<T>,
134130
}
135131

136-
unsafe impl<T: Sync + Send> Send for Weak<T> { }
137-
unsafe impl<T: Sync + Send> Sync for Weak<T> { }
138-
139132
struct ArcInner<T> {
140133
strong: atomic::AtomicUint,
141134
weak: atomic::AtomicUint,
142135
data: T,
143136
}
144137

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> {
138+
impl<T: Sync + Send> Arc<T> {
149139
/// Constructs a new `Arc<T>`.
150140
///
151141
/// # Examples
@@ -165,7 +155,7 @@ impl<T> Arc<T> {
165155
weak: atomic::AtomicUint::new(1),
166156
data: data,
167157
};
168-
Arc { _ptr: unsafe { NonZero::new(mem::transmute(x)) } }
158+
Arc { _ptr: unsafe { mem::transmute(x) } }
169159
}
170160

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

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

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

348337
if self.inner().weak.fetch_sub(1, atomic::Release) == 1 {
349338
atomic::fence(atomic::Acquire);
350-
unsafe { deallocate(ptr as *mut u8, size_of::<ArcInner<T>>(),
339+
unsafe { deallocate(self._ptr as *mut u8, size_of::<ArcInner<T>>(),
351340
min_align_of::<ArcInner<T>>()) }
352341
}
353342
}
@@ -387,7 +376,7 @@ impl<T: Sync + Send> Weak<T> {
387376
#[inline]
388377
fn inner(&self) -> &ArcInner<T> {
389378
// See comments above for why this is "safe"
390-
unsafe { &**self._ptr }
379+
unsafe { &*self._ptr }
391380
}
392381
}
393382

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

451438
// If we find out that we were the last weak pointer, then its time to deallocate the data
452439
// entirely. See the discussion in Arc::drop() about the memory orderings
453440
if self.inner().weak.fetch_sub(1, atomic::Release) == 1 {
454441
atomic::fence(atomic::Acquire);
455-
unsafe { deallocate(ptr as *mut u8, size_of::<ArcInner<T>>(),
442+
unsafe { deallocate(self._ptr as *mut u8, size_of::<ArcInner<T>>(),
456443
min_align_of::<ArcInner<T>>()) }
457444
}
458445
}
@@ -600,7 +587,6 @@ mod tests {
600587
use std::str::Str;
601588
use std::sync::atomic;
602589
use std::task;
603-
use std::kinds::Send;
604590
use std::vec::Vec;
605591
use super::{Arc, Weak, weak_count, strong_count};
606592
use std::sync::Mutex;

branches/snap-stage3/src/liballoc/boxed.rs

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

5049
#[stable]
5150
impl<T: Default> Default for Box<T> {

0 commit comments

Comments
 (0)