Skip to content

Commit cd8ffff

Browse files
committed
---
yaml --- r: 234814 b: refs/heads/tmp c: 318cd84 h: refs/heads/master v: v3
1 parent c40ed76 commit cd8ffff

File tree

104 files changed

+1921
-1752
lines changed

Some content is hidden

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

104 files changed

+1921
-1752
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 2a6f6f26f4d4a1e22ea5e2b4498d3245d80e8aff
28+
refs/heads/tmp: 318cd843d1103579291a9f6c9eab8aacce7e9f82
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: ab792abf1fcc28afbd315426213f6428da25c085
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/mk/cfg/x86_64-unknown-netbsd.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# x86_64-unknown-netbsd configuration
2+
CROSS_PREFIX_x86_64-unknown-netbsd=x86_64-unknown-netbsd-
23
CC_x86_64-unknown-netbsd=$(CC)
34
CXX_x86_64-unknown-netbsd=$(CXX)
45
CPP_x86_64-unknown-netbsd=$(CPP)

branches/tmp/mk/platform.mk

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,6 @@ define CFG_MAKE_TOOLCHAIN
208208

209209
ifeq ($$(findstring $(HOST_$(1)),arm aarch64 mips mipsel powerpc),)
210210

211-
# On OpenBSD, we need to pass the path of libstdc++.so to the linker
212-
# (use path of libstdc++.a which is a known name for the same path)
213-
ifeq ($(OSTYPE_$(1)),unknown-openbsd)
214-
RUSTC_FLAGS_$(1)=-L "$$(dir $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
215-
-print-file-name=lib$(CFG_STDCPP_NAME).a))" \
216-
$(RUSTC_FLAGS_$(1))
217-
endif
218-
219211
# On Bitrig, we need the relocation model to be PIC for everything
220212
ifeq (,$(filter $(OSTYPE_$(1)),bitrig))
221213
LLVM_MC_RELOCATION_MODEL="pic"

branches/tmp/src/compiletest/runtest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,8 @@ fn compile_test_and_save_ir(config: &Config, props: &TestProps,
16691669
// FIXME (#9639): This needs to handle non-utf8 paths
16701670
let mut link_args = vec!("-L".to_owned(),
16711671
aux_dir.to_str().unwrap().to_owned());
1672-
let llvm_args = vec!("--emit=llvm-ir".to_owned(),);
1672+
let llvm_args = vec!("--emit=llvm-ir".to_owned(),
1673+
"--crate-type=lib".to_owned());
16731674
link_args.extend(llvm_args);
16741675
let args = make_compile_args(config,
16751676
props,

branches/tmp/src/doc/complement-project-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Existing languages at this level of abstraction and efficiency are unsatisfactor
2222

2323
# Is any part of this thing production-ready?
2424

25-
Yes!
25+
No. Feel free to play around, but don't expect completeness or stability yet. Expect incompleteness and breakage.
2626

2727
# Is this a completely Mozilla-planned and orchestrated thing?
2828

branches/tmp/src/doc/style/errors/ergonomics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn write_info(info: &Info) -> Result<(), IoError> {
5757
```
5858

5959
See
60-
[the `result` module documentation](https://doc.rust-lang.org/stable/std/result/index.html#the-try-macro)
60+
[the `result` module documentation](https://doc.rust-lang.org/stable/std/result/index.html#the-try!-macro)
6161
for more details.
6262

6363
### The `Result`-`impl` pattern [FIXME]

branches/tmp/src/doc/style/features/traits/generics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ explicitly implement to be used by this generic function.
2727
* _Inference_. Since the type parameters to generic functions can usually be
2828
inferred, generic functions can help cut down on verbosity in code where
2929
explicit conversions or other method calls would usually be necessary. See the
30-
[overloading/implicits use case](#use-case-limited-overloading-andor-implicit-conversions)
30+
[overloading/implicits use case](#use-case:-limited-overloading-and/or-implicit-conversions)
3131
below.
3232
* _Precise types_. Because generics give a _name_ to the specific type
3333
implementing a trait, it is possible to be precise about places where that
@@ -51,7 +51,7 @@ explicitly implement to be used by this generic function.
5151
a `Vec<T>` contains elements of a single concrete type (and, indeed, the
5252
vector representation is specialized to lay these out in line). Sometimes
5353
heterogeneous collections are useful; see
54-
[trait objects](#use-case-trait-objects) below.
54+
[trait objects](#use-case:-trait-objects) below.
5555
* _Signature verbosity_. Heavy use of generics can bloat function signatures.
5656
**[Ed. note]** This problem may be mitigated by some language improvements; stay tuned.
5757

branches/tmp/src/doc/trpl/error-handling.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@ systems may want to jump around.
2424
* [The Basics](#the-basics)
2525
* [Unwrapping explained](#unwrapping-explained)
2626
* [The `Option` type](#the-option-type)
27-
* [Composing `Option<T>` values](#composing-optiont-values)
27+
* [Composing `Option<T>` values](#composing-option<t>-values)
2828
* [The `Result` type](#the-result-type)
2929
* [Parsing integers](#parsing-integers)
3030
* [The `Result` type alias idiom](#the-result-type-alias-idiom)
31-
* [A brief interlude: unwrapping isn't evil](#a-brief-interlude-unwrapping-isn't-evil)
31+
* [A brief interlude: unwrapping isn't evil](#a-brief-interlude:-unwrapping-isn't-evil)
3232
* [Working with multiple error types](#working-with-multiple-error-types)
3333
* [Composing `Option` and `Result`](#composing-option-and-result)
3434
* [The limits of combinators](#the-limits-of-combinators)
3535
* [Early returns](#early-returns)
36-
* [The `try!` macro](#the-try-macro)
36+
* [The `try!` macro](#the-try!-macro)
3737
* [Defining your own error type](#defining-your-own-error-type)
3838
* [Standard library traits used for error handling](#standard-library-traits-used-for-error-handling)
3939
* [The `Error` trait](#the-error-trait)
4040
* [The `From` trait](#the-from-trait)
41-
* [The real `try!` macro](#the-real-try-macro)
41+
* [The real `try!` macro](#the-real-try!-macro)
4242
* [Composing custom error types](#composing-custom-error-types)
4343
* [Advice for library writers](#advice-for-library-writers)
44-
* [Case study: A program to read population data](#case-study-a-program-to-read-population-data)
44+
* [Case study: A program to read population data](#case-study:-a-program-to-read-population-data)
4545
* [Initial setup](#initial-setup)
4646
* [Argument parsing](#argument-parsing)
4747
* [Writing the logic](#writing-the-logic)
48-
* [Error handling with `Box<Error>`](#error-handling-with-boxerror)
48+
* [Error handling with `Box<Error>`](#error-handling-with-box%3Cerror%3E)
4949
* [Reading from stdin](#reading-from-stdin)
5050
* [Error handling with a custom type](#error-handling-with-a-custom-type)
5151
* [Adding functionality](#adding-functionality)
@@ -87,7 +87,7 @@ thread '<main>' panicked at 'Invalid number: 11', src/bin/panic-simple.rs:5
8787
Here's another example that is slightly less contrived. A program that accepts
8888
an integer as an argument, doubles it and prints it.
8989

90-
<span id="code-unwrap-double"></span>
90+
<a name="code-unwrap-double"></a>
9191

9292
```rust,should_panic
9393
use std::env;
@@ -139,7 +139,7 @@ system is an important concept because it will cause the compiler to force the
139139
programmer to handle that absence. Let's take a look at an example that tries
140140
to find a character in a string:
141141

142-
<span id="code-option-ex-string-find"></span>
142+
<a name="code-option-ex-string-find"></a>
143143

144144
```rust
145145
// Searches `haystack` for the Unicode character `needle`. If one is found, the
@@ -154,7 +154,7 @@ fn find(haystack: &str, needle: char) -> Option<usize> {
154154
}
155155
```
156156

157-
Notice that when this function finds a matching character, it doesn't just
157+
Notice that when this function finds a matching character, it doen't just
158158
return the `offset`. Instead, it returns `Some(offset)`. `Some` is a variant or
159159
a *value constructor* for the `Option` type. You can think of it as a function
160160
with the type `fn<T>(value: T) -> Option<T>`. Correspondingly, `None` is also a
@@ -186,7 +186,7 @@ But wait, what about `unwrap` used in [`unwrap-double`](#code-unwrap-double)?
186186
There was no case analysis there! Instead, the case analysis was put inside the
187187
`unwrap` method for you. You could define it yourself if you want:
188188

189-
<span id="code-option-def-unwrap"></span>
189+
<a name="code-option-def-unwrap"></a>
190190

191191
```rust
192192
enum Option<T> {
@@ -253,7 +253,7 @@ option is `None`, in which case, just return `None`.
253253
Rust has parametric polymorphism, so it is very easy to define a combinator
254254
that abstracts this pattern:
255255

256-
<span id="code-option-map"></span>
256+
<a name="code-option-map"></a>
257257

258258
```rust
259259
fn map<F, T, A>(option: Option<T>, f: F) -> Option<A> where F: FnOnce(T) -> A {
@@ -394,7 +394,7 @@ remove choices because they will panic if `Option<T>` is `None`.
394394
The `Result` type is also
395395
[defined in the standard library][6]:
396396

397-
<span id="code-result-def"></span>
397+
<a name="code-result-def-1"></a>
398398

399399
```rust
400400
enum Result<T, E> {
@@ -562,7 +562,7 @@ combinators that affect only the error type, such as
562562
### The `Result` type alias idiom
563563

564564
In the standard library, you may frequently see types like
565-
`Result<i32>`. But wait, [we defined `Result`](#code-result-def) to
565+
`Result<i32>`. But wait, [we defined `Result`](#code-result-def-1) to
566566
have two type parameters. How can we get away with only specifying
567567
one? The key is to define a `Result` type alias that *fixes* one of
568568
the type parameters to a particular type. Usually the fixed type is
@@ -672,7 +672,7 @@ with both an `Option` and a `Result`, the solution is *usually* to convert the
672672
(from `env::args()`) means the user didn't invoke the program correctly. We
673673
could just use a `String` to describe the error. Let's try:
674674

675-
<span id="code-error-double-string"></span>
675+
<a name="code-error-double-string"></a>
676676

677677
```rust
678678
use std::env;
@@ -840,7 +840,7 @@ example, the very last call to `map` multiplies the `Ok(...)` value (which is
840840
an `i32`) by `2`. If an error had occurred before that point, this operation
841841
would have been skipped because of how `map` is defined.
842842

843-
`map_err` is the trick that makes all of this work. `map_err` is just like
843+
`map_err` is the trick the makes all of this work. `map_err` is just like
844844
`map`, except it applies a function to the `Err(...)` value of a `Result`. In
845845
this case, we want to convert all of our errors to one type: `String`. Since
846846
both `io::Error` and `num::ParseIntError` implement `ToString`, we can call the
@@ -906,7 +906,7 @@ seen above.
906906

907907
Here is a simplified definition of a `try!` macro:
908908

909-
<span id="code-try-def-simple"></span>
909+
<a nama name="code-try-def-simple"></a>
910910

911911
```rust
912912
macro_rules! try {
@@ -1168,7 +1168,7 @@ The `std::convert::From` trait is
11681168
[defined in the standard
11691169
library](../std/convert/trait.From.html):
11701170

1171-
<span id="code-from-def"></span>
1171+
<a name="code-from-def"></a>
11721172

11731173
```rust
11741174
trait From<T> {
@@ -1223,7 +1223,7 @@ let err2: Box<Error> = From::from(parse_err);
12231223

12241224
There is a really important pattern to recognize here. Both `err1` and `err2`
12251225
have the *same type*. This is because they are existentially quantified types,
1226-
or trait objects. In particular, their underlying type is *erased* from the
1226+
or trait objects. In particularly, their underlying type is *erased* from the
12271227
compiler's knowledge, so it truly sees `err1` and `err2` as exactly the same.
12281228
Additionally, we constructed `err1` and `err2` using precisely the same
12291229
function call: `From::from`. This is because `From::from` is overloaded on both
@@ -1250,7 +1250,7 @@ macro_rules! try {
12501250
This is not its real definition. Its real definition is
12511251
[in the standard library](../std/macro.try!.html):
12521252

1253-
<span id="code-try-def"></span>
1253+
<a name="code-try-def"></a>
12541254

12551255
```rust
12561256
macro_rules! try {
@@ -1515,7 +1515,7 @@ and [`rustc-serialize`](https://crates.io/crates/rustc-serialize) crates.
15151515

15161516
We're not going to spend a lot of time on setting up a project with
15171517
Cargo because it is already covered well in [the Cargo
1518-
chapter](../book/hello-cargo.html) and [Cargo's documentation][14].
1518+
chapter](../book/hello-cargo) and [Cargo's documentation][14].
15191519

15201520
To get started from scratch, run `cargo new --bin city-pop` and make sure your
15211521
`Cargo.toml` looks something like this:
@@ -1573,7 +1573,7 @@ fn main() {
15731573
15741574
let mut opts = Options::new();
15751575
opts.optflag("h", "help", "Show this usage message.");
1576-
1576+
15771577
let matches = match opts.parse(&args[1..]) {
15781578
Ok(m) => { m }
15791579
Err(e) => { panic!(e.to_string()) }
@@ -1584,7 +1584,7 @@ fn main() {
15841584
}
15851585
let data_path = args[1].clone();
15861586
let city = args[2].clone();
1587-
1587+
15881588
// Do stuff with information
15891589
}
15901590
```
@@ -1647,27 +1647,27 @@ fn main() {
16471647
16481648
let mut opts = Options::new();
16491649
opts.optflag("h", "help", "Show this usage message.");
1650-
1650+
16511651
let matches = match opts.parse(&args[1..]) {
16521652
Ok(m) => { m }
16531653
Err(e) => { panic!(e.to_string()) }
16541654
};
1655-
1655+
16561656
if matches.opt_present("h") {
16571657
print_usage(&program, opts);
16581658
return;
16591659
}
1660-
1660+
16611661
let data_file = args[1].clone();
16621662
let data_path = Path::new(&data_file);
16631663
let city = args[2].clone();
1664-
1664+
16651665
let file = fs::File::open(data_path).unwrap();
16661666
let mut rdr = csv::Reader::from_reader(file);
1667-
1667+
16681668
for row in rdr.decode::<Row>() {
16691669
let row = row.unwrap();
1670-
1670+
16711671
if row.city == city {
16721672
println!("{}, {}: {:?}",
16731673
row.city, row.country,
@@ -1773,7 +1773,7 @@ fn main() {
17731773
print_usage(&program, opts);
17741774
return;
17751775
}
1776-
1776+
17771777
let data_file = args[1].clone();
17781778
let data_path = Path::new(&data_file);
17791779
let city = args[2].clone();
@@ -1882,7 +1882,7 @@ opts.optflag("h", "help", "Show this usage message.");
18821882
...
18831883
let file = matches.opt_str("f");
18841884
let data_file = file.as_ref().map(Path::new);
1885-
1885+
18861886
let city = if !matches.free.is_empty() {
18871887
matches.free[0].clone()
18881888
} else {
@@ -2064,7 +2064,7 @@ string and add a flag to the Option variable. Once were done that, Getopts does
20642064
let mut opts = Options::new();
20652065
opts.optopt("f", "file", "Choose an input file, instead of using STDIN.", "NAME");
20662066
opts.optflag("h", "help", "Show this usage message.");
2067-
opts.optflag("q", "quiet", "Silences errors and warnings.");
2067+
opts.optflag("q", "quit", "Silences errors and warnings.");
20682068
...
20692069
```
20702070

branches/tmp/src/liballoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
#![cfg_attr(stage0, feature(alloc_system))]
101101
#![cfg_attr(not(stage0), feature(needs_allocator))]
102102

103-
#![cfg_attr(test, feature(test, rustc_private, box_heap))]
103+
#![cfg_attr(test, feature(test, rustc_private))]
104104

105105
#[cfg(stage0)]
106106
extern crate alloc_system;

branches/tmp/src/libcollections/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
#![feature(core_intrinsics)]
3939
#![feature(core_slice_ext)]
4040
#![feature(core_str_ext)]
41-
#![feature(fmt_internals)]
42-
#![feature(fmt_radix)]
4341
#![feature(heap_api)]
4442
#![feature(iter_order)]
4543
#![feature(iter_arith)]
@@ -49,8 +47,6 @@
4947
#![feature(oom)]
5048
#![feature(pattern)]
5149
#![feature(ptr_as_ref)]
52-
#![feature(ref_slice)]
53-
#![feature(slice_bytes)]
5450
#![feature(slice_patterns)]
5551
#![feature(staged_api)]
5652
#![feature(step_by)]

branches/tmp/src/libcollections/str.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ use slice::SliceConcatExt;
3838
use boxed::Box;
3939

4040
pub use core::str::{FromStr, Utf8Error};
41-
#[allow(deprecated)]
4241
pub use core::str::{Lines, LinesAny, CharRange};
4342
pub use core::str::{Split, RSplit};
4443
pub use core::str::{SplitN, RSplitN};

branches/tmp/src/libcollections/vec.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ use alloc::heap::EMPTY;
6565
use core::cmp::Ordering;
6666
use core::fmt;
6767
use core::hash::{self, Hash};
68-
use core::intrinsics::{arith_offset, assume, drop_in_place, needs_drop};
68+
use core::intrinsics::{arith_offset, assume, drop_in_place};
6969
use core::iter::FromIterator;
7070
use core::mem;
7171
use core::ops::{Index, IndexMut, Deref};
@@ -1322,14 +1322,8 @@ impl<T> Drop for Vec<T> {
13221322
// OK because exactly when this stops being a valid assumption, we
13231323
// don't need unsafe_no_drop_flag shenanigans anymore.
13241324
if self.buf.unsafe_no_drop_flag_needs_drop() {
1325-
unsafe {
1326-
// The branch on needs_drop() is an -O1 performance optimization.
1327-
// Without the branch, dropping Vec<u8> takes linear time.
1328-
if needs_drop::<T>() {
1329-
for x in self.iter_mut() {
1330-
drop_in_place(x);
1331-
}
1332-
}
1325+
for x in self.iter_mut() {
1326+
unsafe { drop_in_place(x); }
13331327
}
13341328
}
13351329
// RawVec handles deallocation

branches/tmp/src/libcollectionstest/btree/set.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,15 @@ fn test_zip() {
148148
let y = y;
149149
let mut z = x.iter().zip(&y);
150150

151-
assert_eq!(z.next().unwrap(), (&5, &("bar")));
152-
assert_eq!(z.next().unwrap(), (&11, &("foo")));
153-
assert!(z.next().is_none());
151+
// FIXME: #5801: this needs a type hint to compile...
152+
let result: Option<(&usize, & &'static str)> = z.next();
153+
assert_eq!(result.unwrap(), (&5, &("bar")));
154+
155+
let result: Option<(&usize, & &'static str)> = z.next();
156+
assert_eq!(result.unwrap(), (&11, &("foo")));
157+
158+
let result: Option<(&usize, & &'static str)> = z.next();
159+
assert!(result.is_none());
154160
}
155161

156162
#[test]

0 commit comments

Comments
 (0)