Skip to content

Commit 59a5d1c

Browse files
committed
---
yaml --- r: 207685 b: refs/heads/tmp c: e30c6d1 h: refs/heads/master i: 207683: e609b43 v: v3
1 parent e382aa3 commit 59a5d1c

File tree

6 files changed

+23
-19
lines changed

6 files changed

+23
-19
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: cd7d89af9169885642d43597302af69f842bbd78
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: 1725fe4a2528f0bf46bf8f9b5fe35effb31622fd
35+
refs/heads/tmp: e30c6d131f8a0cd49fd57c263e16f6734f27bbd3
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: 704c2ee730d2e948d11a2edd77e3f35de8329a6e
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/mk/docs.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ ERR_IDX_GEN = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE)
7777

7878
D := $(S)src/doc
7979

80-
# FIXME (#25705) eventually may want to put error-index target back here.
81-
DOC_TARGETS := trpl style
80+
DOC_TARGETS := trpl style error-index
8281
COMPILER_DOC_TARGETS :=
8382
DOC_L10N_TARGETS :=
8483

branches/tmp/src/doc/reference.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3622,14 +3622,6 @@ The `Sized` trait indicates that the size of this type is known at compile-time.
36223622
The `Drop` trait provides a destructor, to be run whenever a value of this type
36233623
is to be destroyed.
36243624

3625-
## The `Deref` trait
3626-
3627-
The `Deref<Target = U>` trait allows a type to implicitly implement all the methods
3628-
of the type `U`. When attempting to resolve a method call, the compiler will search
3629-
the top-level type for the implementation of the called method. If no such method is
3630-
found, `.deref()` is called and the compiler continues to search for the method
3631-
implementation in the returned type `U`.
3632-
36333625
# Memory model
36343626

36353627
A Rust program's memory consists of a static set of *items* and a *heap*.

branches/tmp/src/doc/trpl/guessing-game.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ a few tricks up their sleeves.
148148
For example, they’re [immutable][immutable] by default. That’s why our example
149149
uses `mut`: it makes a binding mutable, rather than immutable. `let` doesn’t
150150
take a name on the left hand side, it actually accepts a
151-
[pattern][patterns]’. We’ll use patterns later. It’s easy enough
151+
[pattern][patterns]’. We’ll use patterns more later. It’s easy enough
152152
to use for now:
153153

154154
```rust

branches/tmp/src/doc/trpl/the-stack-and-the-heap.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ allocated on the heap:
277277
| 0 | x | ?????? |
278278

279279
[drop]: drop.html
280-
[^moving]: We can make the memory live longer by transferring ownership,
281-
sometimes called ‘moving out of the box’. More complex examples will
282-
be covered later.
280+
[moving]: We can make the memory live longer by transferring ownership,
281+
sometimes called ‘moving out of the box’. More complex examples will
282+
be covered later.
283283

284284

285285
And then the stack frame goes away, freeing all of our memory.

branches/tmp/src/libsyntax/diagnostics/plugin.rs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use std::collections::BTreeMap;
1414
use ast;
1515
use ast::{Ident, Name, TokenTree};
1616
use codemap::Span;
17+
use diagnostics::metadata::{check_uniqueness, output_metadata, Duplicate};
1718
use ext::base::{ExtCtxt, MacEager, MacResult};
1819
use ext::build::AstBuilder;
1920
use parse::token;
@@ -147,7 +148,7 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
147148
token_tree: &[TokenTree])
148149
-> Box<MacResult+'cx> {
149150
assert_eq!(token_tree.len(), 3);
150-
let (_crate_name, name) = match (&token_tree[0], &token_tree[2]) {
151+
let (crate_name, name) = match (&token_tree[0], &token_tree[2]) {
151152
(
152153
// Crate name.
153154
&ast::TtToken(_, token::Ident(ref crate_name, _)),
@@ -157,9 +158,21 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
157158
_ => unreachable!()
158159
};
159160

160-
// FIXME (#25705): we used to ensure error code uniqueness and
161-
// output error description JSON metadata here, but the approach
162-
// employed was too brittle.
161+
// Check uniqueness of errors and output metadata.
162+
with_registered_diagnostics(|diagnostics| {
163+
match check_uniqueness(crate_name, &*diagnostics) {
164+
Ok(Duplicate(err, location)) => {
165+
ecx.span_err(span, &format!(
166+
"error {} from `{}' also found in `{}'",
167+
err, crate_name, location
168+
));
169+
},
170+
Ok(_) => (),
171+
Err(e) => panic!("{}", e.description())
172+
}
173+
174+
output_metadata(&*ecx, crate_name, &*diagnostics).ok().expect("metadata output error");
175+
});
163176

164177
// Construct the output expression.
165178
let (count, expr) =

0 commit comments

Comments
 (0)