]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAttempt to fix the component manifest problem for rls-preview
Nick Cameron [Tue, 5 Sep 2017 20:28:15 +0000 (08:28 +1200)]
Attempt to fix the component manifest problem for rls-preview

cc #44270

6 years agofix depth for structs
gaurikholkar [Thu, 14 Sep 2017 04:31:12 +0000 (10:01 +0530)]
fix depth for structs

6 years agoadding ui tests
gaurikholkar [Wed, 13 Sep 2017 19:58:43 +0000 (01:28 +0530)]
adding ui tests

6 years agoextend E0623 for earlybound and latebound for structs
gaurikholkar [Wed, 13 Sep 2017 19:34:47 +0000 (01:04 +0530)]
extend E0623 for earlybound and latebound for structs

6 years agoAuto merge of #43972 - TobiasSchaffner:std_clean, r=alexcrichton
bors [Thu, 14 Sep 2017 03:02:58 +0000 (03:02 +0000)]
Auto merge of #43972 - TobiasSchaffner:std_clean, r=alexcrichton

 Add the libstd-modifications needed for the L4Re target

This commit adds the needed modifications to compile the std crate for the L4 Runtime environment (L4Re).

A target for the L4Re was introduced in commit: c151220a84e40b65e45308cc0f3bbea4466d3acf

In many aspects implementations for linux also apply for the L4Re microkernel.

Some uncommon characteristics had to be resolved:
 * L4Re has no network funktionality
 * L4Re has a maximum stacksize of 1Mb for threads
 * L4Re has no uid or gid

Co-authored-by: Sebastian Humenda <sebastian.humenda@tu-dresden.de>
6 years agobring TyCtxt into scope
Douglas Campos [Fri, 8 Sep 2017 02:22:08 +0000 (22:22 -0400)]
bring TyCtxt into scope

6 years agoUpdate compiler-builtins
Tamir Duberstein [Sun, 10 Sep 2017 13:32:14 +0000 (09:32 -0400)]
Update compiler-builtins

Picks up the removal of the rustbuild feature, which is still used
in our local shim, along with a comment update explaining the usage.

6 years agoUse double quotes to appease some TOML parsers
Tamir Duberstein [Tue, 12 Sep 2017 00:17:31 +0000 (20:17 -0400)]
Use double quotes to appease some TOML parsers

6 years agoRemove unneeded `loop`.
Corey Farwell [Thu, 14 Sep 2017 02:44:14 +0000 (22:44 -0400)]
Remove unneeded `loop`.

6 years agoAuto merge of #44484 - tirr-c:issue-44332, r=petrochenkov
bors [Thu, 14 Sep 2017 00:28:27 +0000 (00:28 +0000)]
Auto merge of #44484 - tirr-c:issue-44332, r=petrochenkov

Parse nested closure with two consecutive parameter lists properly

This is a followup of #44332.

---

Currently, in nightly, this does not compile:

```rust
fn main() {
    let f = |_||x, y| x+y;
    println!("{}", f(())(1, 2)); // should print 3
}
```

`|_||x, y| x+y` should be parsed as `|_| (|x, y| x+y)`, but the parser didn't accept `||` between `_` and `x`. This patch fixes the problem.

r? @petrochenkov

6 years agoremove overzealous Box<ZeroSizeType> optimization
Douglas Campos [Wed, 13 Sep 2017 21:48:33 +0000 (17:48 -0400)]
remove overzealous Box<ZeroSizeType> optimization

6 years agoupdate "since" for discriminant_value
Alex Burka [Wed, 13 Sep 2017 21:29:55 +0000 (17:29 -0400)]
update "since" for discriminant_value

It's going to be backported to beta.

6 years agoFix a bug where StorageIgnored had an incorrect buffer length
John Kåre Alsaker [Wed, 13 Sep 2017 21:27:40 +0000 (23:27 +0200)]
Fix a bug where StorageIgnored had an incorrect buffer length

6 years agoFix nits and refactor creation of StorageLive blocks
John Kåre Alsaker [Mon, 11 Sep 2017 16:11:21 +0000 (18:11 +0200)]
Fix nits and refactor creation of StorageLive blocks

6 years agoMake sure we aren't using dead locals
John Kåre Alsaker [Mon, 11 Sep 2017 10:15:35 +0000 (12:15 +0200)]
Make sure we aren't using dead locals

6 years agoAnalyse storage liveness and preserve it during generator transformation
John Kåre Alsaker [Sun, 10 Sep 2017 20:34:56 +0000 (22:34 +0200)]
Analyse storage liveness and preserve it during generator transformation

6 years agoAuto merge of #44516 - gaurikholkar:fns, r=arielb1
bors [Wed, 13 Sep 2017 21:20:19 +0000 (21:20 +0000)]
Auto merge of #44516 - gaurikholkar:fns, r=arielb1

Extend E0623 for fn items

This fixes #44516
The below example now gives
```
error[E0623]: lifetime mismatch
 --> gg.rs:3:10
  |
2 | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
  |                               ---      --- these two types are declared with different lifetimes...
3 |   y.push(z);
  |          ^ ...but data from `z` flows into `y` here

error: aborting due to previous error
```

r? @nikomatsakis
cc @arielb1

6 years agoFix initial review
leonardo.yvens [Wed, 13 Sep 2017 17:21:16 +0000 (14:21 -0300)]
Fix initial review

6 years agofix ui tests
gaurikholkar [Wed, 13 Sep 2017 15:26:27 +0000 (20:56 +0530)]
fix ui tests

6 years agoRefactor fn_trait_kind
leonardo.yvens [Wed, 13 Sep 2017 15:19:37 +0000 (12:19 -0300)]
Refactor fn_trait_kind

Short and sweet

6 years agohonor #[rustc_const_unstable] attributes
Alex Burka [Fri, 8 Sep 2017 18:11:30 +0000 (18:11 +0000)]
honor #[rustc_const_unstable] attributes

6 years agoRefactor how to get a lang item's name
leonardo.yvens [Wed, 13 Sep 2017 15:00:40 +0000 (12:00 -0300)]
Refactor how to get a lang item's name

Small refactorings

6 years agorustc: Spawn `cmd /c emcc.bat` explicitly
Alex Crichton [Wed, 13 Sep 2017 14:41:58 +0000 (07:41 -0700)]
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

6 years agoRemove require_owned_box
leonardo.yvens [Wed, 13 Sep 2017 14:16:45 +0000 (11:16 -0300)]
Remove require_owned_box

It's unused and unnecessary

6 years agoAuto merge of #44129 - pnkfelix:fix-end-region-emission-order, r=nmatsakis
bors [Wed, 13 Sep 2017 13:01:42 +0000 (13:01 +0000)]
Auto merge of #44129 - pnkfelix:fix-end-region-emission-order, r=nmatsakis

Fix end region emission order

Fix #43481

6 years agoAdd note for append method in OpenOptions docs
Guillaume Gomez [Wed, 13 Sep 2017 12:47:50 +0000 (14:47 +0200)]
Add note for append method in OpenOptions docs

6 years agoAdd missing urls for OpenOptions docs
Guillaume Gomez [Wed, 13 Sep 2017 12:46:15 +0000 (14:46 +0200)]
Add missing urls for OpenOptions docs

6 years agoFix example in transmute; add safety requirement to Vec::from_raw_parts
Havvy [Wed, 13 Sep 2017 08:27:41 +0000 (01:27 -0700)]
Fix example in transmute; add safety requirement to Vec::from_raw_parts

6 years agoTest case illustrating some destruction code extent stuff.
Felix S. Klock II [Thu, 31 Aug 2017 11:32:52 +0000 (13:32 +0200)]
Test case illustrating some destruction code extent stuff.

6 years agoUnit test for proper EndRegion emission on a cyclic reference.
Felix S. Klock II [Mon, 28 Aug 2017 11:39:06 +0000 (13:39 +0200)]
Unit test for proper EndRegion emission on a cyclic reference.

6 years agoUpdate mir-opt tests to reflect change to EndRegion emission order.
Felix S. Klock II [Mon, 28 Aug 2017 09:40:37 +0000 (11:40 +0200)]
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).

6 years agoFix issue #43481: emit the EndRegion *before* StorageDeads for a scope.
Felix S. Klock II [Tue, 22 Aug 2017 13:54:57 +0000 (15:54 +0200)]
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.)

6 years agoAuto merge of #44386 - est31:master, r=pnkfelix
bors [Wed, 13 Sep 2017 10:28:33 +0000 (10:28 +0000)]
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

6 years agoMove default stack min size to thread implementations
Tobias Schaffner [Sat, 9 Sep 2017 09:09:34 +0000 (11:09 +0200)]
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.

6 years agoFix drain_filter doctest.
David Adler [Wed, 13 Sep 2017 05:33:27 +0000 (22:33 -0700)]
Fix drain_filter doctest.

6 years agoAuto merge of #44420 - alexcrichton:private-cstore, r=michaelwoerister
bors [Wed, 13 Sep 2017 05:32:00 +0000 (05:32 +0000)]
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)

6 years agoReviewer changes
Nick Cameron [Wed, 13 Sep 2017 04:43:56 +0000 (16:43 +1200)]
Reviewer changes

6 years agoBuild and test Rustfmt
Nick Cameron [Fri, 1 Sep 2017 06:43:00 +0000 (18:43 +1200)]
Build and test Rustfmt

6 years agoAdd rustfmt as a submodule
Nick Cameron [Fri, 1 Sep 2017 05:13:15 +0000 (17:13 +1200)]
Add rustfmt as a submodule

6 years agorustc: Make `CrateStore` private to `TyCtxt`
Alex Crichton [Thu, 7 Sep 2017 20:21:46 +0000 (13:21 -0700)]
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.

6 years agoAuto merge of #44456 - eddyb:stable-drop-const, r=nikomatsakis
bors [Wed, 13 Sep 2017 03:04:49 +0000 (03:04 +0000)]
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

6 years agoRemove Invalid UTF-8 from str::from_utf8_unchecked_mut
Ethan Dagner [Tue, 12 Sep 2017 23:30:44 +0000 (17:30 -0600)]
Remove Invalid UTF-8 from str::from_utf8_unchecked_mut

6 years agobump gcc for bootstrap
QuietMisdreavus [Tue, 12 Sep 2017 23:09:26 +0000 (18:09 -0500)]
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.

6 years agoAuto merge of #44015 - kennytm:hasher, r=alexcrichton
bors [Tue, 12 Sep 2017 21:39:08 +0000 (21:39 +0000)]
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.

6 years agoRemove deprecated lang items
leonardo.yvens [Tue, 12 Sep 2017 20:04:26 +0000 (17:04 -0300)]
Remove deprecated lang items

They have been deprecated for years and there is no trace left of them
in the compiler.

6 years agoFix rendering of const keyword for functions
Guillaume Gomez [Fri, 1 Sep 2017 21:09:11 +0000 (23:09 +0200)]
Fix rendering of const keyword for functions

6 years agoAuto merge of #44133 - vorner:allocator-kind-autodetect, r=alexcrichton
bors [Tue, 12 Sep 2017 18:12:21 +0000 (18:12 +0000)]
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.

6 years agoRemove the `cstore` reference from Session in order to prepare encapsulating CrateSto...
Michael Woerister [Tue, 5 Sep 2017 14:48:24 +0000 (16:48 +0200)]
Remove the `cstore` reference from Session in order to prepare encapsulating CrateStore access in tcx.

6 years agoAdding changes for trait objects
gaurikholkar [Tue, 12 Sep 2017 12:52:22 +0000 (18:22 +0530)]
Adding changes for trait objects

6 years agoAuto merge of #44413 - est31:move_man, r=nikomatsakis
bors [Tue, 12 Sep 2017 12:41:23 +0000 (12:41 +0000)]
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.

6 years agoadd ui test for fn items, tidy fixes
gaurikholkar [Tue, 12 Sep 2017 11:18:01 +0000 (16:48 +0530)]
add ui test for fn items, tidy fixes

6 years agoAdd an example of std::str::encode_utf16
rwakulszowa [Tue, 12 Sep 2017 10:53:16 +0000 (11:53 +0100)]
Add an example of std::str::encode_utf16

Closes #44419

6 years agoAuto merge of #44344 - jonhoo:entry_or_default, r=BurntSushi
bors [Tue, 12 Sep 2017 09:54:59 +0000 (09:54 +0000)]
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)`.

6 years agoDisable the new Hasher tests on Emscripten.
kennytm [Sun, 10 Sep 2017 16:13:19 +0000 (00:13 +0800)]
Disable the new Hasher tests on Emscripten.

6 years agoimpl Hasher for {&mut Hasher, Box<Hasher>}
kennytm [Mon, 21 Aug 2017 14:15:02 +0000 (22:15 +0800)]
impl Hasher for {&mut Hasher, Box<Hasher>}

6 years agoAuto merge of #44310 - ldr709:master, r=BurntSushi
bors [Tue, 12 Sep 2017 07:13:40 +0000 (07:13 +0000)]
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.

6 years agofixes
gaurikholkar [Mon, 11 Sep 2017 19:04:52 +0000 (00:34 +0530)]
fixes

6 years agocorrect depth initialisation
gaurikholkar [Mon, 11 Sep 2017 18:28:29 +0000 (23:58 +0530)]
correct depth initialisation

6 years agoadd logs
gaurikholkar [Tue, 15 Aug 2017 16:46:29 +0000 (22:16 +0530)]
add logs

6 years agoextend E0623 for fns
gaurikholkar [Tue, 15 Aug 2017 04:51:31 +0000 (10:21 +0530)]
extend E0623 for fns

6 years agoAdding E0623 for structs
gaurikholkar [Sat, 5 Aug 2017 22:39:43 +0000 (04:09 +0530)]
Adding E0623 for structs

6 years agoAuto merge of #44275 - eddyb:deferred-ctfe, r=nikomatsakis
bors [Tue, 12 Sep 2017 04:14:07 +0000 (04:14 +0000)]
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

6 years agoAuto merge of #43716 - MaloJaffre:_-in-literals, r=petrochenkov
bors [Tue, 12 Sep 2017 01:25:23 +0000 (01:25 +0000)]
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!

6 years agorustdoc: extend UdpSocket API doc (#657)
Frank Rehberger [Wed, 6 Sep 2017 22:54:28 +0000 (00:54 +0200)]
rustdoc: extend UdpSocket API doc (#657)

rustdoc: type-fixes

6 years agoAuto merge of #44498 - alexcrichton:fix-nightlies, r=alexcrichton
bors [Mon, 11 Sep 2017 22:49:20 +0000 (22:49 +0000)]
Auto merge of #44498 - alexcrichton:fix-nightlies, r=alexcrichton

rustbuild: Fix a distribution bug with rustdoc

Apparently `File::create` was called when there was an existing hard link or the
like, causing an existing file to get accidentally truncated!

Closes #44487

6 years agoAdd arrow and improve display
Guillaume Gomez [Sat, 9 Sep 2017 13:33:57 +0000 (15:33 +0200)]
Add arrow and improve display

6 years agoadd test
Guillaume Gomez [Thu, 7 Sep 2017 20:06:40 +0000 (22:06 +0200)]
add test

6 years agoAdd class for codeblocks
Guillaume Gomez [Wed, 6 Sep 2017 22:08:39 +0000 (00:08 +0200)]
Add class for codeblocks

6 years agoAuto merge of #44442 - Aaron1011:promote-static-ref, r=eddyb
bors [Mon, 11 Sep 2017 20:02:19 +0000 (20:02 +0000)]
Auto merge of #44442 - Aaron1011:promote-static-ref, r=eddyb

Fix regression in promotion of rvalues referencing a static

This commit makes librustc_passes::consts::CheckCrateVisitor properly
mark expressions as promotable if they reference a static, as it's
perfectly fine for one static to reference another. It fixes a
regression that prevented a temporary rvalue from referencing a static
if it was itself declared within a static.

Prior to commit https://github.com/rust-lang/rust/commit/b8c05fe90bc,
`region::ScopeTree` would only register a 'terminating scope' for function
bodies. Thus, while rvalues in a static that referenced a static would be marked
unpromotable, the lack of enclosing scope would cause
mem_categorization::MemCategorizationContext::cat_rvalue_node
to compute a 'temporary scope' of `ReStatic`. Since this had the same
effect as explicitly selecting a scope of `ReStatic`
due to the rvalue being marked by CheckCrateVisitor as promotable,
no issue occurred.

However, commit https://github.com/rust-lang/rust/commit/b8c05fe90bc
made ScopeTree unconditionally register a 'terminating scope'
Since mem_categorization would now compute a non-static 'temporary scope', the
aforementioned rvalues would be erroneously marked as living for too
short a time.

By fixing the behavior of CheckCrateVisitor, this commit avoids changing
mem_categorization's behavior, while ensuring that temporary values in
statics are still allowed to reference other statics.

Fixes issue #44373

6 years agorustbuild: Fix a distribution bug with rustdoc
Alex Crichton [Mon, 11 Sep 2017 18:01:48 +0000 (11:01 -0700)]
rustbuild: Fix a distribution bug with rustdoc

Apparently `File::create` was called when there was an existing hard link or the
like, causing an existing file to get accidentally truncated!

Closes #44487

6 years agoAdd doc example to str::from_boxed_utf8_unchecked
Tommy Ip [Mon, 11 Sep 2017 16:28:28 +0000 (17:28 +0100)]
Add doc example to str::from_boxed_utf8_unchecked

Fixes #44463.

6 years agoupdate mdbook
steveklabnik [Mon, 11 Sep 2017 15:55:07 +0000 (11:55 -0400)]
update mdbook

6 years agoAuto merge of #44435 - alexcrichton:in-scope, r=michaelwoerister
bors [Mon, 11 Sep 2017 15:35:35 +0000 (15:35 +0000)]
Auto merge of #44435 - alexcrichton:in-scope, r=michaelwoerister

rustc: Remove HirId from queries

This'll allow us to reconstruct query parameters purely from the `DepNode`
they're associated with.

Closes #44414

6 years agorustc: Remove HirId from queries
Alex Crichton [Fri, 8 Sep 2017 20:51:57 +0000 (13:51 -0700)]
rustc: Remove HirId from queries

This'll allow us to reconstruct query parameters purely from the `DepNode`
they're associated with. Some queries could move straight to `HirId` but others
that don't always have a correspondance between `HirId` and `DefId` moved to
two-level maps where the query operates over a `DefIndex`, returning a map,
which is then keyed off `ItemLocalId`.

Closes #44414

6 years agoUpdate comment to properly describe static promotion restrictions
Aaron Hill [Mon, 11 Sep 2017 14:51:28 +0000 (10:51 -0400)]
Update comment to properly describe static promotion restrictions

6 years agoAuto merge of #44440 - cuviper:min_global_align, r=japaric
bors [Mon, 11 Sep 2017 12:53:21 +0000 (12:53 +0000)]
Auto merge of #44440 - cuviper:min_global_align, r=japaric

Add `TargetOptions::min_global_align`, with s390x at 16-bit

The SystemZ `LALR` instruction provides PC-relative addressing for globals,
but only to *even* addresses, so other compilers make sure that such
globals are always 2-byte aligned.  In Clang, this is modeled with
`TargetInfo::MinGlobalAlign`, and `TargetOptions::min_global_align` now
serves the same purpose for rustc.

In Clang, the only targets that set this are SystemZ, Lanai, and NVPTX, and
the latter two don't have targets in rust master.

Fixes #44411.
r? @eddyb

6 years agoAuto merge of #44410 - alexcrichton:fix-travis, r=Mark-Simulacrum
bors [Mon, 11 Sep 2017 09:47:06 +0000 (09:47 +0000)]
Auto merge of #44410 - alexcrichton:fix-travis, r=Mark-Simulacrum

Fix sanitizer tests on buggy kernels

Travis recently pushed an update to the Linux environments, namely the kernels
that we're running on. This in turn caused some of the sanitizer tests we run to
fail. We also apparently weren't the first to hit these failures! Detailed in
google/sanitizers#837 these tests were failing due to a specific commit in the
kernel which has since been backed out, but for now work around the buggy kernel
that's deployed on Travis and eventually we should be able to remove these
flags.

6 years agoAuto merge of #44385 - alexcrichton:new-sccache-keys, r=alexcrichton
bors [Mon, 11 Sep 2017 07:18:27 +0000 (07:18 +0000)]
Auto merge of #44385 - alexcrichton:new-sccache-keys, r=alexcrichton

Rotate Travis/AppVeyor S3 keys

Haven't done this in awhile so seems like a good idea!

6 years agoRemoved trailing whitespace
42triangles [Mon, 11 Sep 2017 06:28:14 +0000 (08:28 +0200)]
Removed trailing whitespace

6 years agoAdded an example for `std::str::into_boxed_bytes()`
42triangles [Mon, 11 Sep 2017 06:13:57 +0000 (08:13 +0200)]
Added an example for `std::str::into_boxed_bytes()`

6 years agorustc: use ConstVal::Unevaluated instead of mir::Literal::Item.
Eduard-Mihai Burtescu [Sun, 3 Sep 2017 17:34:48 +0000 (20:34 +0300)]
rustc: use ConstVal::Unevaluated instead of mir::Literal::Item.

6 years agorustc: evaluate fixed-length array length expressions lazily.
Eduard-Mihai Burtescu [Mon, 7 Aug 2017 05:08:53 +0000 (08:08 +0300)]
rustc: evaluate fixed-length array length expressions lazily.

6 years agorustc: remove obsolete const_val::ErrKind::{Negate,Not}On.
Eduard-Mihai Burtescu [Tue, 15 Aug 2017 15:35:31 +0000 (18:35 +0300)]
rustc: remove obsolete const_val::ErrKind::{Negate,Not}On.

6 years agorustc: use ty::Const for the length of TyArray.
Eduard-Mihai Burtescu [Sat, 5 Aug 2017 13:11:24 +0000 (16:11 +0300)]
rustc: use ty::Const for the length of TyArray.

6 years agorustc: replace usize with u64 and ConstUsize.
Eduard-Mihai Burtescu [Sat, 5 Aug 2017 09:27:28 +0000 (12:27 +0300)]
rustc: replace usize with u64 and ConstUsize.

6 years agorustc: introduce ty::Const { ConstVal, Ty }.
Eduard-Mihai Burtescu [Fri, 4 Aug 2017 08:25:13 +0000 (11:25 +0300)]
rustc: introduce ty::Const { ConstVal, Ty }.

6 years agorustc: intern ConstVal's in TyCtxt.
Eduard-Mihai Burtescu [Thu, 3 Aug 2017 21:41:44 +0000 (00:41 +0300)]
rustc: intern ConstVal's in TyCtxt.

6 years agoAuto merge of #44383 - qmx:gh/40473/no-inline-trait-method, r=nikomatsakis
bors [Mon, 11 Sep 2017 04:59:28 +0000 (04:59 +0000)]
Auto merge of #44383 - qmx:gh/40473/no-inline-trait-method, r=nikomatsakis

MIR: should not inline trait method

Fixes #40473.

The idea here is bailing out of inlining if we're talking about a trait method.

6 years agoAuto merge of #44375 - topecongiro:macrodef-span, r=petrochenkov
bors [Mon, 11 Sep 2017 02:23:24 +0000 (02:23 +0000)]
Auto merge of #44375 - topecongiro:macrodef-span, r=petrochenkov

Add visibility to span for macros 2.0

cc https://github.com/rust-lang-nursery/rustfmt/issues/1949.
r? @nrc

6 years agoAuto merge of #44316 - eddyb:no-local-var-def-id, r=michaelwoerister
bors [Sun, 10 Sep 2017 21:55:43 +0000 (21:55 +0000)]
Auto merge of #44316 - eddyb:no-local-var-def-id, r=michaelwoerister

Use NodeId/HirId instead of DefId for local variables.

r? @michaelwoerister

6 years agoimplement unsafe pointer methods
Alexis Beingessner [Thu, 17 Aug 2017 21:45:01 +0000 (17:45 -0400)]
implement unsafe pointer methods

6 years agoAuto merge of #44220 - kennytm:fix-44216-instance-plus-max-duration-should-panic...
bors [Sun, 10 Sep 2017 18:37:27 +0000 (18:37 +0000)]
Auto merge of #44220 - kennytm:fix-44216-instance-plus-max-duration-should-panic, r=alexcrichton

Properly detect overflow in Instance ± Duration.

Fix #44216.
Fix #42622

The computation `Instant::now() + Duration::from_secs(u64::max_value())` now panics. The call `receiver.recv_timeout(Duration::from_secs(u64::max_value()))`, which involves such time addition, will also panic.

The reason #44216 arises is because of an unchecked cast from `u64` to `i64`, making the duration equivalent to -1 second.

Note that the current implementation is over-conservative, since e.g. (-2⁶²) + (2⁶³) is perfectly fine for an `i64`, yet this is rejected because (2⁶³) overflows the `i64`.

6 years agoAdd doc examples to str::from_utf8_unchecked_mut
Ethan Dagner [Sun, 10 Sep 2017 18:27:57 +0000 (12:27 -0600)]
Add doc examples to str::from_utf8_unchecked_mut

Fixes #44461

6 years agoAutodetect the type of allocator crate used
Michal 'vorner' Vaner [Sun, 10 Sep 2017 17:59:42 +0000 (19:59 +0200)]
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.

6 years agoAdd explanations for undocumented labels
Carol (Nichols || Goulding) [Sun, 10 Sep 2017 17:31:08 +0000 (13:31 -0400)]
Add explanations for undocumented labels

6 years agoAlphabetize current label explanations
Carol (Nichols || Goulding) [Sun, 10 Sep 2017 17:21:37 +0000 (13:21 -0400)]
Alphabetize current label explanations

So that you can scroll down the list of labels along with these
explanations.

6 years agoParse nested closure with two consecutive parameter lists properly
Wonwoo Choi [Thu, 7 Sep 2017 06:07:49 +0000 (15:07 +0900)]
Parse nested closure with two consecutive parameter lists properly

6 years agoAuto merge of #44079 - gaurikholkar:named_conf, r=nikomatsakis
bors [Sun, 10 Sep 2017 15:32:20 +0000 (15:32 +0000)]
Auto merge of #44079 - gaurikholkar:named_conf, r=nikomatsakis

Extend E0623 for LateBound and EarlyBound Regions

This is a fix for #43882
```
fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) {
    x.push(y);
}
```
now gives

```
error[E0623]: lifetime mismatch
  --> $DIR/ex3-both-anon-regions-latebound-regions.rs:12:12
   |
11 | fn foo<'a,'b>(x: &mut Vec<&'a u8>, y: &'b u8) {
   |                           ------      ------ these two types are declared with different lifetimes...
12 |     x.push(y);
   |            ^ ...but data from `y` flows into `x` here
```
cc @nikomatsakis @arielb1

Please ignore the second commit. It will be merged in a separate PR.

6 years agoActually fix the trailing whitespace
smt923 [Sun, 10 Sep 2017 13:25:23 +0000 (14:25 +0100)]
Actually fix the trailing whitespace

6 years agoFix markdown link for Utf8Error
smt923 [Sun, 10 Sep 2017 13:12:23 +0000 (14:12 +0100)]
Fix markdown link for Utf8Error