Commit Graph

48729 Commits

Author SHA1 Message Date
Manish Goregaokar
bef93557e5 Improve transmute diagnostics with a note about destructors
fixes #29922
2015-11-22 10:26:50 +05:30
Manish Goregaokar
352853c18b Register diagnostics for rustc_privacy and rustc_trans properly
fixes #29665
2015-11-22 10:26:22 +05:30
bors
ced9ad3064 Auto merge of #29968 - Manishearth:bang-macro-diag, r=eddyb
r? @eddyb

fixes #5780
2015-11-22 04:13:49 +00:00
Manish Goregaokar
99925fb562 Look up macro names as well when suggesting replacements for function resolve errors
fixes #5780
2015-11-22 06:48:46 +05:30
Bryce Van Dyk
7d54c32c94 Rustfmt libterm, skip long static in compiled.rs 2015-11-22 13:24:56 +13:00
bors
eb19d024a9 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.

Found via apasel422/ref_count#13
2015-11-21 22:08:26 +00:00
bors
685e098561 Auto merge of #29966 - MatthiasKauer:master, r=steveklabnik
This commit changes the location of the rust docs.
024aa9a345
Clicking the contribution link on the front page therefore becomes a 'not found' error.
2015-11-21 06:06:16 +00:00
bors
ef5ee7d895 Auto merge of #29948 - devonhollowood:fromstr-parse, r=steveklabnik
Implement #29919
2015-11-21 04:22:15 +00:00
bors
d1c7a93eff Auto merge of #29913 - tbu-:pr_windows_path_error_on_nul, r=alexcrichton
On Windows: Previously these paths were silently truncated at these NUL
characters, now they fail with `ErrorKind::InvalidInput`.
2015-11-21 02:38:18 +00:00
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
Oliver Schneider
64051221b6 add feature gate const_indexing
tracking issue is #29947
2015-11-20 10:43:04 +01: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