Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #40506

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
13341f4
Reword the non-dropping of `src` for `ptr::write{,_unaligned}`
tbu- Mar 9, 2017
2339a0a
Fix race condition in fs::create_dir_all
droundy Dec 1, 2015
07188fe
Fix new version of `create_dir_all`
dpc Mar 11, 2017
97a1b6a
Update usages of 'OSX' (and other old names) to 'macOS'.
frewsxcv Mar 12, 2017
0644773
Remove doc about highlighting code in other languages #40301
projektir Mar 13, 2017
6b7b262
Updating README.md to point to the correct doc location
projektir Mar 13, 2017
a63ecf9
Add `concurrent_recursive_mkdir` test
dpc Mar 13, 2017
4e2114f
Break line longer than 100 characters
dpc Mar 14, 2017
eb203d5
Adjust wording #40301
projektir Mar 13, 2017
adba642
fix format grammar
llogiq Mar 13, 2017
5e49f79
Add test for issue #29595
mattico Mar 10, 2017
11d3344
Using X headings #39850
projektir Mar 13, 2017
1545f4e
std: remove a workaround for privacy limitations that isn't necessary…
swgillespie Mar 14, 2017
faabe93
Rollup merge of #39799 - dpc:create_dir_all, r=alexcrichton
frewsxcv Mar 14, 2017
8361757
Rollup merge of #40387 - tbu-:pr_doc_ptr_write2, r=steveklabnik
frewsxcv Mar 14, 2017
91dc9ea
Rollup merge of #40433 - mattico:test-issue-29595, r=estebank
frewsxcv Mar 14, 2017
8fb3679
Rollup merge of #40457 - frewsxcv:frewsxcv-macos, r=steveklabnik
frewsxcv Mar 14, 2017
1328cd4
Rollup merge of #40466 - projektir:outdated_docs_highlighting, r=stev…
frewsxcv Mar 14, 2017
467b28a
Rollup merge of #40467 - projektir:readme_docs, r=steveklabnik
frewsxcv Mar 14, 2017
3172911
Rollup merge of #40495 - llogiq:format-docs, r=steveklabnik
frewsxcv Mar 14, 2017
5a3e8e7
Rollup merge of #40496 - projektir:docs_number_headings, r=frewsxcv
frewsxcv Mar 14, 2017
110129b
Rollup merge of #40503 - swgillespie:thread-hack-removal, r=sfackler
frewsxcv Mar 14, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ If you’d like to build the documentation, it’s almost the same:
$ ./x.py doc
```

The generated documentation will appear in a top-level `doc` directory,
created by the `make` rule.
The generated documentation will appear under `doc` in the `build` directory for
the ABI used. I.e., if the ABI was `x86_64-pc-windows-msvc`, the directory will be
`build\x86_64-pc-windows-msvc\doc`.

## Notes

Expand Down
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5056,7 +5056,7 @@ Version 0.1 (2012-01-20)

* Compiler works with the following configurations:
* Linux: x86 and x86_64 hosts and targets
* MacOS: x86 and x86_64 hosts and targets
* macOS: x86 and x86_64 hosts and targets
* Windows: x86 hosts and targets

* Cross compilation / multi-target configuration supported.
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ fn main() {
if env::var("RUSTC_RPATH") == Ok("true".to_string()) {
let rpath = if target.contains("apple") {

// Note that we need to take one extra step on OSX to also pass
// Note that we need to take one extra step on macOS to also pass
// `-Wl,-instal_name,@rpath/...` to get things to work right. To
// do that we pass a weird flag to the compiler to get it to do
// so. Note that this is definitely a hack, and we should likely
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pub fn compiletest(build: &Build,
cmd.arg("--docck-python").arg(build.python());

if build.config.build.ends_with("apple-darwin") {
// Force /usr/bin/python on OSX for LLDB tests because we're loading the
// Force /usr/bin/python on macOS for LLDB tests because we're loading the
// LLDB plugin's compiled module which only works with the system python
// (namely not Homebrew-installed python)
cmd.arg("--lldb-python").arg("/usr/bin/python");
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ pub fn rustc(build: &Build, target: &str, compiler: &Compiler) {
cargo.env("CFG_LLVM_ROOT", s);
}
// Building with a static libstdc++ is only supported on linux right now,
// not for MSVC or OSX
// not for MSVC or macOS
if build.config.llvm_static_stdcpp &&
!target.contains("windows") &&
!target.contains("apple") {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ impl Build {
.filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))
.collect::<Vec<_>>();

// If we're compiling on OSX then we add a few unconditional flags
// If we're compiling on macOS then we add a few unconditional flags
// indicating that we want libc++ (more filled out than libstdc++) and
// we want to compile for 10.7. This way we can ensure that
// LLVM/jemalloc/etc are all properly compiled.
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ pub fn check(build: &mut Build) {
}

for target in build.config.target.iter() {
// Can't compile for iOS unless we're on OSX
// Can't compile for iOS unless we're on macOS
if target.contains("apple-ios") &&
!build.config.build.contains("apple-darwin") {
panic!("the iOS target is only supported on OSX");
panic!("the iOS target is only supported on macOS");
}

// Make sure musl-root is valid if specified
Expand Down
21 changes: 2 additions & 19 deletions src/doc/book/src/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ more than one section:
# fn foo() {}
```

Let's discuss the details of these code blocks.

#### Code block annotations

To write some Rust code in a comment, use the triple graves:
Expand All @@ -183,23 +181,8 @@ To write some Rust code in a comment, use the triple graves:
# fn foo() {}
```

If you want something that's not Rust code, you can add an annotation:

```rust
/// ```c
/// printf("Hello, world\n");
/// ```
# fn foo() {}
```

This will highlight according to whatever language you're showing off.
If you're only showing plain text, choose `text`.

It's important to choose the correct annotation here, because `rustdoc` uses it
in an interesting way: It can be used to actually test your examples in a
library crate, so that they don't get out of date. If you have some C code but
`rustdoc` thinks it's Rust because you left off the annotation, `rustdoc` will
complain when trying to generate the documentation.
This will add code highlighting. If you are only showing plain text, put `text`
instead of `rust` after the triple graves (see below).

## Documentation as tests

Expand Down
2 changes: 1 addition & 1 deletion src/doc/book/src/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ And that's reflected in the summary line:
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured
```

We also get a non-zero status code. We can use `$?` on OS X and Linux:
We also get a non-zero status code. We can use `$?` on macOS and Linux:

```bash
$ echo $?
Expand Down
6 changes: 3 additions & 3 deletions src/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ Other unofficial documentation may exist elsewhere; for example, the [Rust
Learning] project collects documentation from the community, and [Docs.rs]
builds documentation for individual Rust packages.

## API Documentation
# API Documentation

Rust provides a standard library with a number of features; [we host its
documentation here][api].

## Extended Error Documentation
# Extended Error Documentation

Many of Rust's errors come with error codes, and you can request extended
diagnostics from the compiler on those errors. We also [have the text of those
extended errors on the web][err], if you prefer to read them that way.

## The Rust Bookshelf
# The Rust Bookshelf

Rust provides a number of book-length sets of documentation, collectively
nicknamed 'The Rust Bookshelf.'
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc_jemalloc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub use imp::*;
mod imp {
use libc::{c_int, c_void, size_t};

// Note that the symbols here are prefixed by default on OSX and Windows (we
// Note that the symbols here are prefixed by default on macOS and Windows (we
// don't explicitly request it), and on Android and DragonFly we explicitly
// request it as unprefixing cause segfaults (mismatches in allocators).
extern "C" {
Expand Down
3 changes: 2 additions & 1 deletion src/libcollections/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@
//! `%`. The actual grammar for the formatting syntax is:
//!
//! ```text
//! format_string := <text> [ format <text> ] *
//! format_string := <text> [ maybe-format <text> ] *
//! maybe-format := '{' '{' | '}' '}' | <format>
//! format := '{' [ argument ] [ ':' format_spec ] '}'
//! argument := integer | identifier
//!
Expand Down
8 changes: 5 additions & 3 deletions src/libcore/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,8 @@ pub unsafe fn read_unaligned<T>(src: *const T) -> T {
/// allocations or resources, so care must be taken not to overwrite an object
/// that should be dropped.
///
/// It does not immediately drop the contents of `src` either; it is rather
/// *moved* into the memory location `dst` and will be dropped whenever that
/// location goes out of scope.
/// Additionally, it does not drop `src`. Semantically, `src` is moved into the
/// location pointed to by `dst`.
///
/// This is appropriate for initializing uninitialized memory, or overwriting
/// memory that has previously been `read` from.
Expand Down Expand Up @@ -233,6 +232,9 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
/// allocations or resources, so care must be taken not to overwrite an object
/// that should be dropped.
///
/// Additionally, it does not drop `src`. Semantically, `src` is moved into the
/// location pointed to by `dst`.
///
/// This is appropriate for initializing uninitialized memory, or overwriting
/// memory that has previously been `read` from.
///
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/cstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub enum LinkagePreference {
pub enum NativeLibraryKind {
NativeStatic, // native static library (.a archive)
NativeStaticNobundle, // native static library, which doesn't get bundled into .rlibs
NativeFramework, // OSX-specific
NativeFramework, // macOS-specific
NativeUnknown, // default way to specify a dynamic library
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
always_encode_mir: bool = (false, parse_bool, [TRACKED],
"encode MIR of all functions into the crate metadata"),
osx_rpath_install_name: bool = (false, parse_bool, [TRACKED],
"pass `-install_name @rpath/...` to the OSX linker"),
"pass `-install_name @rpath/...` to the macOS linker"),
sanitizer: Option<Sanitizer> = (None, parse_sanitizer, [TRACKED],
"Use a sanitizer"),
}
Expand Down
20 changes: 0 additions & 20 deletions src/librustc/util/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,3 @@ pub fn rename_or_copy_remove<P: AsRef<Path>, Q: AsRef<Path>>(p: P,
}
}
}

// Like std::fs::create_dir_all, except handles concurrent calls among multiple
// threads or processes.
pub fn create_dir_racy(path: &Path) -> io::Result<()> {
match fs::create_dir(path) {
Ok(()) => return Ok(()),
Err(ref e) if e.kind() == io::ErrorKind::AlreadyExists => return Ok(()),
Err(ref e) if e.kind() == io::ErrorKind::NotFound => {}
Err(e) => return Err(e),
}
match path.parent() {
Some(p) => try!(create_dir_racy(p)),
None => return Err(io::Error::new(io::ErrorKind::Other, "failed to create whole tree")),
}
match fs::create_dir(path) {
Ok(()) => Ok(()),
Err(ref e) if e.kind() == io::ErrorKind::AlreadyExists => Ok(()),
Err(e) => Err(e),
}
}
8 changes: 4 additions & 4 deletions src/librustc_back/target/apple_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ use std::env;
use target::TargetOptions;

pub fn opts() -> TargetOptions {
// ELF TLS is only available in OSX 10.7+. If you try to compile for 10.6
// ELF TLS is only available in macOS 10.7+. If you try to compile for 10.6
// either the linker will complain if it is used or the binary will end up
// segfaulting at runtime when run on 10.6. Rust by default supports OSX
// segfaulting at runtime when run on 10.6. Rust by default supports macOS
// 10.7+, but there is a standard environment variable,
// MACOSX_DEPLOYMENT_TARGET, which is used to signal targeting older
// versions of OSX. For example compiling on 10.10 with
// versions of macOS. For example compiling on 10.10 with
// MACOSX_DEPLOYMENT_TARGET set to 10.6 will cause the linker to generate
// warnings about the usage of ELF TLS.
//
Expand All @@ -33,7 +33,7 @@ pub fn opts() -> TargetOptions {
}).unwrap_or((10, 7));

TargetOptions {
// OSX has -dead_strip, which doesn't rely on function_sections
// macOS has -dead_strip, which doesn't rely on function_sections
function_sections: false,
dynamic_linking: true,
executables: true,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_back/target/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ pub struct TargetOptions {
/// Whether the target toolchain is like OpenBSD's.
/// Only useful for compiling against OpenBSD, for configuring abi when returning a struct.
pub is_like_openbsd: bool,
/// Whether the target toolchain is like OSX's. Only useful for compiling against iOS/OS X, in
/// particular running dsymutil and some other stuff like `-dead_strip`. Defaults to false.
/// Whether the target toolchain is like macOS's. Only useful for compiling against iOS/macOS,
/// in particular running dsymutil and some other stuff like `-dead_strip`. Defaults to false.
pub is_like_osx: bool,
/// Whether the target toolchain is like Solaris's.
/// Only useful for compiling against Illumos/Solaris,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_incremental/persist/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ fn generate_session_dir_path(crate_dir: &Path) -> PathBuf {
}

fn create_dir(sess: &Session, path: &Path, dir_tag: &str) -> Result<(),()> {
match fs_util::create_dir_racy(path) {
match std_fs::create_dir_all(path) {
Ok(()) => {
debug!("{} directory created successfully", dir_tag);
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn register_native_lib(sess: &Session,
}
let is_osx = sess.target.target.options.is_like_osx;
if lib.kind == cstore::NativeFramework && !is_osx {
let msg = "native frameworks are only available on OSX targets";
let msg = "native frameworks are only available on macOS targets";
match span {
Some(span) => span_err!(sess, span, E0455, "{}", msg),
None => sess.err(msg),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ name. Example:
"##,

E0455: r##"
Linking with `kind=framework` is only supported when targeting OS X,
Linking with `kind=framework` is only supported when targeting macOS,
as frameworks are specific to that operating system.

Erroneous code example:
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
//
// And here we run into yet another obscure archive bug: in which metadata
// loaded from archives may have trailing garbage bytes. Awhile back one of
// our tests was failing sporadically on the OSX 64-bit builders (both nopt
// our tests was failing sporadically on the macOS 64-bit builders (both nopt
// and opt) by having ebml generate an out-of-bounds panic when looking at
// metadata.
//
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_save_analysis/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ pub fn process_crate<'l, 'tcx>(tcx: TyCtxt<'l, 'tcx, 'tcx>,
},
};

if let Err(e) = rustc::util::fs::create_dir_racy(&root_path) {
if let Err(e) = std::fs::create_dir_all(&root_path) {
tcx.sess.err(&format!("Could not create directory {}: {}",
root_path.display(),
e));
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_trans/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ fn link_rlib<'a>(sess: &'a Session,
}

// After adding all files to the archive, we need to update the
// symbol table of the archive. This currently dies on OSX (see
// symbol table of the archive. This currently dies on macOS (see
// #11162), and isn't necessary there anyway
if !sess.target.target.options.is_like_osx {
ab.update_symbols();
Expand Down Expand Up @@ -764,7 +764,7 @@ fn link_natively(sess: &Session,
// pain to land PRs when they spuriously fail due to a segfault.
//
// The issue #38878 has some more debugging information on it as well, but
// this unfortunately looks like it's just a race condition in OSX's linker
// this unfortunately looks like it's just a race condition in macOS's linker
// with some thread pool working in the background. It seems that no one
// currently knows a fix for this so in the meantime we're left with this...
info!("{:?}", &cmd);
Expand Down Expand Up @@ -841,7 +841,7 @@ fn link_natively(sess: &Session,
}


// On OSX, debuggers need this utility to get run to do some munging of
// On macOS, debuggers need this utility to get run to do some munging of
// the symbols
if sess.target.target.options.is_like_osx && sess.opts.debuginfo != NoDebugInfo {
match Command::new("dsymutil").arg(out_filename).output() {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl<'a> Linker for GnuLinker<'a> {
.arg("-l").arg(lib)
.arg("-Wl,--no-whole-archive");
} else {
// -force_load is the OSX equivalent of --whole-archive, but it
// -force_load is the macOS equivalent of --whole-archive, but it
// involves passing the full path to the library to link.
let mut v = OsString::from("-Wl,-force_load,");
v.push(&archive::find_library(lib, search_path, &self.sess));
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/back/symbol_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ fn mangle<PI: Iterator<Item=InternedString>>(path: PI, hash: &str) -> String {
// Follow C++ namespace-mangling style, see
// http://en.wikipedia.org/wiki/Name_mangling for more info.
//
// It turns out that on OSX you can actually have arbitrary symbols in
// It turns out that on macOS you can actually have arbitrary symbols in
// function names (at least when given to LLVM), but this is not possible
// when using unix's linker. Perhaps one day when we just use a linker from LLVM
// we won't need to do this name mangling. The problem with name mangling is
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_trans/debuginfo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ pub fn finalize(cx: &CrateContext) {
llvm::LLVMRustDIBuilderFinalize(DIB(cx));
llvm::LLVMRustDIBuilderDispose(DIB(cx));
// Debuginfo generation in LLVM by default uses a higher
// version of dwarf than OS X currently understands. We can
// version of dwarf than macOS currently understands. We can
// instruct LLVM to emit an older version of dwarf, however,
// for OS X to understand. For more info see #11352
// for macOS to understand. For more info see #11352
// This can be overridden using --llvm-opts -dwarf-version,N.
// Android has the same issue (#22398)
if cx.sess().target.target.options.is_like_osx ||
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/plugins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl PluginManager {
/// Load a plugin with the given name.
///
/// Turns `name` into the proper dynamic library filename for the given
/// platform. On windows, it turns into name.dll, on OS X, name.dylib, and
/// platform. On windows, it turns into name.dll, on macOS, name.dylib, and
/// elsewhere, libname.so.
pub fn load_plugin(&mut self, name: String) {
let x = self.prefix.join(libname(name));
Expand Down
Loading