Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3fba503

Browse files
authoredNov 2, 2016
Auto merge of #37514 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests - Successful merges: #36849, #37059, #37296, #37316, #37484, #37485, #37495 - Failed merges:
2 parents 7c69b0d + f5c192a commit 3fba503

File tree

15 files changed

+251
-249
lines changed

15 files changed

+251
-249
lines changed
 

‎src/doc/book/closures.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,11 @@ fn factory() -> Box<Fn(i32) -> i32> {
510510
511511
Box::new(|x| x + num)
512512
}
513-
# fn main() {
513+
514514
let f = factory();
515515
516516
let answer = f(1);
517517
assert_eq!(6, answer);
518-
# }
519518
```
520519

521520
There’s just one last problem:
@@ -540,12 +539,11 @@ fn factory() -> Box<Fn(i32) -> i32> {
540539

541540
Box::new(move |x| x + num)
542541
}
543-
fn main() {
542+
544543
let f = factory();
545544

546545
let answer = f(1);
547546
assert_eq!(6, answer);
548-
}
549547
```
550548

551549
By making the inner closure a `move Fn`, we create a new stack frame for our

‎src/doc/book/guessing-game.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ numbers. A bare number like above is actually shorthand for `^0.3.0`,
362362
meaning "anything compatible with 0.3.0".
363363
If we wanted to use only `0.3.0` exactly, we could say `rand="=0.3.0"`
364364
(note the two equal signs).
365-
And if we wanted to use the latest version we could use `rand="*"`.
366365
We could also use a range of versions.
367366
[Cargo’s documentation][cargodoc] contains more details.
368367

‎src/doc/book/testing.md

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ Cargo will automatically generate a simple test when you make a new project.
2424
Here's the contents of `src/lib.rs`:
2525

2626
```rust
27-
# fn main() {}
28-
#[test]
29-
fn it_works() {
27+
#[cfg(test)]
28+
mod tests {
29+
#[test]
30+
fn it_works() {
31+
}
3032
}
3133
```
3234

@@ -36,11 +38,11 @@ currently has no body. That's good enough to pass! We can run the tests with
3638

3739
```bash
3840
$ cargo test
39-
Compiling adder v0.0.1 (file:///home/you/projects/adder)
40-
Running target/adder-91b3e234d4ed382a
41+
Compiling adder v0.1.0 (file:///home/you/projects/adder)
42+
Running target/debug/deps/adder-91b3e234d4ed382a
4143

4244
running 1 test
43-
test it_works ... ok
45+
test tests::it_works ... ok
4446

4547
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
4648

@@ -56,7 +58,7 @@ for the test we wrote, and another for documentation tests. We'll talk about
5658
those later. For now, see this line:
5759

5860
```text
59-
test it_works ... ok
61+
test tests::it_works ... ok
6062
```
6163

6264
Note the `it_works`. This comes from the name of our function:
@@ -89,31 +91,30 @@ run our tests again:
8991

9092
```bash
9193
$ cargo test
92-
Compiling adder v0.0.1 (file:///home/you/projects/adder)
93-
Running target/adder-91b3e234d4ed382a
94+
Compiling adder v0.1.0 (file:///home/you/projects/adder)
95+
Running target/debug/deps/adder-91b3e234d4ed382a
9496

9597
running 1 test
96-
test it_works ... FAILED
98+
test tests::it_works ... FAILED
9799

98100
failures:
99101

100-
---- it_works stdout ----
101-
thread 'it_works' panicked at 'assertion failed: false', /home/steve/tmp/adder/src/lib.rs:3
102-
102+
---- test::it_works stdout ----
103+
thread 'tests::it_works' panicked at 'assertion failed: false', src/lib.rs:5
103104

104105

105106
failures:
106-
it_works
107+
tests::it_works
107108

108109
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured
109110

110-
thread 'main' panicked at 'Some tests failed', /home/steve/src/rust/src/libtest/lib.rs:247
111+
error: test failed
111112
```
112113

113114
Rust indicates that our test failed:
114115

115116
```text
116-
test it_works ... FAILED
117+
test tests::it_works ... FAILED
117118
```
118119

119120
And that's reflected in the summary line:
@@ -159,11 +160,11 @@ This test will now succeed if we `panic!` and fail if we complete. Let's try it:
159160

160161
```bash
161162
$ cargo test
162-
Compiling adder v0.0.1 (file:///home/you/projects/adder)
163-
Running target/adder-91b3e234d4ed382a
163+
Compiling adder v0.1.0 (file:///home/you/projects/adder)
164+
Running target/debug/deps/adder-91b3e234d4ed382a
164165

165166
running 1 test
166-
test it_works ... ok
167+
test tests::it_works ... ok
167168

168169
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
169170

@@ -191,11 +192,11 @@ passes:
191192

192193
```bash
193194
$ cargo test
194-
Compiling adder v0.0.1 (file:///home/you/projects/adder)
195-
Running target/adder-91b3e234d4ed382a
195+
Compiling adder v0.1.0 (file:///home/you/projects/adder)
196+
Running target/debug/deps/adder-91b3e234d4ed382a
196197

197198
running 1 test
198-
test it_works ... ok
199+
test tests::it_works ... ok
199200

200201
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
201202

@@ -262,8 +263,8 @@ not:
262263

263264
```bash
264265
$ cargo test
265-
Compiling adder v0.0.1 (file:///home/you/projects/adder)
266-
Running target/adder-91b3e234d4ed382a
266+
Compiling adder v0.1.0 (file:///home/you/projects/adder)
267+
Running target/debug/deps/adder-91b3e234d4ed382a
267268

268269
running 2 tests
269270
test expensive_test ... ignored
@@ -282,7 +283,7 @@ The expensive tests can be run explicitly using `cargo test -- --ignored`:
282283

283284
```bash
284285
$ cargo test -- --ignored
285-
Running target/adder-91b3e234d4ed382a
286+
Running target/debug/deps/adder-91b3e234d4ed382a
286287

287288
running 1 test
288289
test expensive_test ... ok
@@ -302,8 +303,11 @@ which is why the command is `cargo test -- --ignored`.
302303
# The `tests` module
303304

304305
There is one way in which our existing example is not idiomatic: it's
305-
missing the `tests` module. The idiomatic way of writing our example
306-
looks like this:
306+
missing the `tests` module. You might have noticed this test module was
307+
present in the code that was initially generated with `cargo new` but
308+
was missing from our last example. Let's explain what this does.
309+
310+
The idiomatic way of writing our example looks like this:
307311

308312
```rust,ignore
309313
# fn main() {}
@@ -356,8 +360,8 @@ Note the different `use` line. Now we run our tests:
356360
```bash
357361
$ cargo test
358362
Updating registry `https://github.com/rust-lang/crates.io-index`
359-
Compiling adder v0.0.1 (file:///home/you/projects/adder)
360-
Running target/adder-91b3e234d4ed382a
363+
Compiling adder v0.1.0 (file:///home/you/projects/adder)
364+
Running target/debug/deps/adder-91b3e234d4ed382a
361365

362366
running 1 test
363367
test tests::it_works ... ok
@@ -404,15 +408,15 @@ Let's run them:
404408

405409
```bash
406410
$ cargo test
407-
Compiling adder v0.0.1 (file:///home/you/projects/adder)
408-
Running target/adder-91b3e234d4ed382a
411+
Compiling adder v0.1.0 (file:///home/you/projects/adder)
412+
Running target/debug/deps/adder-91b3e234d4ed382a
409413

410414
running 1 test
411415
test tests::it_works ... ok
412416

413417
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
414418

415-
Running target/lib-c18e7d3494509e74
419+
Running target/debug/integration_test-68064b69521c828a
416420

417421
running 1 test
418422
test it_works ... ok
@@ -490,15 +494,15 @@ Let's run the tests again:
490494

491495
```bash
492496
$ cargo test
493-
Compiling adder v0.0.1 (file:///home/steve/tmp/adder)
494-
Running target/adder-91b3e234d4ed382a
497+
Compiling adder v0.1.0. (file:///home/you/projects/adder)
498+
Running target/debug/deps/adder-91b3e234d4ed382a
495499

496500
running 1 test
497501
test tests::it_works ... ok
498502

499503
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
500504

501-
Running target/lib-c18e7d3494509e74
505+
Running target/debug/integration_test-68064b69521c828a
502506

503507
running 1 test
504508
test it_works ... ok

‎src/libcore/convert.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ pub trait AsMut<T: ?Sized> {
145145
///
146146
/// # Generic Impls
147147
///
148-
/// - `[From<T>][From] for U` implies `Into<U> for T`
148+
/// - [`From<T>`][From]` for U` implies `Into<U> for T`
149149
/// - [`into()`] is reflexive, which means that `Into<T> for T` is implemented
150150
///
151151
/// [`TryInto`]: trait.TryInto.html
@@ -178,14 +178,14 @@ pub trait Into<T>: Sized {
178178
/// ```
179179
/// # Generic impls
180180
///
181-
/// - `From<T> for U` implies `[Into<U>] for T`
181+
/// - `From<T> for U` implies [`Into<U>`]` for T`
182182
/// - [`from()`] is reflexive, which means that `From<T> for T` is implemented
183183
///
184184
/// [`TryFrom`]: trait.TryFrom.html
185185
/// [`Option<T>`]: ../../std/option/enum.Option.html
186186
/// [`Result<T, E>`]: ../../std/result/enum.Result.html
187187
/// [`String`]: ../../std/string/struct.String.html
188-
/// [Into<U>]: trait.Into.html
188+
/// [`Into<U>`]: trait.Into.html
189189
/// [`from()`]: trait.From.html#tymethod.from
190190
#[stable(feature = "rust1", since = "1.0.0")]
191191
pub trait From<T>: Sized {

‎src/libcore/macros.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ macro_rules! panic {
4242
/// Unsafe code relies on `assert!` to enforce run-time invariants that, if
4343
/// violated could lead to unsafety.
4444
///
45-
/// Other use-cases of `assert!` include
46-
/// [testing](https://doc.rust-lang.org/book/testing.html) and enforcing
47-
/// run-time invariants in safe code (whose violation cannot result in unsafety).
45+
/// Other use-cases of `assert!` include [testing] and enforcing run-time
46+
/// invariants in safe code (whose violation cannot result in unsafety).
4847
///
4948
/// This macro has a second version, where a custom panic message can be provided.
5049
///
50+
/// [testing]: ../book/testing.html
51+
///
5152
/// # Examples
5253
///
5354
/// ```

‎src/libcore/marker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ pub trait Unsize<T: ?Sized> {
241241
/// compile-time error. Specifically, with structs you'll get [E0204] and with enums you'll get
242242
/// [E0205].
243243
///
244-
/// [E0204]: https://doc.rust-lang.org/error-index.html#E0204
245-
/// [E0205]: https://doc.rust-lang.org/error-index.html#E0205
244+
/// [E0204]: ../../error-index.html#E0204
245+
/// [E0205]: ../../error-index.html#E0205
246246
///
247247
/// ## When *should* my type be `Copy`?
248248
///

‎src/libcore/ops.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ pub trait Drop {
182182
/// After this function is over, the memory of `self` will be deallocated.
183183
///
184184
/// This function cannot be called explicitly. This is compiler error
185-
/// [0040]. However, the [`std::mem::drop`] function in the prelude can be
185+
/// [E0040]. However, the [`std::mem::drop`] function in the prelude can be
186186
/// used to call the argument's `Drop` implementation.
187187
///
188-
/// [0040]: https://doc.rust-lang.org/error-index.html#E0040
189-
/// [`std::mem::drop`]: https://doc.rust-lang.org/std/mem/fn.drop.html
188+
/// [E0040]: ../../error-index.html#E0040
189+
/// [`std::mem::drop`]: ../../std/mem/fn.drop.html
190190
///
191191
/// # Panics
192192
///

‎src/libcore/str/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl Utf8Error {
132132
/// verified.
133133
///
134134
/// It is the maximum index such that `from_utf8(input[..index])`
135-
/// would return `Some(_)`.
135+
/// would return `Ok(_)`.
136136
///
137137
/// # Examples
138138
///

‎src/librustc/infer/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ pub enum TypeOrigin {
199199
// Computing common supertype of an if expression with no else counter-part
200200
IfExpressionWithNoElse(Span),
201201

202-
// Computing common supertype in a range expression
203-
RangeExpression(Span),
204-
205202
// `where a == b`
206203
EquatePredicate(Span),
207204

@@ -231,7 +228,6 @@ impl TypeOrigin {
231228
},
232229
&TypeOrigin::IfExpression(_) => "if and else have incompatible types",
233230
&TypeOrigin::IfExpressionWithNoElse(_) => "if may be missing an else clause",
234-
&TypeOrigin::RangeExpression(_) => "start and end of range have incompatible types",
235231
&TypeOrigin::EquatePredicate(_) => "equality predicate not satisfied",
236232
&TypeOrigin::MainFunctionType(_) => "main function has wrong type",
237233
&TypeOrigin::StartFunctionType(_) => "start function has wrong type",
@@ -251,7 +247,6 @@ impl TypeOrigin {
251247
&TypeOrigin::MatchExpressionArm(..) => "match arms have compatible types",
252248
&TypeOrigin::IfExpression(_) => "if and else have compatible types",
253249
&TypeOrigin::IfExpressionWithNoElse(_) => "if missing an else returns ()",
254-
&TypeOrigin::RangeExpression(_) => "start and end of range have compatible types",
255250
&TypeOrigin::EquatePredicate(_) => "equality where clause is satisfied",
256251
&TypeOrigin::MainFunctionType(_) => "`main` function has the correct type",
257252
&TypeOrigin::StartFunctionType(_) => "`start` function has the correct type",
@@ -1755,7 +1750,6 @@ impl TypeOrigin {
17551750
TypeOrigin::MatchExpressionArm(match_span, ..) => match_span,
17561751
TypeOrigin::IfExpression(span) => span,
17571752
TypeOrigin::IfExpressionWithNoElse(span) => span,
1758-
TypeOrigin::RangeExpression(span) => span,
17591753
TypeOrigin::EquatePredicate(span) => span,
17601754
TypeOrigin::MainFunctionType(span) => span,
17611755
TypeOrigin::StartFunctionType(span) => span,

‎src/librustc_driver/pretty.rs

Lines changed: 145 additions & 133 deletions
Large diffs are not rendered by default.

‎src/librustc_driver/target_features.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,11 @@ use libc::c_char;
2020
// detection code will walk past the end of the feature array,
2121
// leading to crashes.
2222

23-
const ARM_WHITELIST: &'static [&'static str] = &[
24-
"neon\0",
25-
"vfp2\0",
26-
"vfp3\0",
27-
"vfp4\0",
28-
];
23+
const ARM_WHITELIST: &'static [&'static str] = &["neon\0", "vfp2\0", "vfp3\0", "vfp4\0"];
2924

30-
const X86_WHITELIST: &'static [&'static str] = &[
31-
"avx\0",
32-
"avx2\0",
33-
"bmi\0",
34-
"bmi2\0",
35-
"sse\0",
36-
"sse2\0",
37-
"sse3\0",
38-
"sse4.1\0",
39-
"sse4.2\0",
40-
"ssse3\0",
41-
"tbm\0",
42-
];
25+
const X86_WHITELIST: &'static [&'static str] = &["avx\0", "avx2\0", "bmi\0", "bmi2\0", "sse\0",
26+
"sse2\0", "sse3\0", "sse4.1\0", "sse4.2\0",
27+
"ssse3\0", "tbm\0"];
4328

4429
/// Add `target_feature = "..."` cfgs for a variety of platform
4530
/// specific features (SSE, NEON etc.).
@@ -59,7 +44,7 @@ pub fn add_configuration(cfg: &mut ast::CrateConfig, sess: &Session) {
5944
for feat in whitelist {
6045
assert_eq!(feat.chars().last(), Some('\0'));
6146
if unsafe { LLVMRustHasFeature(target_machine, feat.as_ptr() as *const c_char) } {
62-
cfg.push(attr::mk_name_value_item_str(tf.clone(), intern(&feat[..feat.len()-1])))
47+
cfg.push(attr::mk_name_value_item_str(tf.clone(), intern(&feat[..feat.len() - 1])))
6348
}
6449
}
6550
}

‎src/librustc_driver/test.rs

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use syntax_pos::DUMMY_SP;
4040

4141
use rustc::hir;
4242

43-
struct Env<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
43+
struct Env<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
4444
infcx: &'a infer::InferCtxt<'a, 'gcx, 'tcx>,
4545
}
4646

@@ -86,8 +86,7 @@ impl Emitter for ExpectErrorEmitter {
8686

8787
fn errors(msgs: &[&str]) -> (Box<Emitter + Send>, usize) {
8888
let v = msgs.iter().map(|m| m.to_string()).collect();
89-
(box ExpectErrorEmitter { messages: v } as Box<Emitter + Send>,
90-
msgs.len())
89+
(box ExpectErrorEmitter { messages: v } as Box<Emitter + Send>, msgs.len())
9190
}
9291

9392
fn test_env<F>(source_string: &str,
@@ -103,18 +102,28 @@ fn test_env<F>(source_string: &str,
103102
let dep_graph = DepGraph::new(false);
104103
let _ignore = dep_graph.in_ignore();
105104
let cstore = Rc::new(CStore::new(&dep_graph));
106-
let sess = session::build_session_(options, &dep_graph, None, diagnostic_handler,
107-
Rc::new(CodeMap::new()), cstore.clone());
105+
let sess = session::build_session_(options,
106+
&dep_graph,
107+
None,
108+
diagnostic_handler,
109+
Rc::new(CodeMap::new()),
110+
cstore.clone());
108111
rustc_lint::register_builtins(&mut sess.lint_store.borrow_mut(), Some(&sess));
109112
let input = config::Input::Str {
110113
name: driver::anon_src(),
111114
input: source_string.to_string(),
112115
};
113116
let krate = driver::phase_1_parse_input(&sess, &input).unwrap();
114117
let driver::ExpansionResult { defs, resolutions, mut hir_forest, .. } = {
115-
driver::phase_2_configure_and_expand(
116-
&sess, &cstore, krate, None, "test", None, MakeGlobMap::No, |_| Ok(()),
117-
).expect("phase 2 aborted")
118+
driver::phase_2_configure_and_expand(&sess,
119+
&cstore,
120+
krate,
121+
None,
122+
"test",
123+
None,
124+
MakeGlobMap::No,
125+
|_| Ok(()))
126+
.expect("phase 2 aborted")
118127
};
119128
let _ignore = dep_graph.in_ignore();
120129

@@ -167,14 +176,22 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> {
167176

168177
let node = ast::NodeId::from_u32;
169178
let dscope = self.infcx
170-
.tcx
171-
.region_maps
172-
.intern_code_extent(CodeExtentData::DestructionScope(node(1)),
173-
region::ROOT_CODE_EXTENT);
179+
.tcx
180+
.region_maps
181+
.intern_code_extent(CodeExtentData::DestructionScope(node(1)),
182+
region::ROOT_CODE_EXTENT);
174183
self.create_region_hierarchy(&RH {
175-
id: node(1),
176-
sub: &[RH { id: node(10), sub: &[] }, RH { id: node(11), sub: &[] }],
177-
}, dscope);
184+
id: node(1),
185+
sub: &[RH {
186+
id: node(10),
187+
sub: &[],
188+
},
189+
RH {
190+
id: node(11),
191+
sub: &[],
192+
}],
193+
},
194+
dscope);
178195
}
179196

180197
#[allow(dead_code)] // this seems like it could be useful, even if we don't use it now
@@ -213,22 +230,16 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> {
213230
hir::ItemStatic(..) |
214231
hir::ItemFn(..) |
215232
hir::ItemForeignMod(..) |
216-
hir::ItemTy(..) => {
217-
None
218-
}
233+
hir::ItemTy(..) => None,
219234

220235
hir::ItemEnum(..) |
221236
hir::ItemStruct(..) |
222237
hir::ItemUnion(..) |
223238
hir::ItemTrait(..) |
224239
hir::ItemImpl(..) |
225-
hir::ItemDefaultImpl(..) => {
226-
None
227-
}
240+
hir::ItemDefaultImpl(..) => None,
228241

229-
hir::ItemMod(ref m) => {
230-
search_mod(this, m, idx, names)
231-
}
242+
hir::ItemMod(ref m) => search_mod(this, m, idx, names),
232243
};
233244
}
234245
}
@@ -281,18 +292,17 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> {
281292
self.infcx.tcx.mk_param(index, token::intern(&name[..]))
282293
}
283294

284-
pub fn re_early_bound(&self,
285-
index: u32,
286-
name: &'static str)
287-
-> &'tcx ty::Region {
295+
pub fn re_early_bound(&self, index: u32, name: &'static str) -> &'tcx ty::Region {
288296
let name = token::intern(name);
289297
self.infcx.tcx.mk_region(ty::ReEarlyBound(ty::EarlyBoundRegion {
290298
index: index,
291299
name: name,
292300
}))
293301
}
294302

295-
pub fn re_late_bound_with_debruijn(&self, id: u32, debruijn: ty::DebruijnIndex)
303+
pub fn re_late_bound_with_debruijn(&self,
304+
id: u32,
305+
debruijn: ty::DebruijnIndex)
296306
-> &'tcx ty::Region {
297307
self.infcx.tcx.mk_region(ty::ReLateBound(debruijn, ty::BrAnon(id)))
298308
}
@@ -394,19 +404,15 @@ impl<'a, 'gcx, 'tcx> Env<'a, 'gcx, 'tcx> {
394404

395405
self.assert_eq(t, t_lub);
396406
}
397-
Err(ref e) => {
398-
panic!("unexpected error in LUB: {}", e)
399-
}
407+
Err(ref e) => panic!("unexpected error in LUB: {}", e),
400408
}
401409
}
402410

403411
/// Checks that `GLB(t1,t2) == t_glb`
404412
pub fn check_glb(&self, t1: Ty<'tcx>, t2: Ty<'tcx>, t_glb: Ty<'tcx>) {
405413
debug!("check_glb(t1={}, t2={}, t_glb={})", t1, t2, t_glb);
406414
match self.glb(t1, t2) {
407-
Err(e) => {
408-
panic!("unexpected error computing LUB: {:?}", e)
409-
}
415+
Err(e) => panic!("unexpected error computing LUB: {:?}", e),
410416
Ok(InferOk { obligations, value: t }) => {
411417
// FIXME(#32730) once obligations are being propagated, assert the right thing.
412418
assert!(obligations.is_empty());

‎src/libstd/error.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ pub trait Error: Debug + Display {
6969
/// It should not contain newlines or sentence-ending punctuation,
7070
/// to facilitate embedding in larger user-facing strings.
7171
/// For showing formatted error messages with more information see
72-
/// [Display](https://doc.rust-lang.org/std/fmt/trait.Display.html).
72+
/// [`Display`].
73+
///
74+
/// [`Display`]: ../fmt/trait.Display.html
7375
///
7476
/// # Examples
7577
///

‎src/libstd/io/cursor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use io::{self, SeekFrom, Error, ErrorKind};
2323
///
2424
/// The standard library implements some I/O traits on various types which
2525
/// are commonly used as a buffer, like `Cursor<`[`Vec`]`<u8>>` and
26-
/// `Cursor<`[`&[u8]`]`>`.
26+
/// `Cursor<`[`&[u8]`][bytes]`>`.
2727
///
2828
/// # Examples
2929
///
@@ -35,7 +35,7 @@ use io::{self, SeekFrom, Error, ErrorKind};
3535
/// [`Read`]: ../../std/io/trait.Read.html
3636
/// [`Write`]: ../../std/io/trait.Write.html
3737
/// [`Vec`]: ../../std/vec/struct.Vec.html
38-
/// [`&[u8]`]: ../../std/primitive.slice.html
38+
/// [bytes]: ../../std/primitive.slice.html
3939
/// [`File`]: ../fs/struct.File.html
4040
///
4141
/// ```no_run

‎src/libstd/path.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,7 @@ impl<'a> cmp::Ord for Components<'a> {
914914
/// [`Path`]: struct.Path.html
915915
/// [`push`]: struct.PathBuf.html#method.push
916916
/// [`set_extension`]: struct.PathBuf.html#method.set_extension
917+
/// [`Deref`]: ../ops/trait.Deref.html
917918
///
918919
/// More details about the overall approach can be found in
919920
/// the module documentation.

0 commit comments

Comments
 (0)
Please sign in to comment.