Commit Graph

48312 Commits

Author SHA1 Message Date
Tobias Bucher
71dccf8706 Also check for NULs in environment variables
This check is necessary, because the underlying API only reads strings
until the first NUL.
2015-11-21 01:11:15 +00:00
bors
79b7a9efa9 Auto merge of #29916 - Manishearth:diag-401, r=steveklabnik
None
2015-11-21 00:54:16 +00:00
Matthias Kauer
e37cd6d5fd change link on book front page trpl -> book 2015-11-21 07:49:38 +08:00
bors
731c0ce4c9 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.
2015-11-20 22:08:19 +00:00
Björn Steinbrink
6741f3315a 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.

Found via apasel422/ref_count#13
2015-11-20 21:42:13 +01:00
bors
20cbba71d4 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).
2015-11-20 20:03:16 +00:00
Alex Crichton
24311d0762 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.
2015-11-20 10:58:38 -08:00
bors
6a6b97cf02 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>`

r? @alexcrichton
2015-11-20 18:13:10 +00:00
Aaron Turon
612d001d74 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).
2015-11-20 09:34:33 -08:00
Manish Goregaokar
92df8a9a99 Add E0517, E0518 for repr() errors 2015-11-20 21:23:58 +05:30
bors
68276619b5 Auto merge of #29951 - fhahn:fix-plugin-compiler-example, r=steveklabnik
PR for #29930. Adds missing #![feature(slice_patterns)] to make compiler plugin example compile again.
2015-11-20 15:26:35 +00:00
Angus Lees
07b7f2fbc9 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.
2015-11-20 12:51:10 -02:00
Florian Hahn
c53722daae Remove slice pattern from compiler plugin example
closes #29930
2015-11-20 14:31:04 +01:00
Vadim Petrochenkov
a613059e3f Rename #[deprecated] to #[rustc_deprecated] 2015-11-20 16:11:20 +03:00
bors
e5f8a3dd02 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.
2015-11-20 12:30:00 +00:00
Florian Hahn
755caf9ff7 Rename result variable in HashSet's intersection and union examples 2015-11-20 11:40:05 +01:00
bors
f8827f5275 Auto merge of #29534 - oli-obk:fix/const_fn_eval, r=dotdash 2015-11-20 09:48:11 +00:00
Devon Hollowood
da5dd298d4 Add information about str::parse() in FromStr docs 2015-11-20 00:41:10 -08:00
bors
2228bacd62 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`.

cc @rust-lang/compiler
2015-11-20 05:09:24 +00:00
bors
e5c69b10c3 Auto merge of #29942 - brson:rmsegstack, r=alexcrichton 2015-11-20 03:26:19 +00:00
Nick Cameron
de8467cf42 save-analysis: make the dump file's name closer to the crate file's name 2015-11-20 15:44:53 +13:00
bors
bce743ca0a Auto merge of #29939 - mitaa:doc_const_fn, r=alexcrichton
fixes #27362
2015-11-20 01:40:03 +00:00
Brian Anderson
5c88a1cd54 Add -C inline-threshold
Corresponds directly to llvm's inline-threshold
2015-11-19 17:01:07 -08:00
Brian Anderson
99741700e5 Remove segmented stack option from LLVMRustCreateTargetMachine. Unused. 2015-11-19 16:58:23 -08:00
bors
b289892b5d 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.

[rfc]: https://github.com/rust-lang/rfcs/pull/1288

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:

|  Platform  |  Instant                 |  SystemTime              |
|------------|--------------------------|--------------------------|
| Windows    | QueryPerformanceCounter  | GetSystemTimeAsFileTime  |
| OSX        | mach_absolute_time       | gettimeofday             |
| Unix       | CLOCK_MONOTONIC          | CLOCK_REALTIME           |

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.

cc #29866
2015-11-19 23:57:07 +00:00
bors
6861c51453 Auto merge of #29901 - tbu-:pr_env_ignore_malformed_windows, r=alexcrichton
See also #29297.
2015-11-19 22:15:13 +00:00
mitaa
82d37f3788 Show constness for functions of reexported docs 2015-11-19 22:47:02 +01:00
mitaa
81b4c1342a Fix rustdocs unsafe const fn ordering 2015-11-19 22:01:49 +01:00
Tobias Bucher
06fab0ea70 Add run-pass test for paths containing the NUL character 2015-11-19 20:05:50 +00:00
Tobias Bucher
4d81c02a20 Error when paths contain NUL characters
On Windows: Previously these paths were silently truncated at these NUL
characters, now they fail with `ErrorKind::InvalidInput`.
2015-11-19 20:05:09 +00:00
Tobias Bucher
9b4f16b370 Re-unignore environment test on MinGW 2015-11-19 20:02:35 +00:00
Tobias Bucher
14983477ca Ignore malformed environment variables on Windows too
Leading equals symbols are treated as part of the variable name, if
there is no other equality symbol or none at all, the environment string
is ignored.
2015-11-19 20:00:36 +00:00
bors
1902021032 Auto merge of #29925 - Ms2ger:fmt-trans-base, r=luqmana 2015-11-19 19:51:27 +00:00
Ariel Ben-Yehuda
3c0d55cc76 constrained_type_params: make projections depend on their trait-ref
As this is a soundness fix, it is a [breaking-change].

Fixes #29861.
2015-11-19 20:53:59 +02:00
Alex Crichton
c6eb8527e0 std: Add Instant and SystemTime to std::time
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.

[rfc]: https://github.com/rust-lang/rfcs/pull/1288

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:

|  Platform  |  Instant                 |  SystemTime              |
|------------|--------------------------|--------------------------|
| Windows    | QueryPerformanceCounter  | GetSystemTimeAsFileTime  |
| OSX        | mach_absolute_time       | gettimeofday             |
| Unix       | CLOCK_MONOTONIC          | CLOCK_REALTIME           |

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.
2015-11-19 09:32:38 -08:00
bors
fd688f4075 Auto merge of #29932 - steveklabnik:trpl_book, r=brson
The book was located under 'src/doc/trpl' because originally, it was
going to be hosted under that URL. Late in the game, before 1.0, we
decided that /book was a better one, so we changed the output, but
not the input. This causes confusion for no good reason. So we'll change
the source directory to look like the output directory, like for every
other thing in src/doc.

r? @brson
2015-11-19 16:49:20 +00:00
Steve Klabnik
024aa9a345 src/doc/trpl -> src/doc/book
The book was located under 'src/doc/trpl' because originally, it was
going to be hosted under that URL. Late in the game, before 1.0, we
decided that /book was a better one, so we changed the output, but
not the input. This causes confusion for no good reason. So we'll change
the source directory to look like the output directory, like for every
other thing in src/doc.
2015-11-19 11:30:18 -05:00
Tobias Bucher
c5971a29da Remove unneeded #[derive(Copy)]
It was introduced with the change that made copy opt-in. The
implementation gives a warning, because the struct contains a raw
pointer.
2015-11-19 16:00:54 +00:00
Ms2ger
83b636930d Avoid a string allocation. 2015-11-19 12:37:13 +01:00
Ms2ger
3ccef0fdc5 Rustfmt trans/base.rs. 2015-11-19 12:36:31 +01:00
Vadim Petrochenkov
c1ad5af4a6 Changes to data produced by privacy pass 2015-11-19 14:16:35 +03:00
bors
3e48b0e380 Auto merge of #29917 - shssoichiro:doc-sidebar-order, r=alexcrichton
A race condition in Javascript was causing unpredictable ordering
of the sidebar boxes when loading documentation generated by
rustdoc, due to the script that adds the Crates box being executed
asynchronously. Disabling the asynchronous execution and deferring
this script should ensure that the Crates box always appears last
in the sidebox (this seemed to be the more common ordering prior
to this change).

Fixes #29698
2015-11-19 02:51:15 +00:00
bors
9303055f37 Auto merge of #29903 - nikomatsakis:incr-comp-ool-items, r=mw,nrc
This PR moves items into a separate map stored in the krate, rather than storing them inline in the HIR. The HIR visitor is also modified to skip visiting nested items by default. The goal here is to ensure that if you get access to the HIR for one item, you don't automatically get access to a bunch of other items, for better dependency tracking.

r? @nrc
cc @eddyb
2015-11-19 01:01:30 +00:00
Niko Matsakis
7926fa1ee9 Update unit tests in driver. 2015-11-18 19:23:30 -05:00
Niko Matsakis
f8f2e2bad5 minor fixes to #[cfg(test)] code 2015-11-18 19:23:29 -05:00
Niko Matsakis
cfe4c3567a ratchet down the recursion limit because, at least in my testing,
under some configurations this still causes a stack overflow and
hence a crash
2015-11-18 19:23:29 -05:00
Niko Matsakis
7c2ee5ed12 Patch graphviz tests to account for the fact that nested items are not
listed (an improvement, I think).
2015-11-18 19:23:29 -05:00
Niko Matsakis
bca026efb9 Fix two long lines. 2015-11-18 19:23:29 -05:00
Niko Matsakis
06f2d9da87 Modify trans to use an outer walk and ensure that we rotate as we
encounter each module. This is somewhat different than how it used to
work; it should ensure a more equitable distribution of work than
before. The reason is that, before, when we rotated, we would rotate
before we had seen the full contents of the current module. So e.g.  if
we have `mod a { mod b { .. } .. }`, then we rotate when we encounter
`b`, but we haven't processed the remainder of `a` yet. Unclear if this
makes any difference in practice, but it seemed suboptimal. Also, this
structure (with an outer walk over modules) is closer to what we will
want for an incremental setting.
2015-11-18 19:23:29 -05:00
Niko Matsakis
0bc61402a9 Remove rustc_data_structures from the deps of librustc_front now
that we no longer use FnvHashMap
2015-11-18 19:23:29 -05:00