Skip to content

Commit 3171645

Browse files
committed
---
yaml --- r: 234765 b: refs/heads/tmp c: 6602b2f h: refs/heads/master i: 234763: f671c55 v: v3
1 parent 793cda2 commit 3171645

File tree

21 files changed

+138
-189
lines changed

21 files changed

+138
-189
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: 049d76bdd2ac7b3e65dc70b91e3b1e95e1a12d43
28+
refs/heads/tmp: 6602b2f1c777e6e563a7bcc920bbd1ee1c4f7eab
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/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-and/or-implicit-conversions)
30+
[overloading/implicits use case](#use-case-limited-overloading-andor-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: 27 additions & 27 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-option<t>-values)
27+
* [Composing `Option<T>` values](#composing-optiont-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-box%3Cerror%3E)
48+
* [Error handling with `Box<Error>`](#error-handling-with-boxerror)
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-
<a name="code-unwrap-double"></a>
90+
<span id="code-unwrap-double"></span>
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-
<a name="code-option-ex-string-find"></a>
142+
<span id="code-option-ex-string-find"></span>
143143

144144
```rust
145145
// Searches `haystack` for the Unicode character `needle`. If one is found, the
@@ -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-
<a name="code-option-def-unwrap"></a>
189+
<span id="code-option-def-unwrap"></span>
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-
<a name="code-option-map"></a>
256+
<span id="code-option-map"></span>
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-
<a name="code-result-def-1"></a>
397+
<span id="code-result-def"></span>
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-1) to
565+
`Result<i32>`. But wait, [we defined `Result`](#code-result-def) 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-
<a name="code-error-double-string"></a>
675+
<span id="code-error-double-string"></span>
676676

677677
```rust
678678
use std::env;
@@ -906,7 +906,7 @@ seen above.
906906

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

909-
<a nama name="code-try-def-simple"></a>
909+
<span id="code-try-def-simple"></span>
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-
<a name="code-from-def"></a>
1171+
<span id="code-from-def"></span>
11721172

11731173
```rust
11741174
trait From<T> {
@@ -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-
<a name="code-try-def"></a>
1253+
<span id="code-try-def"></span>
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) and [Cargo's documentation][14].
1518+
chapter](../book/hello-cargo.html) 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 {

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

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

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());
151+
assert_eq!(z.next().unwrap(), (&5, &("bar")));
152+
assert_eq!(z.next().unwrap(), (&11, &("foo")));
153+
assert!(z.next().is_none());
160154
}
161155

162156
#[test]

branches/tmp/src/libcoretest/cell.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,14 @@ fn unsafe_cell_unsized() {
248248
assert_eq!(unsafe { &mut *cell.get() }, comp);
249249
}
250250

251-
// FIXME(#25351) needs deeply nested coercions of DST structs.
252-
// #[test]
253-
// fn refcell_unsized() {
254-
// let cell: &RefCell<[i32]> = &RefCell::new([1, 2, 3]);
255-
// {
256-
// let b = &mut *cell.borrow_mut();
257-
// b[0] = 4;
258-
// b[2] = 5;
259-
// }
260-
// let comp: &mut [i32] = &mut [4, 2, 5];
261-
// assert_eq!(&*cell.borrow(), comp);
262-
// }
251+
#[test]
252+
fn refcell_unsized() {
253+
let cell: &RefCell<[i32]> = &RefCell::new([1, 2, 3]);
254+
{
255+
let b = &mut *cell.borrow_mut();
256+
b[0] = 4;
257+
b[2] = 5;
258+
}
259+
let comp: &mut [i32] = &mut [4, 2, 5];
260+
assert_eq!(&*cell.borrow(), comp);
261+
}

branches/tmp/src/librustc/lint/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ macro_rules! lint_initializer {
8989
/// Declare a static item of type `&'static Lint`.
9090
#[macro_export]
9191
macro_rules! declare_lint {
92-
// FIXME(#14660): deduplicate
9392
(pub $name:ident, $level:ident, $desc:expr) => (
9493
pub static $name: &'static ::rustc::lint::Lint
9594
= &lint_initializer!($name, $level, $desc);

0 commit comments

Comments
 (0)