Ulrik Sverdrup [Fri, 26 Feb 2016 01:53:47 +0000 (02:53 +0100)]
Make sure formatter errors are emitted by the default Write::write_fmt
Previously, if an error was returned from the formatter that did not
originate in an underlying writer error, Write::write_fmt would return
successfully even if the formatting did not complete (was interrupted by
an `fmt::Error` return).
Now we choose to emit an io::Error with kind Other for formatter errors.
Since this may reveal error returns from `write!()` and similar that
previously passed silently, it's a kind of a [breaking-change].
bors [Thu, 18 Feb 2016 16:29:55 +0000 (16:29 +0000)]
Auto merge of #31734 - aliclark:bsd-stat-fixes, r=alexcrichton
In https://github.com/rust-lang/rust/issues/25155 the os::freebsd::raw stat was split for the x86 vs. x86-64 cases, which appears to have been done to implement the padding on the end of struct stat for the x86 case (the struct is otherwise the same notwistanding the size of long).
This PR de-duplicates the struct using #[cfg(target_arch = "x86")] for the __unused field, which also fixes the definitions which had sinced changed with the LFS work d088b671872f1df6993ccca6fa6139ebed0a8cf3.
Also changed definitions to c_long for dragonfly and freebsd where appropriate.
Also removes some unused imports that the compiler was complaining about.
freebsd's long time_t:
https://svnweb.freebsd.org/base/release/10.1.0/sys/x86/include/_types.h?view=markup
https://github.com/rust-lang/rust/blob/d088b671872f1df6993ccca6fa6139ebed0a8cf3/src/liblibc/lib.rs#L980
freebsd's padding for i686 stat:
https://svnweb.freebsd.org/base/release/10.1.0/sys/sys/stat.h?view=markup#l139
https://github.com/rust-lang/rust/blob/d088b671872f1df6993ccca6fa6139ebed0a8cf3/src/liblibc/lib.rs#L1038
bors [Thu, 18 Feb 2016 07:35:49 +0000 (07:35 +0000)]
Auto merge of #31727 - semarie:openbsd-llvm-cpu, r=alexcrichton
The initial purpose is to workaround the LLVM bug
https://llvm.org/bugs/show_bug.cgi?id=26554 for OpenBSD.
By default, the `cpu` is defined to `generic`. But with a 64bit
processor, the optimization for `generic` will use invalid asm code as
NOP (the generated code for NOP isn't a NOP).
According to #20777, "x86-64" is the right thing to do for x86_64
builds.
bors [Thu, 18 Feb 2016 03:35:21 +0000 (03:35 +0000)]
Auto merge of #31641 - petrochenkov:reach, r=alexcrichton
Fixes https://github.com/rust-lang/rust/issues/16734 and probably some other issues
This is a continuation of https://github.com/rust-lang/rust/pull/29822, but the algorithm is mostly a copy of https://github.com/rust-lang/rust/pull/29973, so
r? @alexcrichton or @nikomatsakis
Steve Klabnik [Wed, 17 Feb 2016 23:14:36 +0000 (18:14 -0500)]
Rollup merge of #31695 - oconnor663:chardocs, r=alexcrichton
Previously the docs suggested that '❤️' doesn't fit in a char because
it's 6 bytes. But that's misleading. 'a̚' also doesn't fit in a char,
even though it's only 3 bytes. The important thing is the number of code
points, not the number of bytes. Clarify the primitive char docs around
this.
Steve Klabnik [Wed, 17 Feb 2016 23:14:36 +0000 (18:14 -0500)]
Rollup merge of #31694 - oconnor663:insertdocs, r=steveklabnik
The first time I read the docs for `insert()`, I thought it was saying it didn't update existing *values*, and I was confused. Reword the docs to make it clear that `insert()` does update values.
Sébastien Marie [Wed, 17 Feb 2016 10:30:42 +0000 (11:30 +0100)]
specify the cpu type for LLVM for OpenBSD target
The initial purpose is to workaround the LLVM bug
https://llvm.org/bugs/show_bug.cgi?id=26554 for OpenBSD.
By default, the `cpu' is defined to `generic`. But with a 64bit
processor, the optimization for `generic` will use invalid asm code as
NOP (the generated code for NOP isn't a NOP).
According to #20777, "x86-64" is the right thing to do for x86_64
builds.
bors [Wed, 17 Feb 2016 06:01:49 +0000 (06:01 +0000)]
Auto merge of #31685 - petrochenkov:patrefact2, r=eddyb
And split `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::Path`.
This is the HIR part of https://github.com/rust-lang/rust/pull/31581.
This is also kind of a preparation for https://github.com/rust-lang/rfcs/pull/1492.
bors [Wed, 17 Feb 2016 03:25:45 +0000 (03:25 +0000)]
Auto merge of #31717 - alexcrichton:llvmup2, r=brson
This commit rebases our LLVM submodule on the most recent tip of the
`release_38` branch of LLVM. There's been a few fixes and this notably fixes the
assertion error in #31702.
Alex Crichton [Tue, 16 Feb 2016 17:58:41 +0000 (09:58 -0800)]
rustc: Rebase LLVM on the 3.8 release branch
This commit rebases our LLVM submodule on the most recent tip of the
`release_38` branch of LLVM. There's been a few fixes and this notably fixes the
assertion error in #31702.
bors [Tue, 16 Feb 2016 19:34:57 +0000 (19:34 +0000)]
Auto merge of #31534 - jseyfried:restrict_noninline_mod, r=nikomatsakis
This PR disallows non-inline modules without path annotations that are either in a block or in an inline module whose containing file is not a directory owner (fixes #29765).
This is a [breaking-change].
r? @nikomatsakis
bors [Tue, 16 Feb 2016 17:13:46 +0000 (17:13 +0000)]
Auto merge of #30714 - wesleywiser:fix_29914, r=arielb1
The issue was that the const evaluator was returning an error because
the feature flag const_indexing wasn't turned on. The error was then
reported as a bug.
bors [Tue, 16 Feb 2016 15:12:40 +0000 (15:12 +0000)]
Auto merge of #31678 - JohanLorenzo:follow-up-31368, r=alexcrichton
Thanks for catching this @tamird. Here's a quick fix. I didn't pick "let the linker link dead code" or "link dead code" because it would add no extra information to the flag name. Here's a another proposal.
bors [Tue, 16 Feb 2016 13:09:55 +0000 (13:09 +0000)]
Auto merge of #31675 - pitdicker:fs_metadata, r=alexcrichton
Because we no longer use `GetFileAttributesExW` FileAttr is never created directly from `WIN32_FILE_ATTRIBUTE_DATA` anymore. So we should no longer store FileAttr's attributes in that c struct.
bors [Tue, 16 Feb 2016 07:01:34 +0000 (07:01 +0000)]
Auto merge of #31668 - cuviper:lfs, r=alexcrichton
This follows the pattern already used for stat functions from #31551. Now
`ftruncate`, `lseek`, and `readdir_r` use their explicit 64-bit variants for
LFS support, using wider `off_t` and `dirent` types. This also updates to
`open64`, which uses no different types but implies the `O_LARGEFILE` flag.
Non-Linux platforms just map their normal functions to the 64-bit names.
bors [Tue, 16 Feb 2016 03:03:35 +0000 (03:03 +0000)]
Auto merge of #31639 - quodlibetor:doc-search-with-unknown-types, r=alexcrichton
This enables `*` in all type positions in doc searches, which I often
want in order to find functions that create or convert specific
types (e.g. `* -> vec`) but I don't actually know what kinds of input
they expect.
I actually started working on this because of #31598, but I've wanted it
several times when exploring new crates.
Jack O'Connor [Sat, 30 Jan 2016 18:44:45 +0000 (13:44 -0500)]
clarify how insert() doesn't update keys
The first time I read the docs for `insert()`, I thought it was saying
it didn't update existing *values*, and I was confused. Reword the docs
to make it clear that `insert()` does update values.
Jack O'Connor [Tue, 16 Feb 2016 01:18:16 +0000 (20:18 -0500)]
correct the primitive char doc's use of bytes and code points
Previously the docs suggested that '❤️' doesn't fit in a char because
it's 6 bytes. But that's misleading. 'a̚' also doesn't fit in a char,
even though it's only 3 bytes. The important thing is the number of code
points, not the number of bytes. Clarify the primitive char docs around
this.
doc pages: add the ability to search unknown types
This enables `*` in all type positions in doc searches, which I often
want in order to find functions that create or convert specific
types (e.g. `* -> vec`) but I don't actually know what kinds of input
they expect.
I actually started working on this because of #31598, but I've wanted it
several times when exploring new crates.
bors [Mon, 15 Feb 2016 14:57:44 +0000 (14:57 +0000)]
Auto merge of #31656 - jonas-schievink:mirdump, r=nrc
This allows obtaining a textual MIR dump for individual items or all items in the crate.
I haven't added any tests since ~~I'm too lazy~~ this is an unstable debugging option, but I'll add one if required.
MIR for a single function can now be dumped using `rustc -Zunstable-options --unpretty mir=my_function` and no longer requires the use of in-source `#[rustc_mir]` attributes.
Blocks rust-lang/rust-playpen#154 (if MIR dump support from the playpen is even wanted).
Example output:
```rust
fn main() {
let x = Some(0);
x.unwrap_or_else(|| 1);
}
```
```
MIR for expr || 1 (id=16)
fn(arg0: [closure@test.rs:3:22: 3:26]) -> i32 {
let mut tmp0: ();
bb0: {
return = const 1;
goto -> bb1;
}
bb1: {
return;
}
}
MIR for fn main::main (id=4)
fn() -> () {
let var0: core::option::Option<i32>; // x
let mut tmp0: ();
let mut tmp1: i32;
let mut tmp2: core::option::Option<i32>;
let mut tmp3: [closure@test.rs:3:22: 3:26];
Paul Dicker [Mon, 15 Feb 2016 11:43:30 +0000 (12:43 +0100)]
Refactor windows::fs::FileAttr
Because we no longer use `GetFileAttributesExW` FileAttr is never created
directly from `WIN32_FILE_ATTRIBUTE_DATA` anymore.
So we should no longer store FileAttr's attributes in that c struct.
The `classifyArgumentType` function has two different paths depending on `RAA == CGCXXABI::RAA_DirectInMemory`, but I don't really know what's the corresponding option in Rust.
bors [Mon, 15 Feb 2016 07:13:02 +0000 (07:13 +0000)]
Auto merge of #31648 - jseyfried:fix_diagnostics, r=nrc
This PR fixes two unrelated diagnostics bugs in resolve.
First, it reports privacy errors for an import only after the import resolution is determined, fixing #31402.
Second, it expands the per-module map from block ids to anonymous modules so that it also maps module declarations ids to modules, and it uses this map to in `with_scope` to fix #31644.
Dirk Gadsden [Mon, 15 Feb 2016 06:26:37 +0000 (22:26 -0800)]
Rename `error-index-generator` to `error_index_generator`
This is because the tool compiler passes the name of the tool
as a command line `--cfg`. The improved session config parser
is stricter and no longer permits invalid meta items (such as
"error-index-generator").
Nick Cameron [Sun, 31 Jan 2016 19:39:50 +0000 (08:39 +1300)]
Add some simple error recovery to the parser and fix tests
Some tests just add the extra errors, others I fix by doing some simple error recovery. I've tried to avoid doing too much in the hope of doing something more principled later.
In general error messages are getting worse at this stage, but I think in the long run they will get better.
Alex Crichton [Sun, 7 Feb 2016 06:54:35 +0000 (22:54 -0800)]
std: Stop prefixing jemalloc symbols
Now that we properly only link in jemalloc when building executables, we have
far less to worry about in terms of polluting the global namespace with the
`free` and `malloc` symbols on Linux. This commit will primarily allow LLVM to
use jemalloc so the compiler will only be using one allocator overall.
Locally this took compile time for libsyntax from 95 seconds to 89 (a 6%
improvement).