Skip to content

Commit 265dad3

Browse files
committed
---
yaml --- r: 216399 b: refs/heads/stable c: cd5abe7 h: refs/heads/master i: 216397: 66b6dfa 216395: fcafd29 216391: 5c2f96c 216383: ec22087 v: v3
1 parent 6a42962 commit 265dad3

Some content is hidden

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

100 files changed

+4293
-6324
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/heads/tmp: 378a370ff2057afeb1eae86eb6e78c476866a4a6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: a5286998df566e736b32f6795bfc3803bdaf453d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: b9b1312f53f54ce7686ea0c4dc3b91894336e523
32+
refs/heads/stable: cd5abe76359d67283dbfd8067a475d3d2c249312
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375

branches/stable/src/doc/not_found.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,8 @@ function populate_rust_search() {
5757

5858
// #18540, use a single token
5959

60-
var a = document.createElement("a");
61-
a.href = "http://doc.rust-lang.org/core/?search=" + encodeURIComponent(lt);
62-
a.textContent = lt;
6360
var search = document.getElementById('core-search');
64-
search.innerHTML = "";
65-
search.appendChild(a);
61+
search.innerHTML = "<a href=\"http://doc.rust-lang.org/core/?search=" + lt + "\">" + lt + "</a>";
6662
}
6763
populate_site_search();
6864
populate_rust_search();

branches/stable/src/doc/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Non-doc comments are interpreted as a form of whitespace.
103103

104104
## Whitespace
105105

106-
Whitespace is any non-empty string containing only the following characters:
106+
Whitespace is any non-empty string containing any the following characters:
107107

108108
- `U+0020` (space, `' '`)
109109
- `U+0009` (tab, `'\t'`)
@@ -1897,8 +1897,8 @@ release builds.
18971897

18981898
There are two kinds of configuration options, one that is either defined or not
18991899
(`#[cfg(foo)]`), and the other that contains a string that can be checked
1900-
against (`#[cfg(bar = "baz")]`). Currently, only compiler-defined configuration
1901-
options can have the latter form.
1900+
against (`#[cfg(bar = "baz")]` (currently only compiler-defined configuration
1901+
options can have the latter form).
19021902

19031903
```
19041904
// The function is only included in the build when compiling for OSX

branches/stable/src/doc/trpl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ vector. When we try to compile this program, we get an error:
127127

128128
```text
129129
error: cannot borrow `x` as mutable because it is also borrowed as immutable
130-
x.push("foo");
130+
x.push(4);
131131
^
132132
note: previous borrow of `x` occurs here; the immutable borrow prevents
133133
subsequent moves or mutable borrows of `x` until the borrow ends

branches/stable/src/libcore/intrinsics.rs

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,6 @@ extern "rust-intrinsic" {
139139
pub fn atomic_fence_rel();
140140
pub fn atomic_fence_acqrel();
141141

142-
/// A compiler-only memory barrier.
143-
///
144-
/// Memory accesses will never be reordered across this barrier by the compiler,
145-
/// but no instructions will be emitted for it. This is appropriate for operations
146-
/// on the same thread that may be preempted, such as when interacting with signal
147-
/// handlers.
148-
#[cfg(not(stage0))] // SNAP 857ef6e
149-
pub fn atomic_singlethreadfence();
150-
#[cfg(not(stage0))] // SNAP 857ef6e
151-
pub fn atomic_singlethreadfence_acq();
152-
#[cfg(not(stage0))] // SNAP 857ef6e
153-
pub fn atomic_singlethreadfence_rel();
154-
#[cfg(not(stage0))] // SNAP 857ef6e
155-
pub fn atomic_singlethreadfence_acqrel();
156-
157142
/// Aborts the execution of the process.
158143
pub fn abort() -> !;
159144

@@ -270,17 +255,12 @@ extern "rust-intrinsic" {
270255
/// Returns `true` if a type is managed (will be allocated on the local heap)
271256
pub fn owns_managed<T>() -> bool;
272257

273-
/// Calculates the offset from a pointer.
258+
/// Calculates the offset from a pointer. The offset *must* be in-bounds of
259+
/// the object, or one-byte-past-the-end. An arithmetic overflow is also
260+
/// undefined behaviour.
274261
///
275262
/// This is implemented as an intrinsic to avoid converting to and from an
276263
/// integer, since the conversion would throw away aliasing information.
277-
///
278-
/// # Safety
279-
///
280-
/// Both the starting and resulting pointer must be either in bounds or one
281-
/// byte past the end of an allocated object. If either pointer is out of
282-
/// bounds or arithmetic overflow occurs then any further use of the
283-
/// returned value will result in undefined behavior.
284264
pub fn offset<T>(dst: *const T, offset: isize) -> *const T;
285265

286266
/// Copies `count * size_of<T>` bytes from `src` to `dst`. The source
@@ -582,20 +562,3 @@ extern "rust-intrinsic" {
582562
/// cast to a `u64`; if `T` has no discriminant, returns 0.
583563
pub fn discriminant_value<T>(v: &T) -> u64;
584564
}
585-
586-
#[cfg(not(stage0))]
587-
extern "rust-intrinsic" {
588-
/// Performs an unchecked signed division, which results in undefined behavior,
589-
/// in cases where y == 0, or x == int::MIN and y == -1
590-
pub fn unchecked_sdiv<T>(x: T, y: T) -> T;
591-
/// Performs an unchecked unsigned division, which results in undefined behavior,
592-
/// in cases where y == 0
593-
pub fn unchecked_udiv<T>(x: T, y: T) -> T;
594-
595-
/// Returns the remainder of an unchecked signed division, which results in
596-
/// undefined behavior, in cases where y == 0, or x == int::MIN and y == -1
597-
pub fn unchecked_urem<T>(x: T, y: T) -> T;
598-
/// Returns the remainder of an unchecked signed division, which results in
599-
/// undefined behavior, in cases where y == 0
600-
pub fn unchecked_srem<T>(x: T, y: T) -> T;
601-
}

branches/stable/src/libcore/num/mod.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -745,20 +745,7 @@ macro_rules! uint_impl {
745745
#[stable(feature = "rust1", since = "1.0.0")]
746746
#[inline]
747747
pub fn trailing_zeros(self) -> u32 {
748-
// As of LLVM 3.6 the codegen for the zero-safe cttz8 intrinsic
749-
// emits two conditional moves on x86_64. By promoting the value to
750-
// u16 and setting bit 8, we get better code without any conditional
751-
// operations.
752-
// FIXME: There's a LLVM patch (http://reviews.llvm.org/D9284)
753-
// pending, remove this workaround once LLVM generates better code
754-
// for cttz8.
755-
unsafe {
756-
if $BITS == 8 {
757-
intrinsics::cttz16(self as u16 | 0x100) as u32
758-
} else {
759-
$cttz(self as $ActualT) as u32
760-
}
761-
}
748+
unsafe { $cttz(self as $ActualT) as u32 }
762749
}
763750

764751
/// Shifts the bits to the left by a specified amount, `n`,

branches/stable/src/libcore/ptr.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,9 @@ impl<T: ?Sized> *const T {
284284
///
285285
/// # Safety
286286
///
287-
/// Both the starting and resulting pointer must be either in bounds or one
288-
/// byte past the end of an allocated object. If either pointer is out of
289-
/// bounds or arithmetic overflow occurs then
290-
/// any further use of the returned value will result in undefined behavior.
287+
/// The offset must be in-bounds of the object, or one-byte-past-the-end.
288+
/// Otherwise `offset` invokes Undefined Behaviour, regardless of whether
289+
/// the pointer is used.
291290
#[stable(feature = "rust1", since = "1.0.0")]
292291
#[inline]
293292
pub unsafe fn offset(self, count: isize) -> *const T where T: Sized {

branches/stable/src/libcoretest/option.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,24 +245,22 @@ fn test_collect() {
245245

246246
#[test]
247247
fn test_cloned() {
248-
let val1 = 1u32;
249-
let mut val2 = 2u32;
250-
let val1_ref = &val1;
248+
let val = 1u32;
249+
let val_ref = &val;
251250
let opt_none: Option<&'static u32> = None;
252-
let opt_ref = Some(&val1);
253-
let opt_ref_ref = Some(&val1_ref);
254-
let opt_mut_ref = Some(&mut val2);
251+
let opt_ref = Some(&val);
252+
let opt_ref_ref = Some(&val_ref);
255253

256254
// None works
257255
assert_eq!(opt_none.clone(), None);
258256
assert_eq!(opt_none.cloned(), None);
259257

260258
// Immutable ref works
261-
assert_eq!(opt_ref.clone(), Some(&val1));
259+
assert_eq!(opt_ref.clone(), Some(&val));
262260
assert_eq!(opt_ref.cloned(), Some(1u32));
263261

264262
// Double Immutable ref works
265-
assert_eq!(opt_ref_ref.clone(), Some(&val1_ref));
266-
assert_eq!(opt_ref_ref.clone().cloned(), Some(&val1));
263+
assert_eq!(opt_ref_ref.clone(), Some(&val_ref));
264+
assert_eq!(opt_ref_ref.clone().cloned(), Some(&val));
267265
assert_eq!(opt_ref_ref.cloned().cloned(), Some(1u32));
268266
}

branches/stable/src/librustc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The rustc crate itself consists of the following submodules
7171
- util: ubiquitous types and helper functions
7272
- lib: bindings to LLVM
7373

74-
The entry-point for the compiler is main() in the librustc_driver
74+
The entry-point for the compiler is main() in the librustc_trans
7575
crate.
7676

7777
The 3 central data structures:

branches/stable/src/librustc/diagnostics.rs

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -168,25 +168,6 @@ match x {
168168
```
169169
"##,
170170

171-
E0013: r##"
172-
Static and const variables can refer to other const variables. But a const
173-
variable cannot refer to a static variable. For example, `Y` cannot refer to `X`
174-
here:
175-
176-
```
177-
static X: i32 = 42;
178-
const Y: i32 = X;
179-
```
180-
181-
To fix this, the value can be extracted as a const and then used:
182-
183-
```
184-
const A: i32 = 42;
185-
static X: i32 = A;
186-
const Y: i32 = A;
187-
```
188-
"##,
189-
190171
E0015: r##"
191172
The only function calls allowed in static or constant expressions are enum
192173
variant constructors or struct constructors (for unit or tuple structs). This
@@ -355,22 +336,6 @@ enum Method { GET, POST }
355336
```
356337
"##,
357338

358-
E0265: r##"
359-
This error indicates that a static or constant references itself.
360-
All statics and constants need to resolve to a value in an acyclic manner.
361-
362-
For example, neither of the following can be sensibly compiled:
363-
364-
```
365-
const X: u32 = X;
366-
```
367-
368-
```
369-
const X: u32 = Y;
370-
const Y: u32 = X;
371-
```
372-
"##,
373-
374339
E0267: r##"
375340
This error indicates the use of loop keyword (break or continue) inside a
376341
closure but outside of any loop. Break and continue can be used as normal
@@ -497,6 +462,7 @@ register_diagnostics! {
497462
E0010,
498463
E0011,
499464
E0012,
465+
E0013,
500466
E0014,
501467
E0016,
502468
E0017,
@@ -516,6 +482,7 @@ register_diagnostics! {
516482
E0262, // illegal lifetime parameter name
517483
E0263, // lifetime name declared twice in same scope
518484
E0264, // unknown external lang item
485+
E0265, // recursive constant
519486
E0266, // expected item
520487
E0269, // not all control paths return a value
521488
E0270, // computation may converge in a function marked as diverging

branches/stable/src/librustc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#![feature(path_ext)]
4040
#![feature(str_char)]
4141
#![feature(into_cow)]
42-
#![feature(fs_canonicalize)]
4342
#![feature(slice_patterns)]
4443
#![cfg_attr(test, feature(test))]
4544

@@ -139,6 +138,7 @@ pub mod plugin;
139138
pub mod lint;
140139

141140
pub mod util {
141+
pub use rustc_back::fs;
142142
pub use rustc_back::sha2;
143143

144144
pub mod common;

branches/stable/src/librustc/metadata/creader.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ use metadata::decoder;
2121
use metadata::loader;
2222
use metadata::loader::CratePaths;
2323

24-
use std::path::PathBuf;
24+
use std::path::{Path, PathBuf};
2525
use std::rc::Rc;
26-
use std::fs;
27-
2826
use syntax::ast;
2927
use syntax::abi;
3028
use syntax::attr;
@@ -34,6 +32,7 @@ use syntax::parse;
3432
use syntax::parse::token::InternedString;
3533
use syntax::parse::token;
3634
use syntax::visit;
35+
use util::fs;
3736
use log;
3837

3938
pub struct CrateReader<'a> {
@@ -323,7 +322,7 @@ impl<'a> CrateReader<'a> {
323322
let source = self.sess.cstore.get_used_crate_source(cnum).unwrap();
324323
if let Some(locs) = self.sess.opts.externs.get(name) {
325324
let found = locs.iter().any(|l| {
326-
let l = fs::canonicalize(l).ok();
325+
let l = fs::realpath(&Path::new(&l[..])).ok();
327326
source.dylib.as_ref().map(|p| &p.0) == l.as_ref() ||
328327
source.rlib.as_ref().map(|p| &p.0) == l.as_ref()
329328
});
@@ -665,7 +664,7 @@ fn import_codemap(local_codemap: &codemap::CodeMap,
665664
.into_inner()
666665
.map_in_place(|mbc|
667666
codemap::MultiByteChar {
668-
pos: mbc.pos - start_pos,
667+
pos: mbc.pos + start_pos,
669668
bytes: mbc.bytes
670669
});
671670

branches/stable/src/librustc/metadata/filesearch.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use std::fs;
1818
use std::io::prelude::*;
1919
use std::path::{Path, PathBuf};
2020

21+
use util::fs as myfs;
2122
use session::search_paths::{SearchPaths, PathKind};
2223

2324
#[derive(Copy, Clone)]
@@ -190,7 +191,7 @@ pub fn get_or_default_sysroot() -> PathBuf {
190191
// Follow symlinks. If the resolved path is relative, make it absolute.
191192
fn canonicalize(path: Option<PathBuf>) -> Option<PathBuf> {
192193
path.and_then(|path| {
193-
match fs::canonicalize(&path) {
194+
match myfs::realpath(&path) {
194195
Ok(canon) => Some(canon),
195196
Err(e) => panic!("failed to get realpath: {}", e),
196197
}

branches/stable/src/librustc/metadata/loader.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,12 @@ use metadata::encoder;
225225
use metadata::filesearch::{FileSearch, FileMatches, FileDoesntMatch};
226226
use syntax::codemap::Span;
227227
use syntax::diagnostic::SpanHandler;
228+
use util::fs;
228229
use util::common;
229230
use rustc_back::target::Target;
230231

231232
use std::cmp;
232233
use std::collections::HashMap;
233-
use std::fs;
234234
use std::io::prelude::*;
235235
use std::io;
236236
use std::path::{Path, PathBuf};
@@ -430,9 +430,9 @@ impl<'a> Context<'a> {
430430
.or_insert_with(|| (HashMap::new(), HashMap::new()));
431431
let (ref mut rlibs, ref mut dylibs) = *slot;
432432
if rlib {
433-
rlibs.insert(fs::canonicalize(path).unwrap(), kind);
433+
rlibs.insert(fs::realpath(path).unwrap(), kind);
434434
} else {
435-
dylibs.insert(fs::canonicalize(path).unwrap(), kind);
435+
dylibs.insert(fs::realpath(path).unwrap(), kind);
436436
}
437437

438438
FileMatches
@@ -660,10 +660,10 @@ impl<'a> Context<'a> {
660660
// there's at most one rlib and at most one dylib.
661661
for loc in locs {
662662
if loc.file_name().unwrap().to_str().unwrap().ends_with(".rlib") {
663-
rlibs.insert(fs::canonicalize(&loc).unwrap(),
663+
rlibs.insert(fs::realpath(&loc).unwrap(),
664664
PathKind::ExternFlag);
665665
} else {
666-
dylibs.insert(fs::canonicalize(&loc).unwrap(),
666+
dylibs.insert(fs::realpath(&loc).unwrap(),
667667
PathKind::ExternFlag);
668668
}
669669
}

0 commit comments

Comments
 (0)