Skip to content

Commit 328565c

Browse files
committed
---
yaml --- r: 211863 b: refs/heads/auto c: a190394 h: refs/heads/master i: 211861: cd41602 211859: d588472 211855: 603d791 v: v3
1 parent caed20f commit 328565c

File tree

11 files changed

+78
-39
lines changed

11 files changed

+78
-39
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: b936b1bd7cd28dd55f5ff4dfd47a808452da2b28
13+
refs/heads/auto: a190394ae8edbdded63062243400b3b9bda26eee
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/configure

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -849,13 +849,6 @@ then
849849
putvar CFG_LOCAL_RUST_ROOT
850850
fi
851851

852-
# Force freebsd to build with clang; gcc doesn't like us there
853-
if [ $CFG_OSTYPE = unknown-freebsd ]
854-
then
855-
step_msg "on FreeBSD, forcing use of clang"
856-
CFG_ENABLE_CLANG=1
857-
fi
858-
859852
# Force bitrig to build with clang; gcc doesn't like us there
860853
if [ $CFG_OSTYPE = unknown-bitrig ]
861854
then

branches/auto/src/doc/trpl/mutability.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ b.x = 10; // error: cannot assign to immutable field `b.x`
159159

160160
[struct]: structs.html
161161

162-
However, by using `Cell<T>`, you can emulate field-level mutability:
162+
However, by using [`Cell<T>`][cell], you can emulate field-level mutability:
163163

164164
```rust
165165
use std::cell::Cell;
@@ -176,4 +176,6 @@ point.y.set(7);
176176
println!("y: {:?}", point.y);
177177
```
178178

179+
[cell]: ../std/cell/struct.Cell.html
180+
179181
This will print `y: Cell { value: 7 }`. We’ve successfully updated `y`.

branches/auto/src/libcollections/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@
3737
#![feature(unsafe_no_drop_flag, filling_drop)]
3838
#![feature(step_by)]
3939
#![feature(str_char)]
40-
#![feature(str_words)]
4140
#![feature(slice_patterns)]
4241
#![feature(utf8_error)]
43-
#![cfg_attr(test, feature(rand, rustc_private, test, hash, collections,
44-
collections_drain, collections_range))]
42+
#![cfg_attr(test, feature(rand, test))]
4543
#![cfg_attr(test, allow(deprecated))] // rand
44+
#![cfg_attr(not(test), feature(str_words))]
4645

4746
#![feature(no_std)]
4847
#![no_std]

branches/auto/src/libcollections/slice.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
#![doc(primitive = "slice")]
8080
#![stable(feature = "rust1", since = "1.0.0")]
8181

82+
// Many of the usings in this module are only used in the test configuration.
83+
// It's cleaner to just turn off the unused_imports warning than to fix them.
84+
#![allow(unused_imports)]
85+
8286
use alloc::boxed::Box;
8387
use core::clone::Clone;
8488
use core::cmp::Ordering::{self, Greater, Less};

branches/auto/src/libcollections/str.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
#![doc(primitive = "str")]
4848
#![stable(feature = "rust1", since = "1.0.0")]
4949

50+
// Many of the usings in this module are only used in the test configuration.
51+
// It's cleaner to just turn off the unused_imports warning than to fix them.
52+
#![allow(unused_imports)]
53+
5054
use self::RecompositionState::*;
5155
use self::DecompositionType::*;
5256

branches/auto/src/libcollections/vec_deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,7 @@ impl<T: fmt::Debug> fmt::Debug for VecDeque<T> {
18011801

18021802
#[cfg(test)]
18031803
mod tests {
1804-
use core::iter::{Iterator, self};
1804+
use core::iter::Iterator;
18051805
use core::option::Option::Some;
18061806

18071807
use test;

branches/auto/src/libcore/cell.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,8 @@ pub struct UnsafeCell<T: ?Sized> {
795795
///
796796
/// This field should not be accessed directly, it is made public for static
797797
/// initializers.
798+
#[deprecated(since = "1.2.0", reason = "use `get` to access the wrapped \
799+
value or `new` to initialize `UnsafeCell` in statics")]
798800
#[unstable(feature = "core")]
799801
pub value: T,
800802
}
@@ -818,6 +820,7 @@ impl<T> UnsafeCell<T> {
818820
#[stable(feature = "rust1", since = "1.0.0")]
819821
#[inline]
820822
pub const fn new(value: T) -> UnsafeCell<T> {
823+
#![allow(deprecated)]
821824
UnsafeCell { value: value }
822825
}
823826

@@ -839,7 +842,10 @@ impl<T> UnsafeCell<T> {
839842
/// ```
840843
#[inline]
841844
#[stable(feature = "rust1", since = "1.0.0")]
842-
pub unsafe fn into_inner(self) -> T { self.value }
845+
pub unsafe fn into_inner(self) -> T {
846+
#![allow(deprecated)]
847+
self.value
848+
}
843849
}
844850

845851
impl<T: ?Sized> UnsafeCell<T> {
@@ -859,6 +865,7 @@ impl<T: ?Sized> UnsafeCell<T> {
859865
pub fn get(&self) -> *mut T {
860866
// FIXME(#23542) Replace with type ascription.
861867
#![allow(trivial_casts)]
868+
#![allow(deprecated)]
862869
&self.value as *const T as *mut T
863870
}
864871
}

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

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

271-
fn enum_variant_ids(item: rbml::Doc, cdata: Cmd) -> Vec<ast::DefId> {
272-
reader::tagged_docs(item, tag_items_data_item_variant)
273-
.map(|p| translated_def_id(cdata, p))
274-
.collect()
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+
}
275293
}
276294

277295
fn item_path(item_doc: rbml::Doc) -> Vec<ast_map::PathElem> {
@@ -719,11 +737,11 @@ pub fn get_enum_variant_defs(intr: &IdentInterner,
719737
let data = cdata.data();
720738
let items = reader::get_doc(rbml::Doc::new(data), tag_items);
721739
let item = find_item(id, items);
722-
enum_variant_ids(item, cdata).iter().map(|did| {
740+
enum_variant_ids(item, cdata).map(|did| {
723741
let item = find_item(did.node, items);
724742
let name = item_name(intr, item);
725743
let visibility = item_visibility(item);
726-
match item_to_def_like(cdata, item, *did) {
744+
match item_to_def_like(cdata, item, did) {
727745
DlDef(def @ def::DefVariant(..)) => (def, name, visibility),
728746
_ => unreachable!()
729747
}
@@ -736,7 +754,7 @@ pub fn get_enum_variants<'tcx>(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::Nod
736754
let items = reader::get_doc(rbml::Doc::new(data), tag_items);
737755
let item = find_item(id, items);
738756
let mut disr_val = 0;
739-
enum_variant_ids(item, cdata).iter().map(|did| {
757+
enum_variant_ids(item, cdata).map(|did| {
740758
let item = find_item(did.node, items);
741759
let ctor_ty = item_type(ast::DefId { krate: cdata.cnum, node: id},
742760
item, tcx, cdata);
@@ -771,7 +789,7 @@ pub fn get_enum_variants<'tcx>(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::Nod
771789
name: name,
772790
// I'm not even sure if we encode visibility
773791
// for variants -- TEST -- tjc
774-
id: *did,
792+
id: did,
775793
disr_val: old_disr_val,
776794
vis: ast::Inherited
777795
})

branches/auto/src/librustc/util/fs.rs

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,22 @@
1111
use std::path::{self, Path, PathBuf};
1212
use std::ffi::OsString;
1313

14-
// Unfortunately, on windows, gcc cannot accept paths of the form `\\?\C:\...`
15-
// (a verbatim path). This form of path is generally pretty rare, but the
16-
// implementation of `fs::canonicalize` currently generates paths of this form,
17-
// meaning that we're going to be passing quite a few of these down to gcc.
14+
// Unfortunately, on windows, it looks like msvcrt.dll is silently translating
15+
// verbatim paths under the hood to non-verbatim paths! This manifests itself as
16+
// gcc looking like it cannot accept paths of the form `\\?\C:\...`, but the
17+
// real bug seems to lie in msvcrt.dll.
18+
//
19+
// Verbatim paths are generally pretty rare, but the implementation of
20+
// `fs::canonicalize` currently generates paths of this form, meaning that we're
21+
// going to be passing quite a few of these down to gcc, so we need to deal with
22+
// this case.
1823
//
1924
// For now we just strip the "verbatim prefix" of `\\?\` from the path. This
2025
// will probably lose information in some cases, but there's not a whole lot
21-
// more we can do with a buggy gcc...
26+
// more we can do with a buggy msvcrt...
27+
//
28+
// For some more information, see this comment:
29+
// https://github.com/rust-lang/rust/issues/25505#issuecomment-102876737
2230
pub fn fix_windows_verbatim_for_gcc(p: &Path) -> PathBuf {
2331
if !cfg!(windows) {
2432
return p.to_path_buf()
@@ -28,11 +36,20 @@ pub fn fix_windows_verbatim_for_gcc(p: &Path) -> PathBuf {
2836
Some(path::Component::Prefix(p)) => p,
2937
_ => return p.to_path_buf(),
3038
};
31-
let disk = match prefix.kind() {
32-
path::Prefix::VerbatimDisk(disk) => disk,
33-
_ => return p.to_path_buf(),
34-
};
35-
let mut base = OsString::from(format!("{}:", disk as char));
36-
base.push(components.as_path());
37-
PathBuf::from(base)
39+
match prefix.kind() {
40+
path::Prefix::VerbatimDisk(disk) => {
41+
let mut base = OsString::from(format!("{}:", disk as char));
42+
base.push(components.as_path());
43+
PathBuf::from(base)
44+
}
45+
path::Prefix::VerbatimUNC(server, share) => {
46+
let mut base = OsString::from(r"\\");
47+
base.push(server);
48+
base.push(r"\");
49+
base.push(share);
50+
base.push(components.as_path());
51+
PathBuf::from(base)
52+
}
53+
_ => p.to_path_buf(),
54+
}
3855
}

branches/auto/src/librustc_back/target/freebsd_base.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ pub fn opts() -> TargetOptions {
1818
executables: true,
1919
morestack: true,
2020
has_rpath: true,
21-
pre_link_args: vec!(
22-
"-L/usr/local/lib".to_string(),
23-
"-L/usr/local/lib/gcc46".to_string(),
24-
"-L/usr/local/lib/gcc44".to_string(),
25-
),
2621

2722
.. Default::default()
2823
}

0 commit comments

Comments
 (0)