bors [Tue, 24 Nov 2015 23:24:18 +0000 (23:24 +0000)]
Auto merge of #30016 - alexcrichton:fix-off-by-one, r=brson
Typical algebra currently doesn't work on the types in std::time currently (see
[this comment][comment]), so tweak the tests to account for this property.
bors [Tue, 24 Nov 2015 19:46:59 +0000 (19:46 +0000)]
Auto merge of #29960 - aturon:dismantle-traitref-subtyping, r=nikomatsakis
Trait references are always invariant, so all uses of subtyping between
them are equivalent to using equality.
Moreover, the overlap check was previously performed twice per impl
pair, once in each direction. It is now performed only once, and
internally uses the equality check.
On glium, a crate that spends some time in coherence, this change sped
up coherence checking by a few percent (not very significant).
bors [Tue, 24 Nov 2015 11:10:22 +0000 (11:10 +0000)]
Auto merge of #30012 - jonas-schievink:log-level-trace, r=alexcrichton
The `log` crate on crates.io already knows `TRACE`, but the internal liblog doesn't, which causes it to spew errors when a `TRACE` level is defined. I made `TRACE` behave like `DEBUG`.
bors [Tue, 24 Nov 2015 04:26:47 +0000 (04:26 +0000)]
Auto merge of #30006 - ntrepid8:skip-check-for-DYLD-libs-in-child-proc, r=alexcrichton
link: https://forums.developer.apple.com/thread/9233
The causes a test in `src/libstd/process.rs' to fail when those environment variables are not found in the child process. This PR skips those variables similar to how the Windows envars that start with `=` are skipped.
Alex Crichton [Mon, 23 Nov 2015 22:51:45 +0000 (14:51 -0800)]
std: Tweak tests of std::time
Typical algebra currently doesn't work on the types in std::time currently (see
[this comment][comment]), so tweak the tests to account for this property.
bors [Mon, 23 Nov 2015 06:27:49 +0000 (06:27 +0000)]
Auto merge of #29984 - Manishearth:slice-assert, r=alexcrichton
I'd like to have the message print out the index and length values like it does elsewhere, but I'm not sure how to do that without affecting perf here. Will `assert!(cond, "index out of bounds got {} but len is ", idx, len)` make things slower? It calls `panic_fmt` which is marked as cold but also calls `format_args!`, and I don't know if that allocates or does any heavy lifting.
bors [Sun, 22 Nov 2015 23:01:56 +0000 (23:01 +0000)]
Auto merge of #28907 - SingingTree:rustfmt_libterm, r=nrc
Hey hey,
This is the result of running rustfmt over the libterm module. The first commit reflects the unaltered changes from rustfmt, and the commit message contains some notes on areas where I thought rustfmt had behaved strangely. The second commit attempts to fix the strange areas from the first commit.
Clarification edit: there are still some areas where I think rustfmt has made changes which may merit discussion (one is noted in the comments below). My second commit only undoes the changes that I figured would not warrant discussion (based on my opinion of the style, which is of course subjective).
bors [Sat, 21 Nov 2015 22:08:26 +0000 (22:08 +0000)]
Auto merge of #29963 - dotdash:fat_copy, r=eddyb
Since fat pointers do not qualify as structural types, they got copied
using load_ty and store_ty, which means that we load an FCA and use
extractvalue to get the components of the fat pointer. This breaks
certain optimizations in LLVM.
bors [Sat, 21 Nov 2015 06:06:16 +0000 (06:06 +0000)]
Auto merge of #29966 - MatthiasKauer:master, r=steveklabnik
This commit changes the location of the rust docs.
https://github.com/rust-lang/rust/commit/024aa9a345e92aa1926517c4d9b16bd83e74c10d
Clicking the contribution link on the front page therefore becomes a 'not found' error.
bors [Fri, 20 Nov 2015 22:08:19 +0000 (22:08 +0000)]
Auto merge of #29961 - alexcrichton:order-dependent, r=brson
This commit fixes a bug where a crate could fail to compile depending on the
order of `extern crate` directives at the top of the crate. Specifically, if the
same crate is found at two locations, then if it's loaded first via `--extern`
it will not emit a duplicate warning, but if it's first loaded transitively
via a dep and *then* via `--extern` an error will be emitted.
The loader was tweaked to catch this scenario and coalesce the loading of these
two crates to prevent errors from being emitted.
Björn Steinbrink [Fri, 20 Nov 2015 20:42:13 +0000 (21:42 +0100)]
Avoid FCA loads and extractvalue when copying fat pointers
Since fat pointers do not qualify as structural types, they got copied
using load_ty and store_ty, which means that we load an FCA and use
extractvalue to get the components of the fat pointer. This breaks
certain optimizations in LLVM.
bors [Fri, 20 Nov 2015 20:03:16 +0000 (20:03 +0000)]
Auto merge of #29945 - nrc:save-crate-name, r=alexcrichton
r? @alexcrichton
This prevents outputting csv files with the same name and thus overwriting each other when indexing Cargo projects with a bin crate (and some other cases).
Alex Crichton [Wed, 21 Oct 2015 04:05:39 +0000 (21:05 -0700)]
rustc: Fix `extern crate` being order dependent
This commit fixes a bug where a crate could fail to compile depending on the
order of `extern crate` directives at the top of the crate. Specifically, if the
same crate is found at two locations, then if it's loaded first via `--extern`
it will not emit a duplicate warning, but if it's first loaded transitively
via a dep and *then* via `--extern` an error will be emitted.
The loader was tweaked to catch this scenario and coalesce the loading of these
two crates to prevent errors from being emitted.
bors [Fri, 20 Nov 2015 18:13:10 +0000 (18:13 +0000)]
Auto merge of #29822 - petrochenkov:pubexport, r=alexcrichton
This patch implements the plan described in https://internals.rust-lang.org/t/privacy-and-its-interaction-with-docs-lints-and-stability/2880 with one deviation.
It turns out, that rustdoc needs the "directly public" set for its docs inlining logic, so the privacy pass have to produce three sets and not two. Three is arguably too many, so I merged them in one map:
`public_items/exported_items/reachable_items: NodeSet => access_levels: NodeMap<AccessLevel>`
Aaron Turon [Fri, 20 Nov 2015 17:34:33 +0000 (09:34 -0800)]
Change TraitRef subtyping checks to equality
Trait references are always invariant, so all uses of subtyping between
them are equivalent to using equality.
Moreover, the overlap check was previously performed twice per impl
pair, once in each direction. It is now performed only once, and
internally uses the equality check.
On glium, a crate that spends some time in coherence, this change sped
up coherence checking by a few percent (not very significant).
Angus Lees [Fri, 20 Nov 2015 14:48:19 +0000 (12:48 -0200)]
Set CFLAGS/LDFLAGS/etc according to Debian policy
Debian wants to build all binaries with particular hardening flags.
The Rust makefiles are inconsistent in which architectures they
correctly include CFLAGS/etc from the enivoronment (see mk/cfg/*).
This patch adds LDFLAGS, and then unconditionally prepends
CFLAGS/LDFLAGS/etc to the build commands.
bors [Fri, 20 Nov 2015 12:30:00 +0000 (12:30 +0000)]
Auto merge of #29950 - fhahn:small-doc-fix-rename-var, r=bluss
This tiny PR renames the result variable in HashSet's `intersection` example from `diff` to `intersection` and the same for `union`, which seem more appropriate.
bors [Fri, 20 Nov 2015 05:09:24 +0000 (05:09 +0000)]
Auto merge of #29943 - brson:inline-threshold, r=nrc
Corresponds directly to llvm's inline-threshold.
I want this so I can experiment out-of-tree with tweaking optimization settings, and this is the most important value that isn't exposed. I can't get it to work either via `-C llvm-args`.
bors [Thu, 19 Nov 2015 23:57:07 +0000 (23:57 +0000)]
Auto merge of #29894 - alexcrichton:stdtime, r=brson
This commit is an implementation of [RFC 1288][rfc] which adds two new unstable
types to the `std::time` module. The `Instant` type is used to represent
measurements of a monotonically increasing clock suitable for measuring time
withing a process for operations such as benchmarks or just the elapsed time to
do something. An `Instant` favors panicking when bugs are found as the bugs are
programmer errors rather than typical errors that can be encountered.
The `SystemTime` type is used to represent a system timestamp and is not
monotonic. Very few guarantees are provided about this measurement of the system
clock, but a fixed point in time (`UNIX_EPOCH`) is provided to learn about the
relative distance from this point for any particular time stamp.
This PR takes the same implementation strategy as the `time` crate on crates.io,
namely:
These implementations can perhaps be refined over time, but they currently
satisfy the requirements of the `Instant` and `SystemTime` types while also
being portable across implementations and revisions of each platform.