Commit Graph

68034 Commits

Author SHA1 Message Date
Nikolai Vazquez
48c20b6a50 Remove mem::transmute used in Path conversions 2017-09-28 10:29:58 -04:00
Nikolai Vazquez
627998e86f Remove unused 'mem' import in 'os_str' module 2017-09-28 08:43:06 -04:00
Nikolai Vazquez
33eaa94f90 Remove mem::transmute used in OsStr conversions 2017-09-28 08:07:49 -04:00
Nikolai Vazquez
755fd29b60 Fix mutability error in CString::from_raw 2017-09-28 07:56:35 -04:00
Nikolai Vazquez
6d14512fd9 Remove mem::transmute used in CStr conversions 2017-09-28 00:51:38 -04:00
Nikolai Vazquez
36d663fcfc Remove mem::transmute used in Box<str> conversions 2017-09-27 14:56:20 -04:00
bors
930d3b17dd Auto merge of #44741 - qmx:trans_fulfill_obligation_should_not_crash, r=nikomatsakis
use param_env on the trait_cache key

We bailed from making trans_fulfill_obligation return `Option` or `Result`, just made it less prone to crashing outside trans

r? @nikomatsakis
2017-09-26 18:29:57 +00:00
bors
1c4510adc8 Auto merge of #44736 - pnkfelix:mir-borrowck4, r=arielb1
Some fixes to mir-borrowck

Make the code more closely match the NLL RFC (updated description).

(The biggest visible fix the addition of the Shallow/Deep distinction, which means mir-borrowck stops falsely thinking that StorageDeads need deep access to their input L-value.)
2017-09-26 09:19:03 +00:00
bors
4b8bf391fd Auto merge of #44735 - tirr-c:issue-42143, r=arielb1
Friendlier error message for closure argument type mismatch

Rebased #42270.
Fixes #42143.

---

`test.rs`:

```rust
fn main() {
    foo(|_: i32, _: usize| ());
}

fn foo<F>(_: F) where F: Fn(&str, usize) {}
```

Before:

```
error[E0281]: type mismatch: `[closure@test.rs:2:9: 2:30]` implements the trait `std::ops::Fn<(i32, usize)>`, but the trait `for<'r> std::ops::Fn<(&'r str, usize)>` is required
 --> test.rs:2:5
  |
2 |     foo(|_: i32, _: usize| ());
  |     ^^^ --------------------- implements `std::ops::Fn<(i32, usize)>`
  |     |
  |     expected &str, found i32
  |     requires `for<'r> std::ops::Fn<(&'r str, usize)>`
  |
  = note: required by `foo`
```

After (early):

```
error[E0631]: type mismatch in closure arguments
 --> test.rs:2:5
  |
2 |     foo(|_: i32, _: usize| ());
  |     ^^^ --------------------- takes arguments of type `i32` and `usize`
  |     |
  |     expected arguments of type `&str` and `usize`
  |
  = note: required by `foo`
```

After (current):

```
error[E0631]: type mismatch in closure arguments
 --> test.rs:2:5
  |
2 |     foo(|_: i32, _: usize| ());
  |     ^^^ --------------------- found signature of `fn(i32, usize) -> _`
  |     |
  |     expected signature of `for<'r> fn(&'r str, usize) -> _`
  |
  = note: required by `foo`
```

~~Compiler output has been changed, and a few tests are failing. Help me writing/fixing tests!~~

r? @nikomatsakis
2017-09-26 05:02:03 +00:00
bors
82ae9682ca Auto merge of #44297 - laumann:suggest-misspelt-methods, r=arielb1
Add suggestions for misspelled method names

Use the syntax::util::lev_distance module to provide suggestions when a
named method cannot be found.

Part of #30197
2017-09-25 23:09:06 +00:00
bors
6c476ce462 Auto merge of #44279 - smaeul:crt_static-deps, r=alexcrichton
Require rlibs for dependent crates when linking static executables

This handles the case for `CrateTypeExecutable` and `+crt_static`. I reworked the match block to avoid duplicating the `attempt_static` and error checking code again (this case would have been a copy of the `CrateTypeCdylib`/`CrateTypeStaticlib` case).

On `linux-musl` targets where `std` was built with `crt_static = false` in `config.toml`, this change brings the test suite from entirely failing to mostly passing.

This change should not affect behavior for other crate types, or for targets which do not respect `+crt_static`.
2017-09-25 20:37:02 +00:00
bors
3df1f7b82d Auto merge of #44085 - bjorn3:no_llvm_write_metadata, r=arielb1
Allow writing metadata without llvm

# Todo:

* [x] Rebase
* [x] Fix eventual errors
* [x] <strike>Find some crate to write elf files</strike> (will do it later)

Cc #43842
2017-09-25 18:05:22 +00:00
Douglas Campos
9d52cb2f84 those changes break miri, PR will be issued later 2017-09-25 09:51:51 -04:00
Douglas Campos
043d873b32 fix tidy errors 2017-09-25 09:50:37 -04:00
Douglas Campos
119882eaa5 add comment per @nikomatsakis request 2017-09-25 09:50:37 -04:00
Douglas Campos
c900abf42d expose ParamEnv as a param 2017-09-25 09:50:37 -04:00
Douglas Campos
77d3ca1bad add ParamEnv to the trait_cache key 2017-09-25 09:50:37 -04:00
bors
91dbf52af3 Auto merge of #44809 - arielb1:small-scope, r=eddyb
encode region::Scope using fewer bytes

Now that region::Scope is no longer interned, its size is more important. This PR encodes region::Scope in 8 bytes instead of 12, which should speed up region inference somewhat (perf testing needed) and should improve the margins on #36799 by 64MB (that's not a lot, I did this PR mostly to speed up region inference).

This is a perf-sensitive PR. Please don't roll me up.

r? @eddyb

This is based on  #44743 so I could get more accurate measurements on #36799.
2017-09-25 12:52:02 +00:00
Felix S. Klock II
e319f4093c Remove now dead code. 2017-09-25 14:02:39 +02:00
Felix S. Klock II
d9d10c1628 Make mir-borrowck more closely match (draft) NLL RFC.
In particular:

 * introduce the shallow/deep distinction for read/write accesses

 * use the notions of prefixes, shallow prefixes, and supporting prefixes
   rather than trying to recreate the restricted sets from ast-borrowck.

 * Add shallow reads of Discriminant and ArrayLength, and treat them
   as artificial fields when doing prefix traversals.
2017-09-25 14:02:34 +02:00
Felix S. Klock II
c4c32b24bd More fine-grained delineation for mir-borrowck errors. 2017-09-25 13:02:17 +02:00
Ariel Ben-Yehuda
7bb0923e46 fix Debug impls 2017-09-25 13:47:19 +03:00
bors
dcb4378e18 Auto merge of #44646 - petrochenkov:scompress, r=michaelwoerister
Compress most of spans to 32 bits

As described in https://internals.rust-lang.org/t/rfc-compiler-refactoring-spans/1357/28

Closes https://github.com/rust-lang/rust/issues/15594
r? @michaelwoerister
2017-09-25 09:01:53 +00:00
bjorn3
843cd5bacc Fix error 2017-09-25 08:17:37 +02:00
bors
cd93969ec4 Auto merge of #44612 - pylaligand:magenta-to-zircon, r=alexcrichton
The Magenta kernel is now called Zircon.
2017-09-25 05:05:14 +00:00
James Tucker
a3aef1aa95 Fix fuchsia toolchain prebuild setup
* Adjust bootstrap to provide useful output on failure
 * Add missing package dependencies in the build environment
 * Fix permission bits on prebuilt toolchain files
2017-09-24 21:32:27 -07:00
bors
7a9cdc4c2a Auto merge of #44700 - arielb1:mir-effectck, r=nikomatsakis
Move effect-checking to MIR

This allows emitting lints from MIR and moves the effect-checking pass to work on it.

I'll make `repr(packed)` misuse unsafe in a separate PR.

r? @eddyb
2017-09-25 00:52:15 +00:00
James Tucker
d7a17fb3cf LP_CLONE_FDIO_ROOT is now LP_CLONE_FDIO_NAMESPACE 2017-09-24 14:31:50 -07:00
James Tucker
c481f85dc2 ensure that prebuilt toolchain binaries are +x 2017-09-24 13:55:55 -07:00
Petr Hosek
992e94ab3b Re-add CMake package
This appears to be needed by the Rust build.
2017-09-24 13:55:55 -07:00
Petr Hosek
1fdbfa9930 Use Zircon's Clang rather than building our own
This toolchain is already used to build Zircon itself and is the
official Clang toolchain used by all Fuchsia developers.
2017-09-24 13:55:55 -07:00
James Tucker
0ef87cc109 bump liblibc to 0.2.31 2017-09-24 13:53:11 -07:00
Petr Hosek
850c7cbbf1 Download clang-tools-extra as well 2017-09-24 13:53:10 -07:00
Petr Hosek
6c08208c31 Install unzip into Fuchsia Docker container 2017-09-24 13:53:10 -07:00
P.Y. Laligand
e98e674570 TODO --> FIXME 2017-09-24 13:53:10 -07:00
P.Y. Laligand
d0ff222d0f Update submodules. 2017-09-24 13:53:10 -07:00
Petr Hosek
ae0cf7fd5f Update Fuchsia toolchain build
compiler-rt is now being built as part of the toolchain itself.
2017-09-24 13:53:10 -07:00
P.Y. Laligand
20265ef3ac Updated Zircon version. 2017-09-24 13:53:10 -07:00
P.Y. Laligand
cc4e82fe7a Fixed casing issues. 2017-09-24 13:53:10 -07:00
P.Y. Laligand
de3bb916d8 Testing on Travis. 2017-09-24 13:53:10 -07:00
P.Y. Laligand
43cff131dd The Magenta kernel is now called Zircon. 2017-09-24 13:53:10 -07:00
bors
48c1c548e1 Auto merge of #44758 - arielb1:a-small-path, r=eddyb
put empty generic lists behind a pointer

This reduces the size of hir::Expr from 128 to 88 bytes (!) and shaves
200MB out of #36799.

This is a performance-sensitive PR so please don't roll it up.

r? @eddyb
2017-09-24 19:48:11 +00:00
Thomas Jespersen
4963394f86 Change Levensthein-based method to a single suggestion
The convention for suggesting close matches is to provide at most one match (the
closest one). Change the suggestions for misspelt method names to obey that.
2017-09-24 20:00:02 +02:00
bors
1ed7d41d88 Auto merge of #44743 - arielb1:size-rollback, r=eddyb
typeck::check::coercion - roll back failed unsizing type vars

This wraps unsizing coercions within an additional level of
`commit_if_ok`, which rolls back type variables if the unsizing coercion
fails. This prevents a large amount of type-variables from accumulating
while type-checking a large function, e.g. shaving 2GB off one of the
4GB peaks in #36799.

This is a performance-sensitive PR so please don't roll it up.

r? @eddyb
cc @nikomatsakis
2017-09-24 15:41:13 +00:00
Ariel Ben-Yehuda
c10b23e2e0 encode region::Scope using fewer bytes
Now that region::Scope is no longer interned, its size is more
important. This PR encodes region::Scope in 8 bytes instead of 12, which
should speed up region inference somewhat (perf testing needed) and
should improve the margins on #36799 by 64MB (that's not a lot, I did
this PR mostly to speed up region inference).
2017-09-24 17:21:37 +03:00
Ariel Ben-Yehuda
8214ab1662 move Scope behind an enum 2017-09-24 16:13:54 +03:00
bors
647aecc281 Auto merge of #44807 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 4 pull requests

- Successful merges: #44103, #44625, #44789, #44795
- Failed merges:
2017-09-24 12:20:21 +00:00
Guillaume Gomez
a8a0ec2a28 Rollup merge of #44795 - KiChjang:mir-err-notes, r=arielb1
MIR borrowck: Add span labels for E0381 and E0505

Corresponds to `report_use_of_moved` and `report_move_out_when_borrowed`.

Part of #44596.
2017-09-24 14:01:52 +02:00
Guillaume Gomez
4e377081ca Rollup merge of #44789 - GuillaumeGomez:fix-rustdoc-display, r=QuietMisdreavus
Fix warning position in rustdoc code blocks

Before:

<img width="1440" alt="screen shot 2017-09-23 at 14 07 08" src="https://user-images.githubusercontent.com/3050060/30773382-b9649288-a06f-11e7-94ec-faa3c3ed999b.png">

After:

<img width="1440" alt="screen shot 2017-09-23 at 14 58 31" src="https://user-images.githubusercontent.com/3050060/30773384-bdfc9f3e-a06f-11e7-9030-9fb8a5308668.png">

r? @QuietMisdreavus
2017-09-24 14:01:51 +02:00
Guillaume Gomez
b1a1861d60 Rollup merge of #44625 - frewsxcv:frewsxcv-raii-stdin, r=QuietMisdreavus
Indicate how ChildStd{in,out,err} FDs are closed.

Fixes https://github.com/rust-lang/rust/issues/41452.
2017-09-24 14:01:50 +02:00