Skip to content

Commit 786a463

Browse files
author
Ariel Ben-Yehuda
committed
---
yaml --- r: 215021 b: refs/heads/beta c: 595409d h: refs/heads/master i: 215019: ad420cb v: v3
1 parent 5691425 commit 786a463

File tree

28 files changed

+384
-334
lines changed

28 files changed

+384
-334
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 19a39710c494d9300ffdc4e3f40dfda0ef62f7ba
26+
refs/heads/beta: 595409df06526281a81141d240d2f88f097f3256
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 8c0aa6d64ebab528f7eb182812007155d6044972
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/configure

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,12 +1307,6 @@ CFG_LLVM_SRC_DIR=${CFG_SRC_DIR}src/llvm/
13071307
for t in $CFG_HOST
13081308
do
13091309
do_reconfigure=1
1310-
is_msvc=0
1311-
case "$t" in
1312-
(*-msvc)
1313-
is_msvc=1
1314-
;;
1315-
esac
13161310

13171311
if [ -z $CFG_LLVM_ROOT ]
13181312
then
@@ -1332,13 +1326,7 @@ do
13321326
LLVM_ASSERTION_OPTS="--disable-assertions"
13331327
else
13341328
LLVM_ASSERTION_OPTS="--enable-assertions"
1335-
1336-
# Apparently even if we request assertions be enabled for MSVC,
1337-
# LLVM's CMake build system ignore this and outputs in `Release`
1338-
# anyway.
1339-
if [ ${is_msvc} -eq 0 ]; then
1340-
LLVM_INST_DIR=${LLVM_INST_DIR}+Asserts
1341-
fi
1329+
LLVM_INST_DIR=${LLVM_INST_DIR}+Asserts
13421330
fi
13431331
else
13441332
msg "not reconfiguring LLVM, external LLVM root"
@@ -1368,7 +1356,14 @@ do
13681356
done
13691357
fi
13701358

1371-
if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -ne 0 ]
1359+
use_cmake=0
1360+
case "$t" in
1361+
(*-msvc)
1362+
use_cmake=1
1363+
;;
1364+
esac
1365+
1366+
if [ ${do_reconfigure} -ne 0 ] && [ ${use_cmake} -ne 0 ]
13721367
then
13731368
msg "configuring LLVM for $t with cmake"
13741369

@@ -1393,7 +1388,7 @@ do
13931388
need_ok "LLVM cmake configure failed"
13941389
fi
13951390

1396-
if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -eq 0 ]
1391+
if [ ${do_reconfigure} -ne 0 ] && [ ${use_cmake} -eq 0 ]
13971392
then
13981393
# LLVM's configure doesn't recognize the new Windows triples yet
13991394
gnu_t=$(to_gnu_triple $t)

branches/beta/src/doc/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ series of small examples.
2525
If you need help with something, or just want to talk about Rust with others,
2626
there are a few places you can do that:
2727

28-
The Rust IRC channels on [irc.mozilla.org](irc://irc.mozilla.org/) are the
28+
The Rust IRC channels on [irc.mozilla.org](http://irc.mozilla.org/) are the
2929
fastest way to get help.
3030
[`#rust`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust) is
3131
the general discussion channel, and you'll find people willing to help you with
@@ -40,15 +40,15 @@ There's also
4040
[`#rust-internals`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals), which is for discussion of the development of Rust itself.
4141

4242
You can also get help on [Stack
43-
Overflow](https://stackoverflow.com/questions/tagged/rust). Searching for your
43+
Overflow](http://stackoverflow.com/questions/tagged/rust). Searching for your
4444
problem might reveal someone who has asked it before!
4545

46-
There is an active [subreddit](https://reddit.com/r/rust) with lots of
46+
There is an active [subreddit](http://reddit.com/r/rust) with lots of
4747
discussion and news about Rust.
4848

49-
There is also a [user forum](https://users.rust-lang.org), for all
50-
user-oriented discussion, and a [developer
51-
forum](https://internals.rust-lang.org/), where the development of Rust
49+
There is also a [user forum](http://users.rust-lang.org), for all
50+
user-oriented discussion, and a [developer
51+
forum](http://internals.rust-lang.org/), where the development of Rust
5252
itself is discussed.
5353

5454
# Specification
@@ -61,7 +61,7 @@ the language in as much detail as possible is in [the reference](reference.html)
6161
Rust is still a young language, so there isn't a ton of tooling yet, but the
6262
tools we have are really nice.
6363

64-
[Cargo](https://crates.io) is Rust's package manager, and its website contains
64+
[Cargo](http://crates.io) is Rust's package manager, and its website contains
6565
lots of good documentation.
6666

6767
[`rustdoc`](book/documentation.html) is used to generate documentation for Rust code.

branches/beta/src/doc/trpl/for-loops.md

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -41,45 +41,3 @@ so our loop will print `0` through `9`, not `10`.
4141
Rust does not have the “C-style” `for` loop on purpose. Manually controlling
4242
each element of the loop is complicated and error prone, even for experienced C
4343
developers.
44-
45-
# Enumerate
46-
47-
When you need to keep track of how many times you already looped, you can use the `.enumerate()` function.
48-
49-
## On ranges:
50-
51-
```rust
52-
for (i,j) in (5..10).enumerate() {
53-
println!("i = {} and j = {}", i, j);
54-
}
55-
```
56-
57-
Outputs:
58-
59-
```text
60-
i = 0 and j = 5
61-
i = 1 and j = 6
62-
i = 2 and j = 7
63-
i = 3 and j = 8
64-
i = 4 and j = 9
65-
```
66-
67-
Don't forget to add the parentheses around the range.
68-
69-
## On iterators:
70-
71-
```rust
72-
# let lines = "hello\nworld".lines();
73-
for (linenumber, line) in lines.enumerate() {
74-
println!("{}: {}", linenumber, line);
75-
}
76-
```
77-
78-
Outputs:
79-
80-
```text
81-
0: Content of line one
82-
1: Content of line two
83-
2: Content of line tree
84-
3: Content of line four
85-
```

branches/beta/src/doc/trpl/macros.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ more" match. Both forms optionally include a separator, which can be any token
224224
except `+` or `*`.
225225

226226
This system is based on
227-
"[Macro-by-Example](https://www.cs.indiana.edu/ftp/techreports/TR206.pdf)"
227+
"[Macro-by-Example](http://www.cs.indiana.edu/ftp/techreports/TR206.pdf)"
228228
(PDF link).
229229

230230
# Hygiene
@@ -319,7 +319,7 @@ syntax context where it was introduced. It’s as though the variable `state`
319319
inside `main` is painted a different "color" from the variable `state` inside
320320
the macro, and therefore they don’t conflict.
321321

322-
[hygienic macro system]: https://en.wikipedia.org/wiki/Hygienic_macro
322+
[hygienic macro system]: http://en.wikipedia.org/wiki/Hygienic_macro
323323

324324
This also restricts the ability of macros to introduce new bindings at the
325325
invocation site. Code such as the following will not work:
@@ -622,7 +622,7 @@ invocation gives you another opportunity to pattern-match the macro’s
622622
arguments.
623623

624624
As an extreme example, it is possible, though hardly advisable, to implement
625-
the [Bitwise Cyclic Tag](https://esolangs.org/wiki/Bitwise_Cyclic_Tag) automaton
625+
the [Bitwise Cyclic Tag](http://esolangs.org/wiki/Bitwise_Cyclic_Tag) automaton
626626
within Rust’s macro system.
627627

628628
```rust

branches/beta/src/doc/trpl/references-and-borrowing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ First, any borrow must last for a smaller scope than the owner. Second, you may
155155
have one or the other of these two kinds of borrows, but not both at the same
156156
time:
157157

158-
* one or more references (`&T`) to a resource.
158+
* 0 to N references (`&T`) to a resource.
159159
* exactly one mutable reference (`&mut T`)
160160

161161

branches/beta/src/liballoc/arc.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,6 @@ impl<T: ?Sized> Deref for Arc<T> {
332332
}
333333
}
334334

335-
#[stable(feature = "rc_arc_as_ref", since = "1.2.0")]
336-
impl<T: ?Sized> AsRef<T> for Arc<T> {
337-
338-
#[inline]
339-
fn as_ref(&self) -> &T {
340-
&self.inner().data
341-
}
342-
}
343-
344335
impl<T: Clone> Arc<T> {
345336
/// Make a mutable reference from the given `Arc<T>`.
346337
///

branches/beta/src/liballoc/rc.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ use std::boxed;
156156
use core::cell::Cell;
157157
use core::clone::Clone;
158158
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
159-
use core::convert::AsRef;
160159
use core::default::Default;
161160
use core::fmt;
162161
use core::hash::{Hasher, Hash};
@@ -380,15 +379,6 @@ impl<T: ?Sized> Deref for Rc<T> {
380379
}
381380
}
382381

383-
#[stable(feature = "rc_arc_as_ref", since = "1.2.0")]
384-
impl<T: ?Sized> AsRef<T> for Rc<T> {
385-
386-
#[inline(always)]
387-
fn as_ref(&self) -> &T {
388-
&self.inner().value
389-
}
390-
}
391-
392382
#[stable(feature = "rust1", since = "1.0.0")]
393383
impl<T: ?Sized> Drop for Rc<T> {
394384
/// Drops the `Rc<T>`.

branches/beta/src/libcollections/linked_list.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -609,13 +609,7 @@ impl<T> LinkedList<T> {
609609
length: len - at
610610
};
611611

612-
// Swap split_node.next with list_head (which is None), nulling out split_node.next,
613-
// as it is the new tail.
614612
mem::swap(&mut split_node.resolve().unwrap().next, &mut splitted_list.list_head);
615-
// Null out list_head.prev. Note this `unwrap` won't fail because if at == len
616-
// we already branched out at the top of the fn to return the empty list.
617-
splitted_list.list_head.as_mut().unwrap().prev = Rawlink::none();
618-
// Fix the tail ptr
619613
self.list_tail = split_node;
620614
self.length = at;
621615

@@ -1081,26 +1075,6 @@ mod tests {
10811075
}
10821076
}
10831077

1084-
#[test]
1085-
fn test_26021() {
1086-
use std::iter::ExactSizeIterator;
1087-
// There was a bug in split_off that failed to null out the RHS's head's prev ptr.
1088-
// This caused the RHS's dtor to walk up into the LHS at drop and delete all of
1089-
// its nodes.
1090-
//
1091-
// https://github.com/rust-lang/rust/issues/26021
1092-
let mut v1 = LinkedList::new();
1093-
v1.push_front(1u8);
1094-
v1.push_front(1u8);
1095-
v1.push_front(1u8);
1096-
v1.push_front(1u8);
1097-
let _ = v1.split_off(3); // Dropping this now should not cause laundry consumption
1098-
assert_eq!(v1.len(), 3);
1099-
1100-
assert_eq!(v1.iter().len(), 3);
1101-
assert_eq!(v1.iter().collect::<Vec<_>>().len(), 3);
1102-
}
1103-
11041078
#[cfg(test)]
11051079
fn fuzz_test(sz: i32) {
11061080
let mut m: LinkedList<_> = LinkedList::new();

branches/beta/src/libcore/cell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
//!
3939
//! * Introducing inherited mutability roots to shared types.
4040
//! * Implementation details of logically-immutable methods.
41-
//! * Mutating implementations of `Clone`.
41+
//! * Mutating implementations of `clone`.
4242
//!
4343
//! ## Introducing inherited mutability roots to shared types
4444
//!
@@ -109,7 +109,7 @@
109109
//! }
110110
//! ```
111111
//!
112-
//! ## Mutating implementations of `Clone`
112+
//! ## Mutating implementations of `clone`
113113
//!
114114
//! This is simply a special - but common - case of the previous: hiding mutability for operations
115115
//! that appear to be immutable. The `clone` method is expected to not change the source value, and

branches/beta/src/liblibc/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6308,8 +6308,8 @@ pub mod funcs {
63086308
lpOverlapped: LPOVERLAPPED) -> BOOL;
63096309
pub fn WriteFile(hFile: HANDLE,
63106310
lpBuffer: LPVOID,
6311-
nNumberOfBytesToWrite: DWORD,
6312-
lpNumberOfBytesWritten: LPDWORD,
6311+
nNumberOfBytesToRead: DWORD,
6312+
lpNumberOfBytesRead: LPDWORD,
63136313
lpOverlapped: LPOVERLAPPED) -> BOOL;
63146314
pub fn SetFilePointerEx(hFile: HANDLE,
63156315
liDistanceToMove: LARGE_INTEGER,

branches/beta/src/librustc/metadata/csearch.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use metadata::common::*;
1414
use metadata::cstore;
1515
use metadata::decoder;
16+
use middle::def;
1617
use middle::lang_items;
1718
use middle::ty;
1819

@@ -113,6 +114,12 @@ pub fn maybe_get_item_ast<'tcx>(tcx: &ty::ctxt<'tcx>, def: ast::DefId,
113114
decoder::maybe_get_item_ast(&*cdata, tcx, def.node, decode_inlined_item)
114115
}
115116

117+
pub fn get_enum_variant_defs(cstore: &cstore::CStore, enum_id: ast::DefId)
118+
-> Vec<(def::Def, ast::Name, ast::Visibility)> {
119+
let cdata = cstore.get_crate_data(enum_id.krate);
120+
decoder::get_enum_variant_defs(&*cstore.intr, &*cdata, enum_id.node)
121+
}
122+
116123
pub fn get_enum_variants<'tcx>(tcx: &ty::ctxt<'tcx>, def: ast::DefId)
117124
-> Vec<Rc<ty::VariantInfo<'tcx>>> {
118125
let cstore = &tcx.sess.cstore;

branches/beta/src/librustc/metadata/decoder.rs

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,30 @@ fn item_trait_ref<'tcx>(doc: rbml::Doc, tcx: &ty::ctxt<'tcx>, cdata: Cmd)
268268
doc_trait_ref(tp, tcx, cdata)
269269
}
270270

271+
struct EnumVariantIds<'a> {
272+
iter: reader::TaggedDocsIterator<'a>,
273+
cdata: Cmd<'a>,
274+
}
275+
276+
impl<'a> Iterator for EnumVariantIds<'a> {
277+
type Item = ast::DefId;
278+
279+
fn next(&mut self) -> Option<ast::DefId> {
280+
self.iter.next().map(|p| translated_def_id(self.cdata, p))
281+
}
282+
283+
fn size_hint(&self) -> (usize, Option<usize>) {
284+
self.iter.size_hint()
285+
}
286+
}
287+
288+
fn enum_variant_ids<'a>(item: rbml::Doc<'a>, cdata: Cmd<'a>) -> EnumVariantIds<'a> {
289+
EnumVariantIds {
290+
iter: reader::tagged_docs(item, tag_items_data_item_variant),
291+
cdata: cdata,
292+
}
293+
}
294+
271295
fn item_path(item_doc: rbml::Doc) -> Vec<ast_map::PathElem> {
272296
let path_doc = reader::get_doc(item_doc, tag_path);
273297
reader::docs(path_doc).filter_map(|(tag, elt_doc)| {
@@ -706,14 +730,31 @@ pub fn maybe_get_item_ast<'tcx>(cdata: Cmd, tcx: &ty::ctxt<'tcx>, id: ast::NodeI
706730
}
707731
}
708732

733+
pub fn get_enum_variant_defs(intr: &IdentInterner,
734+
cdata: Cmd,
735+
id: ast::NodeId)
736+
-> Vec<(def::Def, ast::Name, ast::Visibility)> {
737+
let data = cdata.data();
738+
let items = reader::get_doc(rbml::Doc::new(data), tag_items);
739+
let item = find_item(id, items);
740+
enum_variant_ids(item, cdata).map(|did| {
741+
let item = find_item(did.node, items);
742+
let name = item_name(intr, item);
743+
let visibility = item_visibility(item);
744+
match item_to_def_like(cdata, item, did) {
745+
DlDef(def @ def::DefVariant(..)) => (def, name, visibility),
746+
_ => unreachable!()
747+
}
748+
}).collect()
749+
}
750+
709751
pub fn get_enum_variants<'tcx>(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::NodeId,
710752
tcx: &ty::ctxt<'tcx>) -> Vec<Rc<ty::VariantInfo<'tcx>>> {
711753
let data = cdata.data();
712754
let items = reader::get_doc(rbml::Doc::new(data), tag_items);
713755
let item = find_item(id, items);
714756
let mut disr_val = 0;
715-
reader::tagged_docs(item, tag_items_data_item_variant).map(|p| {
716-
let did = translated_def_id(cdata, p);
757+
enum_variant_ids(item, cdata).map(|did| {
717758
let item = find_item(did.node, items);
718759
let ctor_ty = item_type(ast::DefId { krate: cdata.cnum, node: id},
719760
item, tcx, cdata);

branches/beta/src/librustc/middle/check_rvalues.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<'a, 'tcx> euv::Delegate<'tcx> for RvalueContextDelegate<'a, 'tcx> {
6060
cmt: mc::cmt<'tcx>,
6161
_: euv::ConsumeMode) {
6262
debug!("consume; cmt: {:?}; type: {}", *cmt, ty_to_string(self.tcx, cmt.ty));
63-
if !ty::type_is_sized(self.param_env, span, cmt.ty) {
63+
if !ty::type_is_sized(Some(self.param_env), self.tcx, span, cmt.ty) {
6464
span_err!(self.tcx.sess, span, E0161,
6565
"cannot move a value of type {0}: the size of {0} cannot be statically determined",
6666
ty_to_string(self.tcx, cmt.ty));

branches/beta/src/librustc/middle/intrinsicck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ impl<'a, 'tcx> IntrinsicCheckingVisitor<'a, 'tcx> {
212212
debug!("with_each_combination: space={:?}, index={}, param_ty={}",
213213
space, index, param_ty.repr(self.tcx));
214214

215-
if !ty::type_is_sized(param_env, span, param_ty) {
215+
if !ty::type_is_sized(Some(param_env), self.tcx, span, param_ty) {
216216
debug!("with_each_combination: param_ty is not known to be sized");
217217

218218
substs.types.get_mut_slice(space)[index] = self.dummy_unsized_ty;

0 commit comments

Comments
 (0)