Skip to content

Commit 777f5d9

Browse files
committed
Auto merge of #23219 - Manishearth:rollup, r=Manishearth
2 parents 2574009 + 6468300 commit 777f5d9

File tree

9 files changed

+40
-33
lines changed

9 files changed

+40
-33
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ The Rust community congregates in a few places:
115115

116116
## Contributing
117117

118-
To contribute to Rust, please see [CONTRIBUTING.md](CONTRIBUTING.md).
118+
To contribute to Rust, please see [CONTRIBUTING](CONTRIBUTING.md).
119119

120120
Rust has an [IRC] culture and most real-time collaboration happens in a
121121
variety of channels on Mozilla's IRC network, irc.mozilla.org. The
@@ -131,4 +131,4 @@ Rust is primarily distributed under the terms of both the MIT license
131131
and the Apache License (Version 2.0), with portions covered by various
132132
BSD-like licenses.
133133
134-
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.
134+
See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT), and [COPYRIGHT](COPYRIGHT) for details.

src/doc/intro.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,11 @@ safe concurrent programs.
389389
Here's an example of a concurrent Rust program:
390390
391391
```{rust}
392-
use std::thread::Thread;
392+
use std::thread;
393393
394394
fn main() {
395395
let guards: Vec<_> = (0..10).map(|_| {
396-
Thread::scoped(|| {
396+
thread::scoped(|| {
397397
println!("Hello, world!");
398398
})
399399
}).collect();
@@ -421,16 +421,16 @@ problem.
421421
Let's see an example. This Rust code will not compile:
422422
423423
```{rust,ignore}
424-
use std::thread::Thread;
424+
use std::thread;
425425
426426
fn main() {
427427
let mut numbers = vec![1, 2, 3];
428428
429429
let guards: Vec<_> = (0..3).map(|i| {
430-
Thread::scoped(move || {
430+
thread::scoped(move || {
431431
numbers[i] += 1;
432432
println!("numbers[{}] is {}", i, numbers[i]);
433-
});
433+
})
434434
}).collect();
435435
}
436436
```
@@ -439,10 +439,10 @@ It gives us this error:
439439
440440
```text
441441
7:25: 10:6 error: cannot move out of captured outer variable in an `FnMut` closure
442-
7 Thread::scoped(move || {
442+
7 thread::scoped(move || {
443443
8 numbers[i] += 1;
444444
9 println!("numbers[{}] is {}", i, numbers[i]);
445-
10 });
445+
10 })
446446
error: aborting due to previous error
447447
```
448448
@@ -471,19 +471,19 @@ mutation doesn't cause a data race.
471471
Here's what using an Arc with a Mutex looks like:
472472
473473
```{rust}
474-
use std::thread::Thread;
474+
use std::thread;
475475
use std::sync::{Arc,Mutex};
476476
477477
fn main() {
478478
let numbers = Arc::new(Mutex::new(vec![1, 2, 3]));
479479
480480
let guards: Vec<_> = (0..3).map(|i| {
481481
let number = numbers.clone();
482-
Thread::scoped(move || {
482+
thread::scoped(move || {
483483
let mut array = number.lock().unwrap();
484484
array[i] += 1;
485485
println!("numbers[{}] is {}", i, array[i]);
486-
});
486+
})
487487
}).collect();
488488
}
489489
```
@@ -535,15 +535,15 @@ As an example, Rust's ownership system is _entirely_ at compile time. The
535535
safety check that makes this an error about moved values:
536536
537537
```{rust,ignore}
538-
use std::thread::Thread;
538+
use std::thread;
539539
540540
fn main() {
541541
let numbers = vec![1, 2, 3];
542542
543543
let guards: Vec<_> = (0..3).map(|i| {
544-
Thread::scoped(move || {
544+
thread::scoped(move || {
545545
println!("{}", numbers[i]);
546-
});
546+
})
547547
}).collect();
548548
}
549549
```

src/doc/reference.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,10 +3007,6 @@ A type cast expression is denoted with the binary operator `as`.
30073007
Executing an `as` expression casts the value on the left-hand side to the type
30083008
on the right-hand side.
30093009

3010-
A numeric value can be cast to any numeric type. A raw pointer value can be
3011-
cast to or from any integral type or raw pointer type. Any other cast is
3012-
unsupported and will fail to compile.
3013-
30143010
An example of an `as` expression:
30153011

30163012
```

src/libcore/cell.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,6 @@ impl<'b, T> DerefMut for RefMut<'b, T> {
631631
///
632632
/// Types like `Cell<T>` and `RefCell<T>` use this type to wrap their internal data.
633633
///
634-
/// `UnsafeCell<T>` doesn't opt-out from any marker traits, instead, types with an `UnsafeCell<T>`
635-
/// interior are expected to opt-out from those traits themselves.
636-
///
637634
/// # Examples
638635
///
639636
/// ```

src/libcore/marker.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,9 @@ pub trait Copy : MarkerTrait {
193193
/// the `sync` crate do ensure that any mutation cannot cause data
194194
/// races. Hence these types are `Sync`.
195195
///
196-
/// Users writing their own types with interior mutability (or anything
197-
/// else that is not thread-safe) should use the `NoSync` marker type
198-
/// (from `std::marker`) to ensure that the compiler doesn't
199-
/// consider the user-defined type to be `Sync`. Any types with
200-
/// interior mutability must also use the `std::cell::UnsafeCell` wrapper
201-
/// around the value(s) which can be mutated when behind a `&`
202-
/// reference; not doing this is undefined behaviour (for example,
203-
/// `transmute`-ing from `&T` to `&mut T` is illegal).
196+
/// Any types with interior mutability must also use the `std::cell::UnsafeCell` wrapper around the
197+
/// value(s) which can be mutated when behind a `&` reference; not doing this is undefined
198+
/// behaviour (for example, `transmute`-ing from `&T` to `&mut T` is illegal).
204199
#[stable(feature = "rust1", since = "1.0.0")]
205200
#[lang="sync"]
206201
#[rustc_on_unimplemented = "`{Self}` cannot be shared between threads safely"]

src/libcore/num/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ pub trait FromStrRadix {
15171517
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::Err>;
15181518
}
15191519

1520-
/// A utility function that just calls FromStrRadix::from_str_radix.
1520+
/// A utility function that just calls `FromStrRadix::from_str_radix`.
15211521
#[unstable(feature = "core", reason = "needs reevaluation")]
15221522
pub fn from_str_radix<T: FromStrRadix>(str: &str, radix: u32)
15231523
-> Result<T, T::Err> {

src/librustc_driver/driver.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ pub fn build_output_filenames(input: &Input,
927927
// We want to toss everything after the final '.'
928928
let dirpath = match *odir {
929929
Some(ref d) => d.clone(),
930-
None => PathBuf::new(".")
930+
None => PathBuf::new("")
931931
};
932932

933933
// If a crate name is present, we use it as the link name
@@ -954,8 +954,11 @@ pub fn build_output_filenames(input: &Input,
954954
if *odir != None {
955955
sess.warn("ignoring --out-dir flag due to -o flag.");
956956
}
957+
958+
let cur_dir = Path::new("");
959+
957960
OutputFilenames {
958-
out_directory: out_file.parent().unwrap().to_path_buf(),
961+
out_directory: out_file.parent().unwrap_or(cur_dir).to_path_buf(),
959962
out_filestem: out_file.file_stem().unwrap()
960963
.to_str().unwrap().to_string(),
961964
single_output_file: ofile,
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-include ../tools.mk
2+
3+
all:
4+
$(rustc) -o foo foo.rs

src/test/run-make/bare-outfile/foo.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn main() {
12+
}

0 commit comments

Comments
 (0)