Skip to content

Commit 4243cad

Browse files
committed
auto merge of #12535 : alexcrichton/rust/rollup, r=alexcrichton
Closes #12474 (rustc: Don't error on the rlib symlinks) r=brson Closes #12475 (Use lines_any() when parsing output form "ar") r=brson Closes #12476 (Remove some obsolete ignored tests) r=alexcrichton Closes #12481 (Make .swap_remove return Option<T>) r=brson Closes #12485 (Remove some non-essential trait re-exports from the prelude.) r=brson Closes #12489 (Handle multibyte characters in source files better) r=alexcrichton Closes #12494 (Mark by-value parameters that are passed on the stack as nocapture) r=nmatsakis Closes #12497 (syntax: allow stmt/expr macro invocations to be delimited by {}) r=alexcrichton Closes #12508 (Match binding is assignment) r=nmatsakis Closes #12513 (Run the travis build as one large command) r=huonw Closes #12515 (Update source code layout in src/) r=alexcrichton Closes #12521 (Tutorial: Add std::num::sqrt to the example) r=cmr Closes #12529 (test: single-variant enum can't be dereferenced) r=huonw
2 parents 043c972 + 7d85546 commit 4243cad

Some content is hidden

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

54 files changed

+443
-174
lines changed

.travis.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ before_script:
3939
# manually disables bringing in these two libraries, but the stock LLVM was
4040
# apparently built with these options. We provide these options when building so
4141
# the `rustc` binary can successfully link.
42-
script:
43-
- make tidy
44-
- RUSTFLAGS="-C link-args='-lffi -lncurses'" make -j4 rustc-stage1
45-
- make check-stage1-std check-stage1-rpass check-stage1-cfail check-stage1-rfail
42+
#
43+
# As a result of https://github.com/travis-ci/travis-ci/issues/1066, we run
44+
# everything in one large command instead of multiple commands.
45+
script: |
46+
make tidy &&
47+
RUSTFLAGS="-C link-args='-lffi -lncurses'" make -j4 rustc-stage1 &&
48+
make check-stage1-std check-stage1-rpass check-stage1-cfail check-stage1-rfail
4649
4750
env:
4851
- NO_BENCH=1

src/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ Source layout:
1010
| `libgreen/` | The M:N runtime library |
1111
| `libnative/` | The 1:1 runtime library |
1212
| `libsyntax/` | The Rust parser and pretty-printer |
13+
| `libcollections/` | A collection of useful data structures and containers |
14+
| `libnum/` | Extended number support library (complex, rational, etc) |
15+
| `libtest/` | Rust's test-runner code |
16+
| ------------------- | --------------------------------------------------------- |
17+
| `libarena/` | The arena (a fast but limited) memory allocator |
18+
| `libflate/` | Simple compression library |
19+
| `libfourcc/` | Data format identifier library |
20+
| `libgetopts/` | Get command-line-options library |
21+
| `libglob/` | Unix glob patterns library |
22+
| `libsemver/` | Rust's semantic versioning library |
23+
| `libserialize/` | Encode-Decode types library |
24+
| `libsync/` | Concurrency mechanisms and primitives |
25+
| `libterm/` | ANSI color library for terminals |
26+
| `libtime/` | Time operations library |
27+
| `libuuid/` | UUID's handling code |
1328
| ------------------- | --------------------------------------------------------- |
1429
| `rt/` | The runtime system |
1530
| `rt/rust_*.c` | - Some of the runtime services |
@@ -31,8 +46,13 @@ Source layout:
3146
| ------------------- | --------------------------------------------------------- |
3247
| `librustdoc/` | The Rust API documentation tool |
3348
| `libuv/` | The libuv submodule |
49+
| `librustuv/` | Rust libuv support code |
3450
| ------------------- | --------------------------------------------------------- |
3551
| `llvm/` | The LLVM submodule |
3652
| `rustllvm/` | LLVM support code |
3753
| ------------------- | --------------------------------------------------------- |
3854
| `etc/` | Scripts, editors support, misc |
55+
56+
57+
NOTE: This list (especially the second part of the table which contains modules and libraries)
58+
is highly volatile and subject to change.

src/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1420,8 +1420,8 @@ bad, but often copies are expensive. So we’d like to define a function
14201420
that takes the points by pointer. We can use references to do this:
14211421
14221422
~~~
1423+
use std::num::sqrt;
14231424
# struct Point { x: f64, y: f64 }
1424-
# fn sqrt(f: f64) -> f64 { 0.0 }
14251425
fn compute_distance(p1: &Point, p2: &Point) -> f64 {
14261426
let x_d = p1.x - p2.x;
14271427
let y_d = p1.y - p2.y;

src/libcollections/hashmap.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
//! ```
5454
5555
use std::cmp::max;
56+
use std::default::Default;
5657
use std::fmt;
5758
use std::hash::{Hash, Hasher, sip};
5859
use std::iter::{FilterMap, Chain, Repeat, Zip};

src/libextra/url.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use std::cmp::Eq;
1616
use std::fmt;
1717
use std::hash::{Hash, sip};
1818
use std::io::BufReader;
19+
use std::from_str::FromStr;
1920
use std::uint;
2021

2122
use collections::HashMap;

src/libgreen/stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl StackPool {
139139
pub fn take_stack(&mut self, min_size: uint) -> Stack {
140140
// Ideally this would be a binary search
141141
match self.stacks.iter().position(|s| min_size <= s.min_size) {
142-
Some(idx) => self.stacks.swap_remove(idx),
142+
Some(idx) => self.stacks.swap_remove(idx).unwrap(),
143143
None => Stack::new(min_size)
144144
}
145145
}

src/libnum/bigint.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use Integer;
2020

2121
use std::cmp;
2222
use std::fmt;
23+
use std::from_str::FromStr;
2324
use std::num::{Bitwise, ToPrimitive, FromPrimitive};
2425
use std::num::{Zero, One, ToStrRadix, FromStrRadix};
2526
use std::rand::Rng;
@@ -1397,8 +1398,9 @@ mod biguint_tests {
13971398
use super::{Plus, BigInt, RandBigInt, ToBigInt};
13981399
13991400
use std::cmp::{Less, Equal, Greater};
1401+
use std::from_str::FromStr;
14001402
use std::i64;
1401-
use std::num::{Zero, One, FromStrRadix};
1403+
use std::num::{Zero, One, FromStrRadix, ToStrRadix};
14021404
use std::num::{ToPrimitive, FromPrimitive};
14031405
use std::rand::{task_rng};
14041406
use std::str;
@@ -2056,7 +2058,7 @@ mod bigint_tests {
20562058

20572059
use std::cmp::{Less, Equal, Greater};
20582060
use std::i64;
2059-
use std::num::{Zero, One, FromStrRadix};
2061+
use std::num::{Zero, One, FromStrRadix, ToStrRadix};
20602062
use std::num::{ToPrimitive, FromPrimitive};
20612063
use std::rand::{task_rng};
20622064
use std::u64;

src/libnum/rational.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ impl<T: FromStrRadix + Clone + Integer + Ord>
333333
mod test {
334334

335335
use super::{Ratio, Rational, BigRational};
336-
use std::num::{Zero,One,FromStrRadix,FromPrimitive};
336+
use std::num::{Zero, One, FromStrRadix, FromPrimitive, ToStrRadix};
337337
use std::from_str::FromStr;
338338

339339
pub static _0 : Rational = Ratio { numer: 0, denom: 1};

src/librustc/back/archive.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ impl Archive {
145145
/// Lists all files in an archive
146146
pub fn files(&self) -> ~[~str] {
147147
let output = run_ar(self.sess, "t", None, [&self.dst]);
148-
str::from_utf8(output.output).unwrap().lines().map(|s| s.to_owned()).collect()
148+
let output = str::from_utf8(output.output).unwrap();
149+
// use lines_any because windows delimits output with `\r\n` instead of
150+
// just `\n`
151+
output.lines_any().map(|s| s.to_owned()).collect()
149152
}
150153

151154
fn add_archive(&mut self, archive: &Path, name: &str,

src/librustc/metadata/loader.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ pub struct ArchiveMetadata {
6767
priv data: &'static [u8],
6868
}
6969

70+
// FIXME(#11857) this should be a "real" realpath
71+
fn realpath(p: &Path) -> Path {
72+
use std::os;
73+
use std::io::fs;
74+
75+
let path = os::make_absolute(p);
76+
match fs::readlink(&path) {
77+
Ok(p) => p,
78+
Err(..) => path
79+
}
80+
}
81+
7082
impl Context {
7183
pub fn load_library_crate(&self, root_ident: Option<~str>) -> Library {
7284
match self.find_library_crate() {
@@ -121,7 +133,7 @@ impl Context {
121133
(HashSet::new(), HashSet::new())
122134
});
123135
let (ref mut rlibs, _) = *slot;
124-
rlibs.insert(path.clone());
136+
rlibs.insert(realpath(path));
125137
FileMatches
126138
}
127139
None => {
@@ -138,7 +150,7 @@ impl Context {
138150
(HashSet::new(), HashSet::new())
139151
});
140152
let (_, ref mut dylibs) = *slot;
141-
dylibs.insert(path.clone());
153+
dylibs.insert(realpath(path));
142154
FileMatches
143155
}
144156
None => {

0 commit comments

Comments
 (0)