Commit Graph

68068 Commits

Author SHA1 Message Date
gaurikholkar
e71eef1775 fix ui tests 2017-09-13 20:56:27 +05:30
leonardo.yvens
c2fb70be6b Refactor fn_trait_kind
Short and sweet
2017-09-13 12:19:37 -03:00
Alex Burka
a12d0d4f66 honor #[rustc_const_unstable] attributes 2017-09-13 15:07:17 +00:00
leonardo.yvens
ab30b6a6ed Refactor how to get a lang item's name
Small refactorings
2017-09-13 12:00:40 -03:00
Alex Crichton
5cad391631 rustc: Spawn cmd /c emcc.bat explicitly
In #42436 the behavior for spawning processes on Windows was tweaked slightly to
fix various bugs, but this caused #42791 as a regression, namely that to spawn
batch scripts they need to be manually spawned with `cmd /c` instead now. This
updates the compiler to handle this case explicitly for Emscripten.

Closes #42791
2017-09-13 07:41:58 -07:00
leonardo.yvens
74107f987b Remove require_owned_box
It's unused and unnecessary
2017-09-13 11:16:45 -03:00
bors
539f2083de Auto merge of #44129 - pnkfelix:fix-end-region-emission-order, r=nmatsakis
Fix end region emission order

Fix #43481
2017-09-13 13:01:42 +00:00
Guillaume Gomez
c4044ee39a Add note for append method in OpenOptions docs 2017-09-13 14:47:50 +02:00
Guillaume Gomez
ccd4689ca3 Add missing urls for OpenOptions docs 2017-09-13 14:46:15 +02:00
Havvy
9dd2ee1942 Fix example in transmute; add safety requirement to Vec::from_raw_parts 2017-09-13 04:27:40 -07:00
Romain Porte
b40a9f4eca from_micros: add feature name 2017-09-13 13:21:20 +02:00
Felix S. Klock II
5fa0b661e0 Test case illustrating some destruction code extent stuff. 2017-09-13 12:55:03 +02:00
Felix S. Klock II
88080bd56a Unit test for proper EndRegion emission on a cyclic reference. 2017-09-13 12:55:03 +02:00
Felix S. Klock II
ab46142bd9 Update mir-opt tests to reflect change to EndRegion emission order.
Driveby fix to end_region_9.rs; it was missing END marker and was
therefore always passing (regardless of output correctness).
2017-09-13 12:55:03 +02:00
Felix S. Klock II
25aa86da17 Fix issue #43481: emit the EndRegion *before* StorageDeads for a scope.
(The idea is that the StorageDead marks the point where the memory can
be deallocated, and the EndRegion is marking where borrows of that
memory can no longer legally exist.)
2017-09-13 12:55:03 +02:00
bors
824952f48b Auto merge of #44386 - est31:master, r=pnkfelix
Fix mispositioned error indicators

Fixes #38384

Most of the Rust community uses 4 spaces for indentation,
but there are also tab users of Rust (including myself!).

This patch fixes a bug in error printing which mispositions
error indicators when near code with tabs.

The code attempted to fix the issue by replacing spaces
with tabs, but it sadly wasn't enough, as sometimes
you may not print spaces but _ or ^ instead.

This patch employs the reverse strategy: it replaces each
tab with a space, so that the number of _ and ^ and spaces
in error indicators below the code snippet line up
perfectly.

In a study [1] preceeding this patch, we could see that
this strategy is also chosen by gcc version 6.3.0.

Its not perfect, as the output is not beautiful, but its
the easiest to implement. If anyone wants to improve on
this, be my guest! This patch is meant as improvement of
the status quo, not as perfect end status. It fixes the
actual issue of mispositioning error indicators.

[1]: https://github.com/rust-lang/rust/issues/38384#issuecomment-326813710
2017-09-13 10:28:33 +00:00
Tobias Schaffner
b2b5063517 Move default stack min size to thread implementations
The default min stack size value is smaller on l4re and therefore
this value has to be different depending on the platform.
2017-09-13 10:56:41 +02:00
David Adler
518bd30854 Fix drain_filter doctest. 2017-09-12 22:47:45 -07:00
bors
c3eccc694c Auto merge of #44420 - alexcrichton:private-cstore, r=michaelwoerister
rustc: Make `CrateStore` private to `TyCtxt`

This commit makes the `CrateStore` object private to the `ty/context.rs` module and also absent on the `Session` itself.

cc #44390
cc #44341 (initial commit pulled and rebased from here)
2017-09-13 05:32:00 +00:00
Nick Cameron
368cab3b03 Reviewer changes 2017-09-13 16:48:53 +12:00
Nick Cameron
d0070e85db Build and test Rustfmt 2017-09-13 16:18:45 +12:00
Nick Cameron
c4508e1226 Add rustfmt as a submodule 2017-09-13 16:18:44 +12:00
Alex Crichton
921750b8ac rustc: Make CrateStore private to TyCtxt
This commit removes the `cstore_untracked` method, making the `CrateStore` trait
object entirely private to the `ty/context.rs` module.
2017-09-12 21:14:06 -07:00
bors
7eefed392f Auto merge of #44456 - eddyb:stable-drop-const, r=nikomatsakis
Stabilize drop_types_in_const.

Closes #33156, stabilizing the new, revised, rules, and improving the error message.

r? @nikomatsakis cc @SergioBenitez
2017-09-13 03:04:49 +00:00
Ethan Dagner
8adf50d90e Remove Invalid UTF-8 from str::from_utf8_unchecked_mut 2017-09-12 17:30:44 -06:00
QuietMisdreavus
81ebab6fca bump gcc for bootstrap
On Windows, the gcc crate would send /Wall to msvc, which would cause
builds to get flooded with warnings, exploding compile times from one
hour to more than 72! The gcc crate version 0.3.54 changes this behavior
to send /W4 instead, which greatly cuts down on cl.exe flooding the
command prompt window with warnings.
2017-09-12 18:09:26 -05:00
bors
2fdccaffe6 Auto merge of #44015 - kennytm:hasher, r=alexcrichton
impl Hasher for {&mut Hasher, Box<Hasher>}

**Rationale:** The `Hash` trait has `fn hash<H: Hasher>(&self, state: &mut H)`, which can only accept a `Sized` hasher, even if the `Hasher` trait is object-safe. We cannot retroactively add the `?Sized` bound without breaking stability, thus implementing `Hasher` to a trait object reference is the next best solution.

**Warning:** These `impl` are insta-stable, and should need an FCP. I don't think a full RFC is necessary.
2017-09-12 21:39:08 +00:00
leonardo.yvens
4738231cc7 Remove deprecated lang items
They have been deprecated for years and there is no trace left of them
in the compiler.
2017-09-12 17:04:26 -03:00
Guillaume Gomez
742ff5a489 Fix rendering of const keyword for functions 2017-09-12 21:55:24 +02:00
Aidan Hobson Sayers
15887d786b Correctly bubble up errors from libbacktrace 2017-09-12 20:27:54 +01:00
bors
dd08c30703 Auto merge of #44133 - vorner:allocator-kind-autodetect, r=alexcrichton
Autodetect the type of allocator crate used

Annotate the allocator crates (allocator_system, allocator_jemalloc) by the type of allocator they are. If one is requested as an exe allocator, detect its type by the flags.

This has the effect that using this (de jure wrong) configuration in the target spec works instead of producing a really unhelpful and arcane linker error:

"exe-allocation-crate": "alloc_system"

Fixes #43524.

There are two yet unsolved FIXME's, I'll be glad for some advice on what to do with them.
2017-09-12 18:12:21 +00:00
Michael Woerister
54fa047d92 Remove the cstore reference from Session in order to prepare encapsulating CrateStore access in tcx. 2017-09-12 07:19:06 -07:00
Jeroen Bollen
d3de465dc8 Addressed @BurntSuchi's remarks regarding Entry::replace 2017-09-12 15:32:10 +02:00
gaurikholkar
6e3cdcea4c Adding changes for trait objects 2017-09-12 18:22:22 +05:30
bors
a7b7dce02d Auto merge of #44413 - est31:move_man, r=nikomatsakis
Move the man directory to a subdirectory

There is no reason it should be in the top directory.
2017-09-12 12:41:23 +00:00
gaurikholkar
93529b40ca add ui test for fn items, tidy fixes 2017-09-12 16:48:18 +05:30
rwakulszowa
b8e0989445 Add an example of std::str::encode_utf16
Closes #44419
2017-09-12 11:59:42 +01:00
bors
817e1b81e2 Auto merge of #44344 - jonhoo:entry_or_default, r=BurntSushi
Add or_default to Entry APIs

As argued for in #44324, this PR adds a new `or_default` method to the various `Entry` APIs (currently just for `BTreeMap` and `HashMap`) when `V: Default`. This method is effectively a shorthand for `or_insert_with(Default::default)`.
2017-09-12 09:54:59 +00:00
kennytm
143e2dcd5c
Disable the new Hasher tests on Emscripten. 2017-09-12 17:28:07 +08:00
kennytm
0bbe468271
impl Hasher for {&mut Hasher, Box<Hasher>} 2017-09-12 17:28:07 +08:00
bors
8fc0fc8c2d Auto merge of #44310 - ldr709:master, r=BurntSushi
Additional traits for std::mem::ManuallyDrop

The first commit adds `Clone` and `Copy` trait implementations for `ManuallyDrop`. Although `Drop` and `Copy` cannot be used together, this may be useful for generics.

The second commit adds implementations common traits. I do not think this is necessary, as they could be implemented in a wrapper type outside the standard library, but it would make `ManuallyDrop` more convenient to use.
2017-09-12 07:13:40 +00:00
gaurikholkar
a128051f87 fixes 2017-09-12 10:10:11 +05:30
gaurikholkar
54af57018b correct depth initialisation 2017-09-12 10:06:29 +05:30
gaurikholkar
b2d869dc80 add logs 2017-09-12 10:06:29 +05:30
gaurikholkar
ed1181272e extend E0623 for fns 2017-09-12 10:06:29 +05:30
gaurikholkar
2f50c33290 Adding E0623 for structs 2017-09-12 10:06:29 +05:30
Jacob Kiesel
4de0cf122d Try using ref to raw conversion 2017-09-11 22:23:56 -06:00
bors
3cb24bd37b Auto merge of #44275 - eddyb:deferred-ctfe, r=nikomatsakis
Evaluate fixed-length array length expressions lazily.

This is in preparation for polymorphic array lengths (aka `[T; T::A]`) and const generics.
We need deferred const-evaluation to break cycles when array types show up in positions which require knowing the array type to typeck the array length, e.g. the array type is in a `where` clause.

The final step - actually passing bounds in scope to array length expressions from the parent - is not done because it still produces cycles when *normalizing* `ParamEnv`s, and @nikomatsakis' in-progress lazy normalization work is needed to deal with that uniformly.

However, the changes here are still useful to unlock work on const generics, which @EpicatSupercell manifested interest in, and I might be mentoring them for that, but we need this baseline first.

r? @nikomatsakis cc @oli-obk
2017-09-12 04:14:07 +00:00
Jeremy Soller
914853bbfa Fix tidy checks 2017-09-11 19:46:18 -06:00
bors
11f64d8f88 Auto merge of #43716 - MaloJaffre:_-in-literals, r=petrochenkov
Accept underscores in unicode escapes

Fixes #43692.

I don't know if this need an RFC, but at least the impl is here!
2017-09-12 01:25:23 +00:00