Skip to content

Rolling up PRs in the queue #20733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 97 commits into from
Jan 8, 2015
Merged
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
fcc2323
Be stricter with binders in method probing.
nikomatsakis Jan 6, 2015
279de38
Support methods invoked on projection types based on the bounds found…
nikomatsakis Jan 6, 2015
3f1cf32
Convert the TODO into FIXME.
nikomatsakis Jan 6, 2015
ab02f9e
Workaround privacy bug or something else; filter_to_traits() fails to
nikomatsakis Jan 6, 2015
1bc3c96
Correct the comment of the function `llsize_of_real`
simnalamburt Jan 6, 2015
9041e6e
Let `size_of` always be multiple of `min_align_of`
simnalamburt Jan 5, 2015
da83e4d
oboe removed
andrewyli Jan 7, 2015
4f801c4
Bump copyright year in doc footer
frewsxcv Jan 7, 2015
99b39cc
test: Move some tests to scoped instead of spawn
alexcrichton Jan 7, 2015
29ff43b
Fix rustdoc fallout from #20092
barosl Jan 7, 2015
b53e9f1
Register new snapshots
alexcrichton Jan 7, 2015
064cf55
Normalize associated types in various parts of `adt`
nikomatsakis Jan 7, 2015
6300a97
Remove assertion that substitutions are erased. It'd be nice if they
nikomatsakis Jan 7, 2015
bdc1bfd
Rename common::normalize to common::erase_regions
nikomatsakis Jan 7, 2015
cf136cd
Use the `erase_regions` helper within trans in deference to
nikomatsakis Jan 7, 2015
aec62af
Solve rather subtle bug in `replace_late_bound_regions` -- we were pa…
nikomatsakis Jan 7, 2015
448ddad
Better debug output in `decl_rust_fn`. The lack of output here has
nikomatsakis Jan 7, 2015
a70428a
Add regression test for #20582. Fixes #20582.
nikomatsakis Jan 7, 2015
f67a722
liballoc does not need liblibc under certain configurations
Ericson2314 Dec 26, 2014
efaa43a
liballoc's "external_funcs" and "external_crate" are now features
Ericson2314 Dec 26, 2014
2b84e44
Shorten cfg line lengths in liballoc
Ericson2314 Dec 26, 2014
ea9d5c9
liballoc's "extern_funcs" impl mod had a duplicate and missing item
Ericson2314 Dec 26, 2014
b1b4bc9
Fix warning in liballoc about unused constant MIN_ALIGN when cfg(feat…
Ericson2314 Dec 30, 2014
120a520
Reject all uses of non-typaram bounds
jroesch Jan 7, 2015
7deb9ab
Add isize, usize modules, deprecate int, uint modules
aturon Jan 7, 2015
dd3e89a
Rename `target_word_size` to `target_pointer_width`
nrc Jan 7, 2015
321d9dd
Update references to old snapshot
aturon Jan 7, 2015
511f0b8
std: Stabilize the std::hash module
alexcrichton Dec 9, 2014
801585d
Fix #[stable] coming before } instead of after
daboross Jan 7, 2015
9fcf097
fix typo in the ownership guide
Jan 7, 2015
209c701
std: Stablize the macros module
alexcrichton Jan 6, 2015
4a04117
mk: Remove RUST_NDEBUG and RUST_DEBUG defines. Unused
brson Jan 7, 2015
6e2bfe4
register new snapshots
Jan 7, 2015
e15f043
Show, String, Eq impls for Ranges
nrc Jan 7, 2015
63a9bd5
Fix precedence for ranges.
nrc Jan 7, 2015
82af2a1
Add `Box::new` method. Prereq for feature-gating `box <expr>` itself.
pnkfelix Jan 7, 2015
517f1cc
use slicing sugar
Jan 7, 2015
3c1ca17
Require that types cannot implement both Drop and Copy.
huonw Jan 6, 2015
9851b4f
std: Tweak String implementations
alexcrichton Jan 7, 2015
c27133e
Preliminary feature staging
brson Jan 6, 2015
8327bcc
remove slicing_syntax feature gate
Jan 7, 2015
ed4bebd
remove some `slicing_syntax` feature gates
Jan 7, 2015
4a31aad
Added `box_syntax` feature gate; added to std and rustc crates for bo…
pnkfelix Jan 7, 2015
cfeab25
Allow unknown features to bootstrap rustc with box_syntax feature.
pnkfelix Jan 7, 2015
ef5e8fc
run-pass tests: Add feature attributes to enable box pat/expr syntax …
pnkfelix Jan 7, 2015
e318125
compile-fail tests: Add feature attributes to enable box pat/expr syn…
pnkfelix Jan 7, 2015
c52486d
alternate version of coerce-match test that avoids box syntax.
pnkfelix Jan 7, 2015
b57b0e0
Test that box syntax, both in expressions and patterns, is caught by
pnkfelix Jan 7, 2015
3fd6bfa
Switch to using `Box::new` in the tests in `alloc::boxed`.
pnkfelix Jan 7, 2015
3010e10
allow unknown features in the log crate.
pnkfelix Jan 7, 2015
2606f99
Remove the unneeded Sized bound on TypeId creation
reem Jan 6, 2015
772cfe9
allow box_syntax and unknown features in the rustc_llvm crate.
pnkfelix Jan 8, 2015
5bd88a0
allow box_syntax and unknown features in the rustc_driver crate.
pnkfelix Jan 8, 2015
a0734ff
rustdoc: Render associated type bindings
tomjakubowski Jan 8, 2015
7d72719
fix the `&mut _` patterns
Jan 8, 2015
bfd6f95
allow box_syntax and unknown features in compiletest driver.
pnkfelix Jan 8, 2015
1cc69c4
RFC 558: Require parentheses for chained comparisons
dgrunwald Jan 8, 2015
ebe8411
rollup merge of #20237: RustOS-Fork-Holding-Ground/master
alexcrichton Jan 8, 2015
b1c23f6
rollup merge of #20611: simnalamburt/master
alexcrichton Jan 8, 2015
8bf3ee7
rollup merge of #20654: alexcrichton/stabilize-hash
alexcrichton Jan 8, 2015
f3b67af
rollup merge of #20663: brson/feature-staging
alexcrichton Jan 8, 2015
6301c78
rollup merge of #20680: nick29581/target-word
alexcrichton Jan 8, 2015
3800f64
rollup merge of #20688: jroesch/reject-non-param-bounds-followup
alexcrichton Jan 8, 2015
5b1a285
rollup merge of #20693: EchoAce/intro-oboe
alexcrichton Jan 8, 2015
cedaf46
rollup merge of #20695: frewsxcv/patch-2
alexcrichton Jan 8, 2015
f257848
rollup merge of #20696: reem/unsized-typeid
alexcrichton Jan 8, 2015
188bfbf
rollup merge of #20703: barosl/rustdoc-z-index-fallout
alexcrichton Jan 8, 2015
b21a0ce
rollup merge of #20704: alexcrichton/hopefully-make-tests-less-spurious
alexcrichton Jan 8, 2015
dd38f46
rollup merge of #20708: aturon/new-int-modules
alexcrichton Jan 8, 2015
5d342ac
rollup merge of #20709: thiagopnts/ownership-guide-typo
alexcrichton Jan 8, 2015
4373db6
rollup merge of #20710: daboross/fix-stable-before-bracket
alexcrichton Jan 8, 2015
a6bf767
rollup merge of #20716: brson/RUST_DEBUG
alexcrichton Jan 8, 2015
a204dc5
rollup merge of #20722: alexcrichton/audit-show
alexcrichton Jan 8, 2015
cb344be
rollup merge of #20725: tomjakubowski/rustdoc-misc
alexcrichton Jan 8, 2015
f6a7dc5
rollup merge of #20726: dgrunwald/require-parens-for-chained-comparison
alexcrichton Jan 8, 2015
9e4e882
Use ty::type_is_sized() so that we handle projection types properly.
nikomatsakis Jan 7, 2015
4dd368b
Normalize associated types in `with_field_tys`
nikomatsakis Jan 7, 2015
55c6a68
Add rather involved run-pass test case.
nikomatsakis Jan 7, 2015
18f426e
Update compile-fail test with new message that is generated as a
nikomatsakis Jan 7, 2015
cb98c3d
Normalize types of fields in struct literals during type-checking.
nikomatsakis Jan 7, 2015
6e806bd
rollup merge of #20721: japaric/snap
alexcrichton Jan 8, 2015
92cd8ea
Prohibit type parameter shadowing with a clunky hammer.
huonw Jan 8, 2015
773fdb3
rollup merge of #20631: huon/no-drop-and-copy
alexcrichton Jan 8, 2015
6afda64
rollup merge of #20728: huonw/type-param-shadowing
alexcrichton Jan 8, 2015
a7a2dd9
fallout: run-pass tests that use box. (many could be ported to `Box:…
pnkfelix Jan 8, 2015
51357e0
rollup merge of #20665: nikomatsakis/assoc-types-method-dispatch-proj…
alexcrichton Jan 8, 2015
bcebec5
rollup merge of #20706: nikomatsakis/assoc-types-projections-in-struc…
alexcrichton Jan 8, 2015
68a783a
Remove String impls and fix for make tidy
nrc Jan 8, 2015
6621325
rollup merge of #20657: alexcrichton/stabilize-macros
alexcrichton Jan 8, 2015
d859816
fallout: run-fail tests that use box. (many/all could be ported to `B…
pnkfelix Jan 8, 2015
d11bfba
rollup merge of #20720: nick29581/assoc-ice-missing
alexcrichton Jan 8, 2015
ae4bcd4
fallout: part of changes to compile-fail tests. (follows same patter…
pnkfelix Jan 8, 2015
373cbab
rollup merge of #20723: pnkfelix/feature-gate-box-syntax
alexcrichton Jan 8, 2015
11e265c
rollup merge of #20707: nikomatsakis/issue-20582
alexcrichton Jan 8, 2015
0dc48b4
Test fixes and rebase conflicts
alexcrichton Jan 8, 2015
ef46cae
rollup merge of #20731: nick29581/assoc-inherant
alexcrichton Jan 8, 2015
0abf458
More test fixes and rebase conflicts
alexcrichton Jan 8, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions configure
Original file line number Diff line number Diff line change
@@ -599,6 +599,18 @@ then
fi
putvar CFG_RELEASE_CHANNEL

# A magic value that allows the compiler to use unstable features
# during the bootstrap even when doing so would normally be an error
# because of feature staging or because the build turns on
# warnings-as-errors and unstable features default to warnings. The
# build has to match this key in an env var. Meant to be a mild
# deterrent from users just turning on unstable features on the stable
# channel.
# Basing CFG_BOOTSTRAP_KEY on CFG_BOOTSTRAP_KEY lets it get picked up
# during a Makefile reconfig.
CFG_BOOTSTRAP_KEY="${CFG_BOOTSTRAP_KEY-`date +%N`}"
putvar CFG_BOOTSTRAP_KEY

step_msg "looking for build programs"

probe_need CFG_PERL perl
13 changes: 11 additions & 2 deletions mk/main.mk
Original file line number Diff line number Diff line change
@@ -25,11 +25,13 @@ ifeq ($(CFG_RELEASE_CHANNEL),stable)
CFG_RELEASE=$(CFG_RELEASE_NUM)
# This is the string used in dist artifact file names, e.g. "0.12.0", "nightly"
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
CFG_DISABLE_UNSTABLE_FEATURES=1
endif
ifeq ($(CFG_RELEASE_CHANNEL),beta)
# The beta channel is temporarily called 'alpha'
CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE)
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-alpha$(CFG_BETA_CYCLE)
CFG_DISABLE_UNSTABLE_FEATURES=1
endif
ifeq ($(CFG_RELEASE_CHANNEL),nightly)
CFG_RELEASE=$(CFG_RELEASE_NUM)-nightly
@@ -121,11 +123,9 @@ CFG_JEMALLOC_FLAGS += $(JEMALLOC_FLAGS)

ifdef CFG_DISABLE_DEBUG
CFG_RUSTC_FLAGS += --cfg ndebug
CFG_GCCISH_CFLAGS += -DRUST_NDEBUG
else
$(info cfg: enabling more debugging (CFG_ENABLE_DEBUG))
CFG_RUSTC_FLAGS += --cfg debug
CFG_GCCISH_CFLAGS += -DRUST_DEBUG
endif

ifdef SAVE_TEMPS
@@ -319,11 +319,20 @@ export CFG_VERSION_WIN
export CFG_RELEASE
export CFG_PACKAGE_NAME
export CFG_BUILD
export CFG_RELEASE_CHANNEL
export CFG_LLVM_ROOT
export CFG_PREFIX
export CFG_LIBDIR
export CFG_LIBDIR_RELATIVE
export CFG_DISABLE_INJECT_STD_VERSION
ifdef CFG_DISABLE_UNSTABLE_FEATURES
CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATURES))
# Turn on feature-staging
export CFG_DISABLE_UNSTABLE_FEATURES
endif
# Subvert unstable feature lints to do the self-build
export CFG_BOOTSTRAP_KEY
export RUSTC_BOOTSTRAP_KEY:=$(CFG_BOOTSTRAP_KEY)

######################################################################
# Per-stage targets and runner
2 changes: 2 additions & 0 deletions src/compiletest/compiletest.rs
Original file line number Diff line number Diff line change
@@ -9,7 +9,9 @@
// except according to those terms.

#![crate_type = "bin"]
#![allow(unknown_features)]
#![feature(slicing_syntax, unboxed_closures)]
#![feature(box_syntax)]

#![deny(warnings)]

3 changes: 1 addition & 2 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
@@ -908,8 +908,7 @@ fn check_error_patterns(props: &TestProps,
}
if done { return; }

let missing_patterns =
props.error_patterns.index(&(next_err_idx..));
let missing_patterns = &props.error_patterns[next_err_idx..];
if missing_patterns.len() == 1u {
fatal_proc_rec(format!("error pattern '{}' not found!",
missing_patterns[0]).as_slice(),
2 changes: 1 addition & 1 deletion src/doc/footer.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<footer><p>
Copyright &copy; 2011-2014 The Rust Project Developers. Licensed under the
Copyright &copy; 2011-2015 The Rust Project Developers. Licensed under the
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
or the <a href="http://opensource.org/licenses/MIT">MIT license</a>, at your option.
</p><p>
4 changes: 2 additions & 2 deletions src/doc/guide-error-handling.md
Original file line number Diff line number Diff line change
@@ -147,10 +147,10 @@ for all but the most trivial of situations.
Here's an example of using `Result`:

```rust
#[deriving(Show)]
#[derive(Show)]
enum Version { Version1, Version2 }

#[deriving(Show)]
#[derive(Show)]
enum ParseError { InvalidHeaderLength, InvalidVersion }

fn parse_version(header: &[u8]) -> Result<Version, ParseError> {
3 changes: 2 additions & 1 deletion src/doc/guide-ffi.md
Original file line number Diff line number Diff line change
@@ -262,6 +262,7 @@ referenced Rust object.
Rust code:

~~~~no_run
# use std::boxed::Box;

#[repr(C)]
struct RustObject {
@@ -286,7 +287,7 @@ extern {

fn main() {
// Create the object that will be referenced in the callback
let mut rust_object = box RustObject { a: 5 };
let mut rust_object = Box::new(RustObject { a: 5 });

unsafe {
register_callback(&mut *rust_object, callback);
26 changes: 15 additions & 11 deletions src/doc/guide-ownership.md
Original file line number Diff line number Diff line change
@@ -81,27 +81,29 @@ therefore deallocates the memory for you. Here's the equivalent example in
Rust:

```rust
# use std::boxed::Box;
{
let x = box 5i;
let x = Box::new(5i);
}
```

The `box` keyword creates a `Box<T>` (specifically `Box<int>` in this case) by
allocating a small segment of memory on the heap with enough space to fit an
`int`. But where in the code is the box deallocated? We said before that we
must have a deallocation for each allocation. Rust handles this for you. It
The `Box::new` function creates a `Box<T>` (specifically `Box<int>` in this
case) by allocating a small segment of memory on the heap with enough space to
fit an `int`. But where in the code is the box deallocated? We said before that
we must have a deallocation for each allocation. Rust handles this for you. It
knows that our handle, `x`, is the owning reference to our box. Rust knows that
`x` will go out of scope at the end of the block, and so it inserts a call to
deallocate the memory at the end of the scope. Because the compiler does this
for us, it's impossible to forget. We always have exactly one deallocation paired
with each of our allocations.
for us, it's impossible to forget. We always have exactly one deallocation
paired with each of our allocations.

This is pretty straightforward, but what happens when we want to pass our box
to a function? Let's look at some code:

```rust
# use std::boxed::Box;
fn main() {
let x = box 5i;
let x = Box::new(5i);

add_one(x);
}
@@ -115,8 +117,9 @@ This code works, but it's not ideal. For example, let's add one more line of
code, where we print out the value of `x`:

```{rust,ignore}
# use std::boxed::Box;
fn main() {
let x = box 5i;
let x = Box::new(5i);

add_one(x);

@@ -148,8 +151,9 @@ To fix this, we can have `add_one` give ownership back when it's done with the
box:

```rust
# use std::boxed::Box;
fn main() {
let x = box 5i;
let x = Box::new(5i);

let y = add_one(x);

@@ -458,7 +462,7 @@ lifetime, and so if you elide a lifetime (like `&T` instead of `&'a T`), Rust
will do three things to determine what those lifetimes should be.

When talking about lifetime elision, we use the term 'input lifetime' and
'output lifetime'. An 'input liftime' is a lifetime associated with a parameter
'output lifetime'. An 'input lifetime' is a lifetime associated with a parameter
of a function, and an 'output lifetime' is a lifetime associated with the return
value of a function. For example, this function has an input lifetime:

55 changes: 28 additions & 27 deletions src/doc/guide-pointers.md
Original file line number Diff line number Diff line change
@@ -455,12 +455,13 @@ fn rc_succ(x: Rc<int>) -> int { *x + 1 }
Note that the caller of your function will have to modify their calls slightly:

```{rust}
# use std::boxed::Box;
use std::rc::Rc;

fn succ(x: &int) -> int { *x + 1 }

let ref_x = &5i;
let box_x = box 5i;
let box_x = Box::new(5i);
let rc_x = Rc::new(5i);

succ(ref_x);
@@ -477,24 +478,17 @@ those contents.
heap allocation in Rust. Creating a box looks like this:

```{rust}
let x = box(std::boxed::HEAP) 5i;
# use std::boxed::Box;
let x = Box::new(5i);
```

`box` is a keyword that does 'placement new,' which we'll talk about in a bit.
`box` will be useful for creating a number of heap-allocated types, but is not
quite finished yet. In the meantime, `box`'s type defaults to
`std::boxed::HEAP`, and so you can leave it off:

```{rust}
let x = box 5i;
```

As you might assume from the `HEAP`, boxes are heap allocated. They are
deallocated automatically by Rust when they go out of scope:
Boxes are heap allocated and they are deallocated automatically by Rust when
they go out of scope:

```{rust}
# use std::boxed::Box;
{
let x = box 5i;
let x = Box::new(5i);

// stuff happens

@@ -513,8 +507,9 @@ You don't need to fully grok the theory of affine types or regions to grok
boxes, though. As a rough approximation, you can treat this Rust code:

```{rust}
# use std::boxed::Box;
{
let x = box 5i;
let x = Box::new(5i);

// stuff happens
}
@@ -553,12 +548,13 @@ for more detail on how lifetimes work.
Using boxes and references together is very common. For example:

```{rust}
# use std::boxed::Box;
fn add_one(x: &int) -> int {
*x + 1
}

fn main() {
let x = box 5i;
let x = Box::new(5i);

println!("{}", add_one(&*x));
}
@@ -570,12 +566,13 @@ function, and since it's only reading the value, allows it.
We can borrow `x` multiple times, as long as it's not simultaneous:

```{rust}
# use std::boxed::Box;
fn add_one(x: &int) -> int {
*x + 1
}

fn main() {
let x = box 5i;
let x = Box::new(5i);

println!("{}", add_one(&*x));
println!("{}", add_one(&*x));
@@ -586,12 +583,13 @@ fn main() {
Or as long as it's not a mutable borrow. This will error:

```{rust,ignore}
# use std::boxed::Box;
fn add_one(x: &mut int) -> int {
*x + 1
}

fn main() {
let x = box 5i;
let x = Box::new(5i);

println!("{}", add_one(&*x)); // error: cannot borrow immutable dereference
// of `&`-pointer as mutable
@@ -612,22 +610,23 @@ Sometimes, you need a recursive data structure. The simplest is known as a


```{rust}
#[deriving(Show)]
# use std::boxed::Box;
#[derive(Show)]
enum List<T> {
Cons(T, Box<List<T>>),
Nil,
}

fn main() {
let list: List<int> = List::Cons(1, box List::Cons(2, box List::Cons(3, box List::Nil)));
let list: List<int> = List::Cons(1, Box::new(List::Cons(2, Box::new(List::Cons(3, Box::new(List::Nil))))));
println!("{:?}", list);
}
```

This prints:

```text
Cons(1, box Cons(2, box Cons(3, box Nil)))
Cons(1, Box(Cons(2, Box(Cons(3, Box(Nil))))))
```

The reference to another `List` inside of the `Cons` enum variant must be a box,
@@ -667,6 +666,7 @@ In many languages with pointers, you'd return a pointer from a function
so as to avoid copying a large data structure. For example:

```{rust}
# use std::boxed::Box;
struct BigStruct {
one: int,
two: int,
@@ -675,15 +675,15 @@ struct BigStruct {
}

fn foo(x: Box<BigStruct>) -> Box<BigStruct> {
return box *x;
return Box::new(*x);
}

fn main() {
let x = box BigStruct {
let x = Box::new(BigStruct {
one: 1,
two: 2,
one_hundred: 100,
};
});

let y = foo(x);
}
@@ -695,6 +695,7 @@ than the hundred `int`s that make up the `BigStruct`.
This is an antipattern in Rust. Instead, write this:

```{rust}
# use std::boxed::Box;
struct BigStruct {
one: int,
two: int,
@@ -707,13 +708,13 @@ fn foo(x: Box<BigStruct>) -> BigStruct {
}

fn main() {
let x = box BigStruct {
let x = Box::new(BigStruct {
one: 1,
two: 2,
one_hundred: 100,
};
});

let y = box foo(x);
let y = Box::new(foo(x));
}
```

5 changes: 3 additions & 2 deletions src/doc/guide-unsafe.md
Original file line number Diff line number Diff line change
@@ -197,6 +197,7 @@ extern crate libc;
use libc::{c_void, size_t, malloc, free};
use std::mem;
use std::ptr;
# use std::boxed::Box;

// Define a wrapper around the handle returned by the foreign code.
// Unique<T> has the same semantics as Box<T>
@@ -265,7 +266,7 @@ impl<T: Send> Drop for Unique<T> {
// A comparison between the built-in `Box` and this reimplementation
fn main() {
{
let mut x = box 5i;
let mut x = Box::new(5i);
*x = 10;
} // `x` is freed here

@@ -653,7 +654,7 @@ sugar for dynamic allocations via `malloc` and `free`:

```
#![no_std]
#![feature(lang_items)]
#![feature(lang_items, box_syntax)]

extern crate libc;

Loading