Skip to content

Commit b7dba88

Browse files
committed
---
yaml --- r: 94207 b: refs/heads/try c: 22f14fb h: refs/heads/master i: 94205: 80efeaf 94203: f9b0e61 94199: a157018 94191: 016c732 94175: 84092da 94143: 671cfa1 94079: 335b149 93951: 5e2a65a 93695: 8480120 93183: 0cc7a31 92159: 166798c 90111: 89e9a89 v: v3
1 parent f90ded8 commit b7dba88

File tree

413 files changed

+6413
-8213
lines changed

Some content is hidden

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

413 files changed

+6413
-8213
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: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 5c2f8aa330575f001a7d15b8ccd335aaa337bf8b
5+
refs/heads/try: 22f14fb27f145dbea3c9312e1e88936c327ccf10
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,3 @@ src/etc/dl
9090
.settings/
9191
build/
9292
i686-pc-mingw32/
93-
src/librustc/lib/llvmdeps.rs

branches/try/Makefile.in

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,9 @@ endif
134134
# static copies of libstd and libextra. We also generate dynamic versions of all
135135
# libraries, so in the interest of space, prefer dynamic linking throughout the
136136
# compilation process.
137-
#
138-
# Note though that these flags are omitted for stage2+. This means that the
139-
# snapshot will be generated with a statically linked rustc so we only have to
140-
# worry about the distribution of one file (with its native dynamic
141-
# dependencies)
142-
RUSTFLAGS_STAGE0 += -Z prefer-dynamic
143137
RUSTFLAGS_STAGE1 += -Z prefer-dynamic
138+
RUSTFLAGS_STAGE2 += -Z prefer-dynamic
139+
RUSTFLAGS_STAGE3 += -Z prefer-dynamic
144140

145141
# platform-specific auto-configuration
146142
include $(CFG_SRC_DIR)mk/platform.mk
@@ -227,7 +223,7 @@ GENERATED :=
227223
define DEF_LIBS
228224

229225
CFG_RUNTIME_$(1) :=$(call CFG_STATIC_LIB_NAME_$(1),rustrt)
230-
CFG_RUSTLLVM_$(1) :=$(call CFG_STATIC_LIB_NAME_$(1),rustllvm)
226+
CFG_RUSTLLVM_$(1) :=$(call CFG_LIB_NAME_$(1),rustllvm)
231227
CFG_STDLIB_$(1) :=$(call CFG_LIB_NAME_$(1),std)
232228
CFG_EXTRALIB_$(1) :=$(call CFG_LIB_NAME_$(1),extra)
233229
CFG_LIBRUSTC_$(1) :=$(call CFG_LIB_NAME_$(1),rustc)
@@ -254,8 +250,6 @@ LIBRUSTUV_DSYM_GLOB_$(1) :=$(call CFG_LIB_DSYM_GLOB_$(1),rustuv)
254250
EXTRALIB_RGLOB_$(1) :=$(call CFG_RLIB_GLOB,extra)
255251
STDLIB_RGLOB_$(1) :=$(call CFG_RLIB_GLOB,std)
256252
LIBRUSTUV_RGLOB_$(1) :=$(call CFG_RLIB_GLOB,rustuv)
257-
LIBSYNTAX_RGLOB_$(1) :=$(call CFG_RLIB_GLOB,syntax)
258-
LIBRUSTC_RGLOB_$(1) :=$(call CFG_RLIB_GLOB,rustc)
259253

260254
endef
261255

@@ -431,18 +425,16 @@ TLIBRUSTUV_DEFAULT$(1)_T_$(2)_H_$(3) = \
431425
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_LIBRUSTUV_$(2))
432426

433427
# Preqrequisites for using the stageN compiler
434-
ifeq ($(1),0)
435-
HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3))
436-
else
437428
HSREQ$(1)_H_$(3) = \
438429
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
430+
$$(HLIB$(1)_H_$(3))/$(CFG_RUNTIME_$(3)) \
431+
$$(HLIB$(1)_H_$(3))/$(CFG_RUSTLLVM_$(3)) \
439432
$$(HSTDLIB_DEFAULT$(1)_H_$(3)) \
440433
$$(HEXTRALIB_DEFAULT$(1)_H_$(3)) \
441434
$$(HLIBSYNTAX_DEFAULT$(1)_H_$(3)) \
442435
$$(HLIBRUSTC_DEFAULT$(1)_H_$(3)) \
443436
$$(HLIBRUSTUV_DEFAULT$(1)_H_$(3)) \
444437
$$(MKFILE_DEPS)
445-
endif
446438

447439
# Prerequisites for using the stageN compiler to build target artifacts
448440
TSREQ$(1)_T_$(2)_H_$(3) = \

branches/try/doc/rustdoc.md

Lines changed: 0 additions & 72 deletions
This file was deleted.

branches/try/doc/tutorial-ffi.md

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ for the rust task is plenty for the C function to have.
152152

153153
A planned future improvement (net yet implemented at the time of this writing)
154154
is to have a guard page at the end of every rust stack. No rust function will
155-
hit this guard page (due to Rust's usage of LLVM's `__morestack`). The intention
155+
hit this guard page (due to rust's usage of LLVM's __morestack). The intention
156156
for this unmapped page is to prevent infinite recursion in C from overflowing
157157
onto other rust stacks. If the guard page is hit, then the process will be
158158
terminated with a message saying that the guard page was hit.
@@ -166,39 +166,30 @@ the stack of the task which is spawned.
166166

167167
# Destructors
168168

169-
Foreign libraries often hand off ownership of resources to the calling code.
170-
When this occurs, we must use Rust's destructors to provide safety and guarantee
171-
the release of these resources (especially in the case of failure).
169+
Foreign libraries often hand off ownership of resources to the calling code,
170+
which should be wrapped in a destructor to provide safety and guarantee their
171+
release.
172172

173-
As an example, we give a reimplementation of owned boxes by wrapping `malloc`
174-
and `free`:
173+
A type with the same functionality as owned boxes can be implemented by
174+
wrapping `malloc` and `free`:
175175

176176
~~~~
177177
use std::cast;
178178
use std::libc::{c_void, size_t, malloc, free};
179179
use std::ptr;
180180
use std::unstable::intrinsics;
181181
182-
// Define a wrapper around the handle returned by the foreign code.
183-
// Unique<T> has the same semantics as ~T
182+
// a wrapper around the handle returned by the foreign code
184183
pub struct Unique<T> {
185-
// It contains a single raw, mutable pointer to the object in question.
186184
priv ptr: *mut T
187185
}
188186
189-
// Implement methods for creating and using the values in the box.
190-
// NB: For simplicity and correctness, we require that T has kind Send
191-
// (owned boxes relax this restriction, and can contain managed (GC) boxes).
192-
// This is because, as implemented, the garbage collector would not know
193-
// about any shared boxes stored in the malloc'd region of memory.
194187
impl<T: Send> Unique<T> {
195188
pub fn new(value: T) -> Unique<T> {
196189
unsafe {
197190
let ptr = malloc(std::mem::size_of::<T>() as size_t) as *mut T;
198191
assert!(!ptr::is_null(ptr));
199192
// `*ptr` is uninitialized, and `*ptr = value` would attempt to destroy it
200-
// move_val_init moves a value into this memory without
201-
// attempting to drop the original value.
202193
intrinsics::move_val_init(&mut *ptr, value);
203194
Unique{ptr: ptr}
204195
}
@@ -215,20 +206,12 @@ impl<T: Send> Unique<T> {
215206
}
216207
}
217208
218-
// The key ingredient for safety, we associate a destructor with
219-
// Unique<T>, making the struct manage the raw pointer: when the
220-
// struct goes out of scope, it will automatically free the raw pointer.
221-
// NB: This is an unsafe destructor, because rustc will not normally
222-
// allow destructors to be associated with parametrized types, due to
223-
// bad interaction with managed boxes. (With the Send restriction,
224-
// we don't have this problem.)
225209
#[unsafe_destructor]
226210
impl<T: Send> Drop for Unique<T> {
227211
fn drop(&mut self) {
228212
unsafe {
229-
let x = intrinsics::uninit(); // dummy value to swap in
230-
// We need to move the object out of the box, so that
231-
// the destructor is called (at the end of this scope.)
213+
let x = intrinsics::init(); // dummy value to swap in
214+
// moving the object out is needed to call the destructor
232215
ptr::replace_ptr(self.ptr, x);
233216
free(self.ptr as *c_void)
234217
}

branches/try/doc/tutorial-rustpkg.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Now you can install and use it! Go anywhere else in your filesystem:
198198

199199
~~~ {.notrust}
200200
$ cd ~/src/foo
201-
$ rustpkg install github.com/YOUR_USERNAME/hello
201+
$ rustpkg install github/YOUR_USERNAME/hello
202202
WARNING: The Rust package manager is experimental and may be unstable
203203
note: Installed package github.com/YOUR_USERNAME/hello-0.1 to /home/yourusername/src/hello/.rust
204204
~~~

0 commit comments

Comments
 (0)