diff --git a/README.md b/README.md index c88c237cbee..93f0daa7141 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ The Rust community congregates in a few places: ## Contributing -To contribute to Rust, please see [CONTRIBUTING.md](CONTRIBUTING.md). +To contribute to Rust, please see [CONTRIBUTING](CONTRIBUTING.md). Rust has an [IRC] culture and most real-time collaboration happens in a 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 and the Apache License (Version 2.0), with portions covered by various BSD-like licenses. -See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details. +See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT), and [COPYRIGHT](COPYRIGHT) for details. diff --git a/src/doc/intro.md b/src/doc/intro.md index bb86de64e7a..9e575abeee2 100644 --- a/src/doc/intro.md +++ b/src/doc/intro.md @@ -389,11 +389,11 @@ safe concurrent programs. Here's an example of a concurrent Rust program: ```{rust} -use std::thread::Thread; +use std::thread; fn main() { let guards: Vec<_> = (0..10).map(|_| { - Thread::scoped(|| { + thread::scoped(|| { println!("Hello, world!"); }) }).collect(); @@ -421,16 +421,16 @@ problem. Let's see an example. This Rust code will not compile: ```{rust,ignore} -use std::thread::Thread; +use std::thread; fn main() { let mut numbers = vec![1, 2, 3]; let guards: Vec<_> = (0..3).map(|i| { - Thread::scoped(move || { + thread::scoped(move || { numbers[i] += 1; println!("numbers[{}] is {}", i, numbers[i]); - }); + }) }).collect(); } ``` @@ -439,10 +439,10 @@ It gives us this error: ```text 7:25: 10:6 error: cannot move out of captured outer variable in an `FnMut` closure -7 Thread::scoped(move || { +7 thread::scoped(move || { 8 numbers[i] += 1; 9 println!("numbers[{}] is {}", i, numbers[i]); -10 }); +10 }) error: aborting due to previous error ``` @@ -471,7 +471,7 @@ mutation doesn't cause a data race. Here's what using an Arc with a Mutex looks like: ```{rust} -use std::thread::Thread; +use std::thread; use std::sync::{Arc,Mutex}; fn main() { @@ -479,11 +479,11 @@ fn main() { let guards: Vec<_> = (0..3).map(|i| { let number = numbers.clone(); - Thread::scoped(move || { + thread::scoped(move || { let mut array = number.lock().unwrap(); array[i] += 1; println!("numbers[{}] is {}", i, array[i]); - }); + }) }).collect(); } ``` @@ -535,15 +535,15 @@ As an example, Rust's ownership system is _entirely_ at compile time. The safety check that makes this an error about moved values: ```{rust,ignore} -use std::thread::Thread; +use std::thread; fn main() { let numbers = vec![1, 2, 3]; let guards: Vec<_> = (0..3).map(|i| { - Thread::scoped(move || { + thread::scoped(move || { println!("{}", numbers[i]); - }); + }) }).collect(); } ``` diff --git a/src/doc/reference.md b/src/doc/reference.md index 3cb48eed891..ee5ebfc7e88 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -3007,10 +3007,6 @@ A type cast expression is denoted with the binary operator `as`. Executing an `as` expression casts the value on the left-hand side to the type on the right-hand side. -A numeric value can be cast to any numeric type. A raw pointer value can be -cast to or from any integral type or raw pointer type. Any other cast is -unsupported and will fail to compile. - An example of an `as` expression: ``` diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index b8a22c30f9e..4f77a20c7ca 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -631,9 +631,6 @@ impl<'b, T> DerefMut for RefMut<'b, T> { /// /// Types like `Cell` and `RefCell` use this type to wrap their internal data. /// -/// `UnsafeCell` doesn't opt-out from any marker traits, instead, types with an `UnsafeCell` -/// interior are expected to opt-out from those traits themselves. -/// /// # Examples /// /// ``` diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index a05bc04a530..fe53ea1f0af 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -193,14 +193,9 @@ pub trait Copy : MarkerTrait { /// the `sync` crate do ensure that any mutation cannot cause data /// races. Hence these types are `Sync`. /// -/// Users writing their own types with interior mutability (or anything -/// else that is not thread-safe) should use the `NoSync` marker type -/// (from `std::marker`) to ensure that the compiler doesn't -/// consider the user-defined type to be `Sync`. Any types with -/// interior mutability must also use the `std::cell::UnsafeCell` wrapper -/// around the value(s) which can be mutated when behind a `&` -/// reference; not doing this is undefined behaviour (for example, -/// `transmute`-ing from `&T` to `&mut T` is illegal). +/// Any types with interior mutability must also use the `std::cell::UnsafeCell` wrapper around the +/// value(s) which can be mutated when behind a `&` reference; not doing this is undefined +/// behaviour (for example, `transmute`-ing from `&T` to `&mut T` is illegal). #[stable(feature = "rust1", since = "1.0.0")] #[lang="sync"] #[rustc_on_unimplemented = "`{Self}` cannot be shared between threads safely"] diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 76edec80896..752eca797bd 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -1517,7 +1517,7 @@ pub trait FromStrRadix { fn from_str_radix(str: &str, radix: u32) -> Result; } -/// A utility function that just calls FromStrRadix::from_str_radix. +/// A utility function that just calls `FromStrRadix::from_str_radix`. #[unstable(feature = "core", reason = "needs reevaluation")] pub fn from_str_radix(str: &str, radix: u32) -> Result { diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 565782b29e9..dc27a301109 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -927,7 +927,7 @@ pub fn build_output_filenames(input: &Input, // We want to toss everything after the final '.' let dirpath = match *odir { Some(ref d) => d.clone(), - None => PathBuf::new(".") + None => PathBuf::new("") }; // If a crate name is present, we use it as the link name @@ -954,8 +954,11 @@ pub fn build_output_filenames(input: &Input, if *odir != None { sess.warn("ignoring --out-dir flag due to -o flag."); } + + let cur_dir = Path::new(""); + OutputFilenames { - out_directory: out_file.parent().unwrap().to_path_buf(), + out_directory: out_file.parent().unwrap_or(cur_dir).to_path_buf(), out_filestem: out_file.file_stem().unwrap() .to_str().unwrap().to_string(), single_output_file: ofile, diff --git a/src/test/run-make/bare-outfile/Makefile b/src/test/run-make/bare-outfile/Makefile new file mode 100644 index 00000000000..97d09c837c1 --- /dev/null +++ b/src/test/run-make/bare-outfile/Makefile @@ -0,0 +1,4 @@ +-include ../tools.mk + +all: + $(rustc) -o foo foo.rs diff --git a/src/test/run-make/bare-outfile/foo.rs b/src/test/run-make/bare-outfile/foo.rs new file mode 100644 index 00000000000..63e747901ae --- /dev/null +++ b/src/test/run-make/bare-outfile/foo.rs @@ -0,0 +1,12 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { +}