Skip to content

Commit 969491b

Browse files
committed
---
yaml --- r: 105466 b: refs/heads/master c: 8063450 h: refs/heads/master v: v3
1 parent 37ae7ff commit 969491b

File tree

44 files changed

+1804
-353
lines changed

Some content is hidden

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

44 files changed

+1804
-353
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8fcb8dd06506d2a371ef12eec6db855d18f32e17
2+
refs/heads/master: 8063450e5733c99c0fc62898c9d5007e02bbdba5
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b8601a3d8b91ad3b653d143307611f2f5c75617e
55
refs/heads/try: db814977d07bd798feb24f6b74c00800ef458a13

trunk/src/doc/rust.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3136,8 +3136,12 @@ machine.
31363136

31373137
The types `char` and `str` hold textual data.
31383138

3139-
A value of type `char` is a Unicode character,
3140-
represented as a 32-bit unsigned word holding a UCS-4 codepoint.
3139+
A value of type `char` is a [Unicode scalar value](
3140+
http://www.unicode.org/glossary/#unicode_scalar_value)
3141+
(ie. a code point that is not a surrogate),
3142+
represented as a 32-bit unsigned word in the 0x0000 to 0xD7FF
3143+
or 0xE000 to 0x10FFFF range.
3144+
A `[char]` vector is effectively an UCS-4 / UTF-32 string.
31413145

31423146
A value of type `str` is a Unicode string,
31433147
represented as a vector of 8-bit unsigned bytes holding a sequence of UTF-8 codepoints.

trunk/src/doc/rustdoc.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn recalibrate() {
4343
Doc comments are markdown, and are currently parsed with the
4444
[sundown][sundown] library. rustdoc does not yet do any fanciness such as
4545
referencing other items inline, like javadoc's `@see`. One exception to this
46-
is that the first paragrah will be used as the "summary" of an item in the
46+
is that the first paragraph will be used as the "summary" of an item in the
4747
generated documentation:
4848

4949
~~~
@@ -79,11 +79,11 @@ rustdoc can also generate JSON, for consumption by other tools, with
7979

8080
# Using the Documentation
8181

82-
The web pages generated by rustdoc present the same logical heirarchy that one
82+
The web pages generated by rustdoc present the same logical hierarchy that one
8383
writes a library with. Every kind of item (function, struct, etc) has its own
8484
color, and one can always click on a colored type to jump to its
8585
documentation. There is a search bar at the top, which is powered by some
86-
javascript and a statically-generated search index. No special web server is
86+
JavaScript and a statically-generated search index. No special web server is
8787
required for the search.
8888

8989
[sundown]: https://github.com/vmg/sundown/
@@ -108,7 +108,7 @@ code, the `ignore` string can be added to the three-backtick form of markdown
108108
code block.
109109

110110
/**
111-
# nested codefences confuse sundown => indentation + comment to
111+
# nested code fences confuse sundown => indentation + comment to
112112
# avoid failing tests
113113
```
114114
// This is a testable code block
@@ -126,7 +126,7 @@ You can specify that the test's execution should fail with the `should_fail`
126126
directive.
127127

128128
/**
129-
# nested codefences confuse sundown => indentation + comment to
129+
# nested code fences confuse sundown => indentation + comment to
130130
# avoid failing tests
131131
```should_fail
132132
// This code block is expected to generate a failure when run
@@ -138,7 +138,7 @@ You can specify that the code block should be compiled but not run with the
138138
`no_run` directive.
139139

140140
/**
141-
# nested codefences confuse sundown => indentation + comment to
141+
# nested code fences confuse sundown => indentation + comment to
142142
# avoid failing tests
143143
```no_run
144144
// This code will be compiled but not executed
@@ -153,7 +153,7 @@ testing the code block (NB. the space after the `#` is required, so
153153
that one can still write things like `#[deriving(Eq)]`).
154154

155155
/**
156-
# nested codefences confuse sundown => indentation + comment to
156+
# nested code fences confuse sundown => indentation + comment to
157157
# avoid failing tests
158158
```rust
159159
# /!\ The three following lines are comments, which are usually stripped off by
@@ -162,7 +162,7 @@ that one can still write things like `#[deriving(Eq)]`).
162162
# these first five lines but a non breakable one.
163163
#
164164
# // showing 'fib' in this documentation would just be tedious and detracts from
165-
# // what's actualy being documented.
165+
# // what's actually being documented.
166166
# fn fib(n: int) { n + 2 }
167167

168168
do spawn { fib(200); }
@@ -190,7 +190,7 @@ $ rustdoc --test lib.rs --test-args '--help'
190190
~~~
191191

192192
When testing a library, code examples will often show how functions are used,
193-
and this code often requires `use`-ing paths from the crate. To accomodate this,
193+
and this code often requires `use`-ing paths from the crate. To accommodate this,
194194
rustdoc will implicitly add `extern crate <crate>;` where `<crate>` is the name of
195195
the crate being tested to the top of each code example. This means that rustdoc
196196
must be able to find a compiled version of the library crate being tested. Extra

trunk/src/libgetopts/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
#[doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
8484
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
8585
html_root_url = "http://static.rust-lang.org/doc/master")];
86-
#[allow(missing_doc)];
86+
#[deny(missing_doc)];
8787
#[allow(deprecated_owned_vector)];
8888

8989
#[feature(globs, phase)];

trunk/src/libnum/bigint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl TotalOrd for BigUint {
117117
if s_len < o_len { return Less; }
118118
if s_len > o_len { return Greater; }
119119

120-
for (&self_i, &other_i) in self.data.rev_iter().zip(other.data.rev_iter()) {
120+
for (&self_i, &other_i) in self.data.iter().rev().zip(other.data.iter().rev()) {
121121
if self_i < other_i { return Less; }
122122
if self_i > other_i { return Greater; }
123123
}
@@ -788,7 +788,7 @@ impl BigUint {
788788

789789
let mut borrow = 0;
790790
let mut shifted_rev = Vec::with_capacity(self.data.len());
791-
for elem in self.data.rev_iter() {
791+
for elem in self.data.iter().rev() {
792792
shifted_rev.push((*elem >> n_bits) | borrow);
793793
borrow = *elem << (BigDigit::bits - n_bits);
794794
}

trunk/src/librustc/driver/driver.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ pub fn phase_1_parse_input(sess: &Session, cfg: ast::CrateConfig, input: &Input)
186186
});
187187

188188
if sess.opts.debugging_opts & session::AST_JSON_NOEXPAND != 0 {
189-
let mut stdout = io::stdout();
189+
let mut stdout = io::BufferedWriter::new(io::stdout());
190190
let mut json = json::PrettyEncoder::new(&mut stdout);
191191
krate.encode(&mut json);
192192
}
@@ -261,7 +261,7 @@ pub fn phase_2_configure_and_expand(sess: &Session,
261261
front::assign_node_ids_and_map::assign_node_ids_and_map(sess, krate));
262262

263263
if sess.opts.debugging_opts & session::AST_JSON != 0 {
264-
let mut stdout = io::stdout();
264+
let mut stdout = io::BufferedWriter::new(io::stdout());
265265
let mut json = json::PrettyEncoder::new(&mut stdout);
266266
krate.encode(&mut json);
267267
}
@@ -596,15 +596,15 @@ struct IdentifiedAnnotation;
596596

597597
impl pprust::PpAnn for IdentifiedAnnotation {
598598
fn pre(&self,
599-
s: &mut pprust::State<IdentifiedAnnotation>,
599+
s: &mut pprust::State,
600600
node: pprust::AnnNode) -> io::IoResult<()> {
601601
match node {
602602
pprust::NodeExpr(_) => s.popen(),
603603
_ => Ok(())
604604
}
605605
}
606606
fn post(&self,
607-
s: &mut pprust::State<IdentifiedAnnotation>,
607+
s: &mut pprust::State,
608608
node: pprust::AnnNode) -> io::IoResult<()> {
609609
match node {
610610
pprust::NodeItem(item) => {
@@ -634,15 +634,15 @@ struct TypedAnnotation {
634634
635635
impl pprust::PpAnn for TypedAnnotation {
636636
fn pre(&self,
637-
s: &mut pprust::State<TypedAnnotation>,
637+
s: &mut pprust::State,
638638
node: pprust::AnnNode) -> io::IoResult<()> {
639639
match node {
640640
pprust::NodeExpr(_) => s.popen(),
641641
_ => Ok(())
642642
}
643643
}
644644
fn post(&self,
645-
s: &mut pprust::State<TypedAnnotation>,
645+
s: &mut pprust::State,
646646
node: pprust::AnnNode) -> io::IoResult<()> {
647647
let tcx = &self.analysis.ty_cx;
648648
match node {

trunk/src/librustc/front/test.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,9 @@ impl<'a> fold::Folder for TestHarnessGenerator<'a> {
9595
debug!("current path: {}",
9696
ast_util::path_name_i(self.cx.path.get().as_slice()));
9797

98-
if is_test_fn(&self.cx, i) || is_bench_fn(i) {
98+
if is_test_fn(&self.cx, i) || is_bench_fn(&self.cx, i) {
9999
match i.node {
100-
ast::ItemFn(_, purity, _, _, _)
101-
if purity == ast::UnsafeFn => {
100+
ast::ItemFn(_, ast::UnsafeFn, _, _, _) => {
102101
let sess = self.cx.sess;
103102
sess.span_fatal(i.span,
104103
"unsafe functions cannot be used for \
@@ -109,7 +108,7 @@ impl<'a> fold::Folder for TestHarnessGenerator<'a> {
109108
let test = Test {
110109
span: i.span,
111110
path: self.cx.path.get(),
112-
bench: is_bench_fn(i),
111+
bench: is_bench_fn(&self.cx, i),
113112
ignore: is_ignored(&self.cx, i),
114113
should_fail: should_fail(i)
115114
};
@@ -233,7 +232,7 @@ fn is_test_fn(cx: &TestCtxt, i: @ast::Item) -> bool {
233232
return has_test_attr && has_test_signature(i);
234233
}
235234

236-
fn is_bench_fn(i: @ast::Item) -> bool {
235+
fn is_bench_fn(cx: &TestCtxt, i: @ast::Item) -> bool {
237236
let has_bench_attr = attr::contains_name(i.attrs.as_slice(), "bench");
238237

239238
fn has_test_signature(i: @ast::Item) -> bool {
@@ -254,6 +253,12 @@ fn is_bench_fn(i: @ast::Item) -> bool {
254253
}
255254
}
256255

256+
if has_bench_attr && !has_test_signature(i) {
257+
let sess = cx.sess;
258+
sess.span_err(i.span, "functions used as benches must have signature \
259+
`fn(&mut BenchHarness) -> ()`");
260+
}
261+
257262
return has_bench_attr && has_test_signature(i);
258263
}
259264

trunk/src/librustc/lib/llvm.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,22 @@ pub enum Visibility {
4343
ProtectedVisibility = 2,
4444
}
4545

46+
// This enum omits the obsolete (and no-op) linkage types DLLImportLinkage,
47+
// DLLExportLinkage, GhostLinkage and LinkOnceODRAutoHideLinkage.
48+
// LinkerPrivateLinkage and LinkerPrivateWeakLinkage are not included either;
49+
// they've been removed in upstream LLVM commit r203866.
4650
pub enum Linkage {
4751
ExternalLinkage = 0,
4852
AvailableExternallyLinkage = 1,
4953
LinkOnceAnyLinkage = 2,
5054
LinkOnceODRLinkage = 3,
51-
LinkOnceODRAutoHideLinkage = 4,
5255
WeakAnyLinkage = 5,
5356
WeakODRLinkage = 6,
5457
AppendingLinkage = 7,
5558
InternalLinkage = 8,
5659
PrivateLinkage = 9,
57-
DLLImportLinkage = 10,
58-
DLLExportLinkage = 11,
5960
ExternalWeakLinkage = 12,
60-
GhostLinkage = 13,
6161
CommonLinkage = 14,
62-
LinkerPrivateLinkage = 15,
63-
LinkerPrivateWeakLinkage = 16,
6462
}
6563

6664
#[deriving(Clone)]

trunk/src/librustc/middle/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ fn is_useful(cx: &MatchCheckCtxt, m: &matrix, v: &[@Pat]) -> useful {
288288
is_useful_specialized(cx, m, v, vec(n), n, left_ty)
289289
}
290290
ty::ty_unboxed_vec(..) | ty::ty_vec(..) => {
291-
let max_len = m.rev_iter().fold(0, |max_len, r| {
291+
let max_len = m.iter().rev().fold(0, |max_len, r| {
292292
match r.get(0).node {
293293
PatVec(ref before, _, ref after) => {
294294
cmp::max(before.len() + after.len(), max_len)

trunk/src/librustc/middle/dataflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct LoopScope<'a> {
8585

8686
impl<'a, O:DataFlowOperator> pprust::PpAnn for DataFlowContext<'a, O> {
8787
fn pre(&self,
88-
ps: &mut pprust::State<DataFlowContext<'a, O>>,
88+
ps: &mut pprust::State,
8989
node: pprust::AnnNode) -> io::IoResult<()> {
9090
let id = match node {
9191
pprust::NodeExpr(expr) => expr.id,

trunk/src/librustc/middle/liveness.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ impl<'a> Liveness<'a> {
879879
fn propagate_through_block(&mut self, blk: &Block, succ: LiveNode)
880880
-> LiveNode {
881881
let succ = self.propagate_through_opt_expr(blk.expr, succ);
882-
blk.stmts.rev_iter().fold(succ, |succ, stmt| {
882+
blk.stmts.iter().rev().fold(succ, |succ, stmt| {
883883
self.propagate_through_stmt(*stmt, succ)
884884
})
885885
}
@@ -980,7 +980,7 @@ impl<'a> Liveness<'a> {
980980
this.ir.tcx.sess.span_bug(expr.span, "no registered caps");
981981
}
982982
};
983-
caps.deref().rev_iter().fold(succ, |succ, cap| {
983+
caps.deref().iter().rev().fold(succ, |succ, cap| {
984984
this.init_from_succ(cap.ln, succ);
985985
let var = this.variable(cap.var_nid, expr.span);
986986
this.acc(cap.ln, var, ACC_READ | ACC_USE);
@@ -1121,7 +1121,7 @@ impl<'a> Liveness<'a> {
11211121

11221122
ExprStruct(_, ref fields, with_expr) => {
11231123
let succ = self.propagate_through_opt_expr(with_expr, succ);
1124-
fields.rev_iter().fold(succ, |succ, field| {
1124+
fields.iter().rev().fold(succ, |succ, field| {
11251125
self.propagate_through_expr(field.expr, succ)
11261126
})
11271127
}
@@ -1173,14 +1173,14 @@ impl<'a> Liveness<'a> {
11731173
}
11741174

11751175
ExprInlineAsm(ref ia) => {
1176-
let succ = ia.outputs.rev_iter().fold(succ, |succ, &(_, expr)| {
1176+
let succ = ia.outputs.iter().rev().fold(succ, |succ, &(_, expr)| {
11771177
// see comment on lvalues in
11781178
// propagate_through_lvalue_components()
11791179
let succ = self.write_lvalue(expr, succ, ACC_WRITE);
11801180
self.propagate_through_lvalue_components(expr, succ)
11811181
});
11821182
// Inputs are executed first. Propagate last because of rev order
1183-
ia.inputs.rev_iter().fold(succ, |succ, &(_, expr)| {
1183+
ia.inputs.iter().rev().fold(succ, |succ, &(_, expr)| {
11841184
self.propagate_through_expr(expr, succ)
11851185
})
11861186
}

trunk/src/librustc/middle/resolve.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5520,7 +5520,8 @@ impl<'a> Resolver<'a> {
55205520
if idents.len() == 0 {
55215521
return ~"???";
55225522
}
5523-
return self.idents_to_str(idents.move_rev_iter()
5523+
return self.idents_to_str(idents.move_iter()
5524+
.rev()
55245525
.collect::<Vec<ast::Ident>>()
55255526
.as_slice());
55265527
}

trunk/src/librustc/middle/trans/foreign.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ pub fn llvm_linkage_by_name(name: &str) -> Option<Linkage> {
121121
"extern_weak" => Some(lib::llvm::ExternalWeakLinkage),
122122
"external" => Some(lib::llvm::ExternalLinkage),
123123
"internal" => Some(lib::llvm::InternalLinkage),
124-
"linker_private" => Some(lib::llvm::LinkerPrivateLinkage),
125-
"linker_private_weak" => Some(lib::llvm::LinkerPrivateWeakLinkage),
126124
"linkonce" => Some(lib::llvm::LinkOnceAnyLinkage),
127125
"linkonce_odr" => Some(lib::llvm::LinkOnceODRLinkage),
128126
"private" => Some(lib::llvm::PrivateLinkage),

trunk/src/librustc/middle/typeck/check/vtable.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ fn lookup_vtables(vcx: &VtableContext,
9494
// We do this backwards for reasons discussed above.
9595
assert_eq!(substs.tps.len(), type_param_defs.len());
9696
let mut result: Vec<vtable_param_res> =
97-
substs.tps.rev_iter()
97+
substs.tps.iter()
98+
.rev()
9899
.zip(type_param_defs.rev_iter())
99100
.map(|(ty, def)|
100101
lookup_vtables_for_param(vcx, span, Some(substs),

trunk/src/librustc/middle/typeck/collect.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ use util::ppaux::Repr;
4848
use std::rc::Rc;
4949
use std::vec_ng::Vec;
5050
use std::vec_ng;
51+
use collections::HashSet;
52+
5153
use syntax::abi::AbiSet;
5254
use syntax::ast::{RegionTyParamBound, TraitTyParamBound};
5355
use syntax::ast;
@@ -478,7 +480,12 @@ fn convert_methods(ccx: &CrateCtxt,
478480
rcvr_visibility: ast::Visibility)
479481
{
480482
let tcx = ccx.tcx;
483+
let mut seen_methods = HashSet::new();
481484
for m in ms.iter() {
485+
if !seen_methods.insert(m.ident.repr(ccx.tcx)) {
486+
tcx.sess.span_err(m.span, "duplicate method in trait impl");
487+
}
488+
482489
let num_rcvr_ty_params = rcvr_ty_generics.type_param_defs().len();
483490
let m_ty_generics = ty_generics_for_fn_or_method(ccx, &m.generics,
484491
num_rcvr_ty_params);

0 commit comments

Comments
 (0)