]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agocorrect the new graphs resulting from various tests
Niko Matsakis [Tue, 2 May 2017 21:47:38 +0000 (17:47 -0400)]
correct the new graphs resulting from various tests

(Now that variances are not part of signature.)

7 years agoallow dep-graph assertions on fields
Niko Matsakis [Tue, 25 Apr 2017 13:08:21 +0000 (09:08 -0400)]
allow dep-graph assertions on fields

7 years agoallow tests to refer to `ItemVariances`
Niko Matsakis [Tue, 25 Apr 2017 09:46:29 +0000 (05:46 -0400)]
allow tests to refer to `ItemVariances`

7 years agoadd back variance testing mechanism
Niko Matsakis [Tue, 25 Apr 2017 09:45:59 +0000 (05:45 -0400)]
add back variance testing mechanism

make it work for traits etc uniformly

7 years agokill the old `visit_all_item_likes` infrastructure
Niko Matsakis [Tue, 2 May 2017 15:22:03 +0000 (11:22 -0400)]
kill the old `visit_all_item_likes` infrastructure

7 years agofactor variances into a proper query
Niko Matsakis [Mon, 24 Apr 2017 15:15:12 +0000 (11:15 -0400)]
factor variances into a proper query

There are now two queries: crate and item. The crate one computes the
variance of all items in the crate; it is sort of an implementation
detail, and not meant to be used. The item one reads from the crate one,
synthesizing correct deps in lieu of the red-green algorithm.

At the same time, remove the `variance_computed` flag, which was a
horrible hack used to force invariance early on (e.g. when type-checking
constants). This is only needed because of trait applications, and
traits are always invariant anyway. Therefore, we now change to take
advantage of the query system:

- When asked to compute variances for a trait, just return a vector
  saying 'all invariant'.
- Remove the corresponding "inferreds" from traits, and tweak the
  constraint generation code to understand that traits are always
  inferred.

7 years agotrack `CurrentItem`, not just `Generics`
Niko Matsakis [Sun, 23 Apr 2017 09:44:02 +0000 (05:44 -0400)]
track `CurrentItem`, not just `Generics`

7 years agomake transitive relation use a hash map
Niko Matsakis [Sun, 23 Apr 2017 09:14:10 +0000 (05:14 -0400)]
make transitive relation use a hash map

7 years agoadd FIXME to `Steal`
Niko Matsakis [Tue, 2 May 2017 17:59:15 +0000 (13:59 -0400)]
add FIXME to `Steal`

7 years agoremove `mir_passes` from `Session` and add a FIXME
Niko Matsakis [Tue, 2 May 2017 17:58:49 +0000 (13:58 -0400)]
remove `mir_passes` from `Session` and add a FIXME

7 years agofix librustc_driver
Niko Matsakis [Tue, 2 May 2017 15:31:10 +0000 (11:31 -0400)]
fix librustc_driver

7 years agohave borrowck fetch MIR, which will perform some errors
Niko Matsakis [Tue, 2 May 2017 13:52:12 +0000 (09:52 -0400)]
have borrowck fetch MIR, which will perform some errors

7 years agoremove temporary variable
Niko Matsakis [Tue, 2 May 2017 10:34:29 +0000 (06:34 -0400)]
remove temporary variable

7 years agoupdate comment about heuristics
Niko Matsakis [Tue, 2 May 2017 10:33:11 +0000 (06:33 -0400)]
update comment about heuristics

7 years agomove queries code into transform
Niko Matsakis [Tue, 2 May 2017 10:32:03 +0000 (06:32 -0400)]
move queries code into transform

7 years agorename from `item_mir` to `optimized_mir`
Niko Matsakis [Tue, 2 May 2017 10:08:13 +0000 (06:08 -0400)]
rename from `item_mir` to `optimized_mir`

7 years agorun MIR borrowck on the validated, not optimized, MIR
Niko Matsakis [Tue, 2 May 2017 10:07:54 +0000 (06:07 -0400)]
run MIR borrowck on the validated, not optimized, MIR

7 years agodelete dead code
Niko Matsakis [Mon, 1 May 2017 22:44:25 +0000 (18:44 -0400)]
delete dead code

7 years agopacify the mercilous tidy
Niko Matsakis [Mon, 1 May 2017 22:43:46 +0000 (18:43 -0400)]
pacify the mercilous tidy

7 years agoremove irrelevant comments
Niko Matsakis [Mon, 1 May 2017 21:17:44 +0000 (17:17 -0400)]
remove irrelevant comments

7 years agosupport inlining by asking for optimizer mir for callees
Niko Matsakis [Mon, 1 May 2017 20:03:05 +0000 (16:03 -0400)]
support inlining by asking for optimizer mir for callees

I tested this with it enabled 100% of the time, and we were able to run
mir-opt tests successfully.

7 years agosimplify down to one query per pass suite
Niko Matsakis [Mon, 1 May 2017 18:39:48 +0000 (14:39 -0400)]
simplify down to one query per pass suite

7 years agorip out everything but `MirPass`, move the logic into suites
Niko Matsakis [Mon, 1 May 2017 17:46:35 +0000 (13:46 -0400)]
rip out everything but `MirPass`, move the logic into suites

7 years agoremove `Pass` and (temporarily) drop `Inline`
Niko Matsakis [Mon, 1 May 2017 16:47:00 +0000 (12:47 -0400)]
remove `Pass` and (temporarily) drop `Inline`

7 years agomove `build_mir` into `build` directory
Niko Matsakis [Tue, 2 May 2017 18:56:26 +0000 (14:56 -0400)]
move `build_mir` into `build` directory

7 years agoadjust privacy of various types in `build`
Niko Matsakis [Mon, 1 May 2017 15:58:05 +0000 (11:58 -0400)]
adjust privacy of various types in `build`

7 years agorename `mir_map` to `queries` and remove `build_mir_for_crate`
Niko Matsakis [Mon, 1 May 2017 15:23:53 +0000 (11:23 -0400)]
rename `mir_map` to `queries` and remove `build_mir_for_crate`

7 years agoadd a README describing the whole design
Niko Matsakis [Sat, 29 Apr 2017 09:28:35 +0000 (05:28 -0400)]
add a README describing the whole design

7 years agouse `force` to ensure const-qualif has been done, not read
Niko Matsakis [Sat, 29 Apr 2017 09:28:14 +0000 (05:28 -0400)]
use `force` to ensure const-qualif has been done, not read

7 years agoadd comments to `Steal` and use `bug!`
Niko Matsakis [Sat, 29 Apr 2017 08:36:55 +0000 (04:36 -0400)]
add comments to `Steal` and use `bug!`

7 years agoconvert the `inline` pass to use the new multi result
Niko Matsakis [Fri, 28 Apr 2017 23:29:16 +0000 (19:29 -0400)]
convert the `inline` pass to use the new multi result

This involves changing various details about that system,
though the basic shape remains the same.

7 years agoadjust the macro to allow for `multi` modifier
Niko Matsakis [Fri, 28 Apr 2017 16:09:15 +0000 (12:09 -0400)]
adjust the macro to allow for `multi` modifier

7 years agointroduce `IntoKeyValues` trait to prepare for multi-queries
Niko Matsakis [Fri, 28 Apr 2017 13:41:01 +0000 (09:41 -0400)]
introduce `IntoKeyValues` trait to prepare for multi-queries

The idea is that such queries will return `FxHashMap`

7 years agorework macro to prepare for more modifiers than just `[pub]`
Niko Matsakis [Fri, 28 Apr 2017 13:40:48 +0000 (09:40 -0400)]
rework macro to prepare for more modifiers than just `[pub]`

7 years agointroduce idea of "stealable" MIR
Niko Matsakis [Fri, 28 Apr 2017 10:00:48 +0000 (06:00 -0400)]
introduce idea of "stealable" MIR

This is a more principled version of the `RefCell` we were using
before. We now allocate a `Steal<Mir<'tcx>>` for each intermediate MIR
pass; when the next pass steals the entry, any later attempts to use it
will panic (there is no way to *test* if MIR is stolen, you're just
supposed to *know*).

7 years agorename `MirPassSet` to `MirSuite`
Niko Matsakis [Fri, 28 Apr 2017 08:49:09 +0000 (04:49 -0400)]
rename `MirPassSet` to `MirSuite`

This seems like a better noun.

7 years agoretool MIR passes completely
Niko Matsakis [Thu, 27 Apr 2017 20:48:48 +0000 (16:48 -0400)]
retool MIR passes completely

The new setup is as follows. There is a pipeline of MIR passes that each
run **per def-id** to optimize a particular function. You are intended
to request MIR at whatever stage you need it. At the moment, there is
only one stage you can request:

- `optimized_mir(def_id)`

This yields the final product. Internally, it pulls the MIR for the
given def-id through a series of steps. Right now, these are still using
an "interned ref-cell" but they are intended to "steal" from one
another:

- `mir_build` -- performs the initial construction for local MIR
- `mir_pass_set` -- performs a suite of optimizations and transformations
- `mir_pass` -- an individual optimization within a suite

So, to construct the optimized MIR, we invoke:

    mir_pass_set((MIR_OPTIMIZED, def_id))

which will build up the final MIR.

7 years agomove to only def-id passes
Niko Matsakis [Thu, 27 Apr 2017 17:16:57 +0000 (13:16 -0400)]
move to only def-id passes

this temporary disables `inline`

7 years agorewrite `Passes` to have sets of passes
Niko Matsakis [Thu, 27 Apr 2017 17:04:57 +0000 (13:04 -0400)]
rewrite `Passes` to have sets of passes

Also, store the completed set of passes in the tcx.

7 years agointroduce `DefIdPass` and remove all impls of `Pass` but `Inline`
Niko Matsakis [Thu, 27 Apr 2017 15:46:17 +0000 (11:46 -0400)]
introduce `DefIdPass` and remove all impls of `Pass` but `Inline`

7 years agosimplify the MirPass traits and passes dramatically
Niko Matsakis [Tue, 25 Apr 2017 22:23:33 +0000 (18:23 -0400)]
simplify the MirPass traits and passes dramatically

Overall goal: reduce the amount of context a mir pass needs so that it
resembles a query.

- The hooks are no longer "threaded down" to the pass, but rather run
  automatically from the top-level (we also thread down the current pass
  number, so that the files are sorted better).
  - The hook now receives a *single* callback, rather than a callback per-MIR.
- The traits are no longer lifetime parameters, which moved to the
  methods -- given that we required
  `for<'tcx>` objecs, there wasn't much point to that.
- Several passes now store a `String` instead of a `&'l str` (again, no
  point).

7 years agorework `MirPass` API to be stateless and extract helper fns
Niko Matsakis [Tue, 25 Apr 2017 22:22:59 +0000 (18:22 -0400)]
rework `MirPass` API to be stateless and extract helper fns

7 years agointroduce `mir_keys()`
Niko Matsakis [Tue, 25 Apr 2017 19:56:02 +0000 (15:56 -0400)]
introduce `mir_keys()`

Each MIR key is a DefId that has MIR associated with it

7 years agoAuto merge of #41702 - frewsxcv:rollup, r=frewsxcv
bors [Tue, 2 May 2017 14:56:11 +0000 (14:56 +0000)]
Auto merge of #41702 - frewsxcv:rollup, r=frewsxcv

Rollup of 6 pull requests

- Successful merges: #41661, #41662, #41673, #41688, #41692, #41693
- Failed merges:

7 years agoRollup merge of #41693 - est31:anon_params_removal, r=eddyb
Corey Farwell [Tue, 2 May 2017 13:09:59 +0000 (09:09 -0400)]
Rollup merge of #41693 - est31:anon_params_removal, r=eddyb

Removal pass for anonymous parameters

Removes occurences of anonymous parameters from the
rustc codebase, as they are to be deprecated.

See issue #41686 and RFC 1685.

r? @frewsxcv

7 years agoRollup merge of #41692 - est31:anon_params, r=eddyb
Corey Farwell [Tue, 2 May 2017 13:09:58 +0000 (09:09 -0400)]
Rollup merge of #41692 - est31:anon_params, r=eddyb

Add a lint to disallow anonymous parameters

Adds a (allow by default) lint to disallow anonymous parameters, like it was decided in RFC 1685 (rust-lang/rfcs#1685).

cc tracking issue #41686

7 years agoRollup merge of #41688 - rust-lang:hex-value-process-exit, r=sfackler
Corey Farwell [Tue, 2 May 2017 13:09:57 +0000 (09:09 -0400)]
Rollup merge of #41688 - rust-lang:hex-value-process-exit, r=sfackler

Fix incorrect hex value in doc comment example.

Fixes https://github.com/rust-lang/rust/issues/41682.

7 years agoRollup merge of #41673 - bitshifter:repr-align-codegen-test, r=arielb1
Corey Farwell [Tue, 2 May 2017 13:09:56 +0000 (09:09 -0400)]
Rollup merge of #41673 - bitshifter:repr-align-codegen-test, r=arielb1

Add simple `[repr(align)]` codegen test.

Checks alloca and memcpy are aligned correctly.

Test added to as additional check for #33626.

7 years agoRollup merge of #41662 - nikomatsakis:on-demandify-region-mapping, r=eddyb
Corey Farwell [Tue, 2 May 2017 13:09:55 +0000 (09:09 -0400)]
Rollup merge of #41662 - nikomatsakis:on-demandify-region-mapping, r=eddyb

On demandify region mapping

This is an adaptation of @cramertj's PR. I am sort of tempted to keep simplifying it, but also tempted to land it so and we can refactor more in follow-up PRs. As is, it does the following things:

- makes the region-maps an on-demand query, per function `tcx.region_maps(def_id)`
- interns code extents instead of of having them be integers
- remove the "root region extent" and (to some extent) item extents; instead we use `Option<CodeExtent<'tcx>>` in a few places (no space inefficiency since `CodeExtent<'tcx>` is now a pointer).

I'm not entirely happy with the way I have it setup though. Here are some of the changes I was considering (I'm not sure if they would work out well):

1. Removing `item_extents` entirely -- they are rarely used now, because most of the relevant places now accept an `Option<Region<'tcx>>` or an `Option<CodeExtent<'tcx>>`, but I think still used in a few places.
2. Merging `RegionMaps` into the typeck tables, instead of having it be its own query.
3. Change `CodeExtent<'tcx>` to store the parent pointer. This would mean that fewer places in the code actually *need* a `RegionMaps` anyhow, since most of them just want to be able to walk "up the tree". On the other hand, you wouldn't be able to intern a `CodeExtent<'tcx>` for some random node-id, you'd need to look it up in the table (since there'd be more information).

Most of this code is semi-temporary -- I expect it to largely go away as we move to NLL -- so I'm also not *that* concerned with making it perfect.

r? @eddyb

7 years agoRollup merge of #41661 - barik:master, r=alexcrichton
Corey Farwell [Tue, 2 May 2017 13:09:54 +0000 (09:09 -0400)]
Rollup merge of #41661 - barik:master, r=alexcrichton

Under MinGW, x.py fails to run with UnboundLocalError.

Under MinGW, `x.py` will fail with the following errors:

```bash
$ ./x.py
Traceback (most recent call last):
  File "./x.py", line 20, in <module>
    bootstrap.main()
  File "C:/src/rust/src/bootstrap/bootstrap.py", line 620, in main
    bootstrap()
  File "C:/src/rust/src/bootstrap/bootstrap.py", line 601, in bootstrap
    rb.build = rb.build_triple()
  File "C:/src/rust/src/bootstrap/bootstrap.py", line 459, in build_triple
    if os.environ.get('MSYSTEM') == 'MINGW64':
UnboundLocalError: local variable 'os' referenced before assignment
```

The reason is due to the `build_triple` function in `src/bootstrap/bootstrap.py` (Line 416):

```python
if ostype == 'Linux':
    os = subprocess.check_output(['uname', '-o']).strip().decode(default_encoding)

```

Here, the assignment to `os` is causing the `os` module to be shadowed.

Then, in (Line 459):

```python
if os.environ.get('MSYSTEM') == 'MINGW64':
    cputype = 'x86_64'
```

`os` now refers to the uninitialized local variable, not the `os` module.

Easiest fix is to simply rename the `os` variable to something like `os_from_sp`.

Also, there is a small typo fix in `x.py` referencing the wrong file name.

7 years agoAuto merge of #41547 - alexeyzab:41425-fix-mismatched-types-error-message, r=arielb1
bors [Tue, 2 May 2017 12:11:54 +0000 (12:11 +0000)]
Auto merge of #41547 - alexeyzab:41425-fix-mismatched-types-error-message, r=arielb1

Fix error message for mismatched types

This addresses #41425 by implementing the changes mentioned in the
following comment:
https://github.com/rust-lang/rust/issues/41425#issuecomment-296754508

7 years agoAuto merge of #41488 - estebank:closure-args, r=arielb1
bors [Tue, 2 May 2017 09:41:39 +0000 (09:41 +0000)]
Auto merge of #41488 - estebank:closure-args, r=arielb1

Clean up callable type mismatch errors

```rust
error[E0593]: closure takes 1 argument but 2 arguments are required here
  --> ../../src/test/ui/mismatched_types/closure-arg-count.rs:13:15
   |
13 |     [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
   |               ^^^^^^^ -------------------------- takes 1 argument
   |               |
   |               expected closure that takes 2 arguments
```

instead of

```rust
error[E0281]: type mismatch: the type `[closure@../../src/test/ui/mismatched_types/closure-arg-count.rs:13:23: 13:49]` implements the trait `for<'r> std::ops::FnMut<(&'r {integer},)>`, but the trait `for<'r, 'r> std::ops::FnMut<(&'r {integer}, &'r {integer})>` is required (expected a tuple with 2 elements, found one with 1 elements)
  --> ../../src/test/ui/mismatched_types/closure-arg-count.rs:13:15
   |
13 |     [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
   |               ^^^^^^^
```

Fix #21857, re #24680.

7 years agoAddress review
est31 [Tue, 2 May 2017 04:35:36 +0000 (06:35 +0200)]
Address review

7 years agoRemoval pass for anonymous parameters
est31 [Tue, 2 May 2017 03:55:20 +0000 (05:55 +0200)]
Removal pass for anonymous parameters

Removes occurences of anonymous parameters from the
rustc codebase, as they are to be deprecated.

See issue #41686 and RFC 1685.

7 years agoAdd a lint to disallow anonymous parameters
est31 [Tue, 2 May 2017 02:38:46 +0000 (04:38 +0200)]
Add a lint to disallow anonymous parameters

7 years agoAuto merge of #40851 - oli-obk:multisugg, r=jonathandturner
bors [Tue, 2 May 2017 01:04:27 +0000 (01:04 +0000)]
Auto merge of #40851 - oli-obk:multisugg, r=jonathandturner

Minimize single span suggestions into a label

changes

```
14 |     println!("☃{}", tup[0]);
   |                     ^^^^^^
   |
help: to access tuple elements, use tuple indexing syntax as shown
   |     println!("☃{}", tup.0);
```

into

```
14 |     println!("☃{}", tup[0]);
   |                     ^^^^^^ to access tuple elements, use `tup.0`
```

Also makes suggestions explicit in the backend in preparation of adding multiple suggestions to a single diagnostic. Currently that's already possible, but results in a full help message + modified code snippet per suggestion, and has no rate limit (might show 100+ suggestions).

7 years agoFix incorrect hex value in doc comment example.
Corey Farwell [Tue, 2 May 2017 00:38:59 +0000 (20:38 -0400)]
Fix incorrect hex value in doc comment example.

7 years agopatch the `librustc_driver` unit tests
Niko Matsakis [Tue, 2 May 2017 00:11:36 +0000 (20:11 -0400)]
patch the `librustc_driver` unit tests

7 years agoAuto merge of #41629 - Mark-Simulacrum:re-enable-tests, r=nikomatsakis
bors [Mon, 1 May 2017 22:36:44 +0000 (22:36 +0000)]
Auto merge of #41629 - Mark-Simulacrum:re-enable-tests, r=nikomatsakis

Unignore tests which work fine now.

As far as I can tell, these tests will now work fine. #13745 tracks the remaining tests which are ignored for various reasons.

7 years agoAuto merge of #41611 - cramertj:metadata-queries-1, r=nikomatsakis
bors [Mon, 1 May 2017 19:53:19 +0000 (19:53 +0000)]
Auto merge of #41611 - cramertj:metadata-queries-1, r=nikomatsakis

Queryify crate metadata

Part of https://github.com/rust-lang/rust/issues/41417.

r? @nikomatsakis

7 years agokill regr test using ad-hoc lint
Niko Matsakis [Mon, 1 May 2017 17:24:25 +0000 (13:24 -0400)]
kill regr test using ad-hoc lint

This was a pretty narrow test to start with, and it's kind of a pain to
update it. Not worth the trouble IMO.

7 years agoQueryify is_item_mir_available
Taylor Cramer [Fri, 28 Apr 2017 08:28:22 +0000 (01:28 -0700)]
Queryify is_item_mir_available

7 years agoQueryify const_is_rvalue_promotable_to_static
Taylor Cramer [Fri, 28 Apr 2017 08:08:48 +0000 (01:08 -0700)]
Queryify const_is_rvalue_promotable_to_static

7 years agoQueryify item_body_nested_bodies
Taylor Cramer [Fri, 28 Apr 2017 07:50:27 +0000 (00:50 -0700)]
Queryify item_body_nested_bodies

7 years agoAuto merge of #41560 - alevy:rwpi-ropi, r=eddyb
bors [Mon, 1 May 2017 17:23:09 +0000 (17:23 +0000)]
Auto merge of #41560 - alevy:rwpi-ropi, r=eddyb

Add RWPI/ROPI relocation model support

This PR adds support for using LLVM 4's ROPI and RWPI relocation models for ARM.

ROPI (Read-Only Position Independence) and RWPI (Read-Write Position Independence) are two new relocation models in LLVM for the ARM backend ([LLVM changset](https://reviews.llvm.org/rL278015)). The motivation is that these are the specific strategies we use in userspace [Tock](https://www.tockos.org) apps, so supporting this is an important step (perhaps the final step, but can't confirm yet) in enabling userspace Rust processes.

## Explanation

ROPI makes all code and immutable accesses PC relative, but not assumed to be overriden at runtime (so for example, jumps are always relative).

RWPI uses a base register (`r9`) that stores the addresses of the GOT in memory so the runtime (e.g. a kernel) only adjusts r9 tell running code where the GOT is.

## Complications adding support in Rust

While this landed in LLVM master back in August, the header files in `llvm-c` have not been updated yet to reflect it. Rust replicates that header file's version of the `LLVMRelocMode` enum as the Rust enum `llvm::RelocMode` and uses an implicit cast in the ffi to translate from Rust's notion of the relocation model to the LLVM library's notion.

My workaround for this currently is to replace the `LLVMRelocMode` argument to `LLVMTargetMachineRef` with an int and using the hardcoded int representation of the `RelocMode` enum. This is A Bad Idea(tm), but I think very nearly the right thing.

Would a better alternative be to patch rust-llvm to support these enum variants (also a fairly trivial change)?

7 years agouse `closure_base_def_id` rather than walking up HIR
Niko Matsakis [Mon, 1 May 2017 15:18:15 +0000 (11:18 -0400)]
use `closure_base_def_id` rather than walking up HIR

7 years agopacify the mercilous tidy
Niko Matsakis [Mon, 1 May 2017 15:09:36 +0000 (11:09 -0400)]
pacify the mercilous tidy

7 years agoremove unused `is_fn`
Niko Matsakis [Mon, 1 May 2017 15:05:40 +0000 (11:05 -0400)]
remove unused `is_fn`

7 years agoAdd simple `[repr(align)]` codegen test.
Cameron Hart [Mon, 1 May 2017 13:13:22 +0000 (23:13 +1000)]
Add simple `[repr(align)]` codegen test.

Checks alloca and memcpy are aligned correctly.

7 years agoAuto merge of #41632 - Mark-Simulacrum:test-16994, r=arielb1
bors [Mon, 1 May 2017 12:13:27 +0000 (12:13 +0000)]
Auto merge of #41632 - Mark-Simulacrum:test-16994, r=arielb1

Add test for issue #16994.

Fixes #16994.

Please check that this is the correct way to write this test.

r? @arielb1 (author of test case)

7 years agoAuto merge of #41666 - nagisa:try-poking-bigendian-again, r=arielb1
bors [Mon, 1 May 2017 09:48:09 +0000 (09:48 +0000)]
Auto merge of #41666 - nagisa:try-poking-bigendian-again, r=arielb1

Try fixing bigendian metadata serialisation

I compiled this on PPC to check and it seems to work, but not sure whether I didn't mess up
anything in a major way.

Maybe a good shot at #41443

The easiest way to *really* test this is to land the patch (a high priority would be good, since I quite literally am just twiddling my thumbs on this now), wait for nightly, and, if the nightly works, backport this to beta.

7 years agoTry fixing bigendian metadata serialisation
Simonas Kazlauskas [Mon, 1 May 2017 01:51:17 +0000 (04:51 +0300)]
Try fixing bigendian metadata serialisation

I compiled this on PPC to check and it seems to work, but not sure whether I didn't mess up
anything in a major way.

Maybe a good shot at #41443

7 years agomodify `ExprUseVisitor` and friends to take region-maps, not def-id
Niko Matsakis [Sat, 29 Apr 2017 11:05:03 +0000 (07:05 -0400)]
modify `ExprUseVisitor` and friends to take region-maps, not def-id

7 years agointroduce per-fn RegionMaps
Taylor Cramer [Mon, 10 Apr 2017 07:00:08 +0000 (00:00 -0700)]
introduce per-fn RegionMaps

Instead of requesting the region maps for the entire crate, request for
a given item etc. Several bits of code were modified to take
`&RegionMaps` as input (e.g., the `resolve_regions_and_report_errors()`
function). I am not totally happy with this setup -- I *think* I'd
rather have the region maps be part of typeck tables -- but at least the
`RegionMaps` works in a "parallel" way to `FreeRegionMap`, so it's not
too bad. Given that I expect a lot of this code to go away with NLL, I
didn't want to invest *too* much energy tweaking it.

7 years agointern CodeExtents
Niko Matsakis [Thu, 20 Apr 2017 08:45:53 +0000 (04:45 -0400)]
intern CodeExtents

Make a `CodeExtent<'tcx>` be something allocated in an arena
instead of an index into the `RegionMaps`.

7 years agoremove ROOT_CODE_EXTENT and DUMMY_CODE_EXTENT
Niko Matsakis [Wed, 19 Apr 2017 20:45:07 +0000 (16:45 -0400)]
remove ROOT_CODE_EXTENT and DUMMY_CODE_EXTENT

Instead, thread around `Option<CodeExtent>` where applicable.

7 years agoRemove RefCells from RegionMaps
Taylor Cramer [Wed, 5 Apr 2017 06:46:59 +0000 (23:46 -0700)]
Remove RefCells from RegionMaps

7 years agoOn-demandify region mapping
Taylor Cramer [Tue, 28 Mar 2017 06:54:41 +0000 (23:54 -0700)]
On-demandify region mapping

7 years agoRename os variable in bootstrap.py to avoid shadowing os module.
Titus Barik [Sun, 30 Apr 2017 20:10:31 +0000 (16:10 -0400)]
Rename os variable in bootstrap.py to avoid shadowing os module.

7 years agoAdd test for issue #16994.
Mark Simulacrum [Sat, 29 Apr 2017 14:04:00 +0000 (08:04 -0600)]
Add test for issue #16994.

7 years agoAuto merge of #41651 - arielb1:missing-adjustment-2, r=eddyb
bors [Sun, 30 Apr 2017 13:38:12 +0000 (13:38 +0000)]
Auto merge of #41651 - arielb1:missing-adjustment-2, r=eddyb

refactor the handling of lvalue ops

I think I got the code into a "mostly sane" situation.

Fixes #41604.

beta-nominating because fixes regression in #41578. I think I can do a smaller fix, but the previous code is too fragile.

r? @eddyb

7 years agorefactor the handling of lvalue ops
Ariel Ben-Yehuda [Thu, 27 Apr 2017 16:25:13 +0000 (19:25 +0300)]
refactor the handling of lvalue ops

Fixes #41604.

7 years agoAuto merge of #41602 - hsivonen:explainnonnull, r=steveklabnik
bors [Sun, 30 Apr 2017 07:58:10 +0000 (07:58 +0000)]
Auto merge of #41602 - hsivonen:explainnonnull, r=steveklabnik

Explain why zero-length slices require a non-null pointer

In reference to [a thread on Discourse](https://users.rust-lang.org/t/why-does-std-slice-from-raw-parts-require-a-non-null-pointer-for-zero-length-slices/10534), explain why `from_raw_parts` requires a non-null pointer for zero-length slices.

r? @steveklabnik

7 years agoAuto merge of #41643 - frewsxcv:rollup, r=frewsxcv
bors [Sun, 30 Apr 2017 05:25:47 +0000 (05:25 +0000)]
Auto merge of #41643 - frewsxcv:rollup, r=frewsxcv

Rollup of 6 pull requests

- Successful merges: #41449, #41509, #41608, #41613, #41636, #41637
- Failed merges:

7 years agoRollup merge of #41637 - eddyb:used-not-dead, r=petrochenkov
Corey Farwell [Sun, 30 Apr 2017 03:44:31 +0000 (23:44 -0400)]
Rollup merge of #41637 - eddyb:used-not-dead, r=petrochenkov

Don't ever warn about #[used] items being dead code.

Fixes #41628 by whitelisting `#[used]` items in `rustc::middle::dead`.

7 years agoRollup merge of #41636 - moosingin3space:fix/process-exit-in-forget-doc, r=sfackler
Corey Farwell [Sun, 30 Apr 2017 03:44:30 +0000 (23:44 -0400)]
Rollup merge of #41636 - moosingin3space:fix/process-exit-in-forget-doc, r=sfackler

process:exit -> process::exit in mem::forget docs

The documentation in mem::forget says "...or call `process:exit`..."
instead of `process::exit`.

r? @steveklabnik

7 years agoRollup merge of #41613 - cuviper:fix-release-links, r=aturon
Corey Farwell [Sun, 30 Apr 2017 03:44:29 +0000 (23:44 -0400)]
Rollup merge of #41613 - cuviper:fix-release-links, r=aturon

Fix links in RELEASES.md for 1.10.0 through 1.12.0

Many links in this series have the `[link text]` and `(url)` on separate
lines, which doesn't get correctly interpreted in markdown.  Or maybe it
once did, but it doesn't now.  This patch joins the lines together.

Here is the content rendered [before](https://github.com/rust-lang/rust/blob/2971d491b955fd8bb504c8ca675b8116b8b1550e/RELEASES.md#version-1120-2016-09-29) and [after](https://github.com/cuviper/rust/blob/e8c4b7af216c9e035b40f78cbd77a35614fdc240/RELEASES.md#version-1120-2016-09-29).

7 years agoRollup merge of #41608 - cuviper:distcheck-rust-src, r=alexcrichton
Corey Farwell [Sun, 30 Apr 2017 03:44:28 +0000 (23:44 -0400)]
Rollup merge of #41608 - cuviper:distcheck-rust-src, r=alexcrichton

Add a distcheck for rust-src completeness

This is for the last commit of #41546.  For some reason, @bors only saw the first two commits, and wouldn't approve the last even when explicitly directed so.

r? @alexcrichton

7 years agoRollup merge of #41509 - froydnj:float-stack-reduction, r=nagisa
Corey Farwell [Sun, 30 Apr 2017 03:44:27 +0000 (23:44 -0400)]
Rollup merge of #41509 - froydnj:float-stack-reduction, r=nagisa

reduce stack requirements for floating-point formatting

Doing this speeds up float formatting by ~10% or so, and also makes the formatting code more suitable for embedded environments where stack space is at a premium.

7 years agoRollup merge of #41449 - Eh2406:master, r=aturon
Corey Farwell [Sun, 30 Apr 2017 03:44:27 +0000 (23:44 -0400)]
Rollup merge of #41449 - Eh2406:master, r=aturon

FromIterator and Extend Cow for String

This is a quick draft to start working on [#41351](https://github.com/rust-lang/rust/issues/41351).
I don't think I got the stable attributes correct, but it is good enuf to start a conversation.

7 years agoAuto merge of #41593 - achernyak:def_span, r=eddyb
bors [Sun, 30 Apr 2017 02:48:11 +0000 (02:48 +0000)]
Auto merge of #41593 - achernyak:def_span, r=eddyb

query for def_span

Resolves `fn def_span(&self, sess: &Session, def: DefId) -> Span;` of  #41417.

I had to change the query name to `def_sess_span` since `ty::TyCtxt` already has a method `def_span` implemented.

This also will probably have merge conflicts with  #41534 but I will resolves those once it's merged and wanted to start a code review on this one now.

r? @eddyb

7 years agoAuto merge of #41544 - alexcrichton:bump-bootstrap, r=brson
bors [Sat, 29 Apr 2017 20:38:15 +0000 (20:38 +0000)]
Auto merge of #41544 - alexcrichton:bump-bootstrap, r=brson

Update stage0 bootstrap compiler

We've got a freshly minted beta compiler, let's update to use that on nightly!
This has a few other changes associated with it as well

* A bump to the rustc version number (to 1.19.0)
* Movement of the `cargo` and `rls` submodules to their "proper" location in
  `src/tools/{cargo,rls}`. Now that Cargo workspaces support the `exclude`
  option this can work.
* Updates of the `cargo` and `rls` submodules to their master branches.
* Tweak to the `src/stage0.txt` format to be more amenable for Cargo version
  numbers. On the beta channel Cargo will bootstrap from a different version
  than rustc (e.g. the version numbers are different), so we need different
  configuration for this.
* Addition of `dev` as a readable key in the `src/stage0.txt` format. If present
  then stage0 compilers are downloaded from `dev-static.rust-lang.org` instead
  of `static.rust-lang.org`. This is added to accomodate our updated release
  process with Travis and AppVeyor.

7 years agoDon't ever warn about #[used] items being dead code.
Eduard-Mihai Burtescu [Sat, 29 Apr 2017 20:18:15 +0000 (23:18 +0300)]
Don't ever warn about #[used] items being dead code.

7 years agoUpdate stage0 bootstrap compiler
Alex Crichton [Thu, 20 Apr 2017 21:32:54 +0000 (14:32 -0700)]
Update stage0 bootstrap compiler

We've got a freshly minted beta compiler, let's update to use that on nightly!
This has a few other changes associated with it as well

* A bump to the rustc version number (to 1.19.0)
* Movement of the `cargo` and `rls` submodules to their "proper" location in
  `src/tools/{cargo,rls}`. Now that Cargo workspaces support the `exclude`
  option this can work.
* Updates of the `cargo` and `rls` submodules to their master branches.
* Tweak to the `src/stage0.txt` format to be more amenable for Cargo version
  numbers. On the beta channel Cargo will bootstrap from a different version
  than rustc (e.g. the version numbers are different), so we need different
  configuration for this.
* Addition of `dev` as a readable key in the `src/stage0.txt` format. If present
  then stage0 compilers are downloaded from `dev-static.rust-lang.org` instead
  of `static.rust-lang.org`. This is added to accomodate our updated release
  process with Travis and AppVeyor.

7 years agoprocess:exit -> process::exit in mem::forget docs
Nathan Moos [Sat, 29 Apr 2017 18:56:35 +0000 (14:56 -0400)]
process:exit -> process::exit in mem::forget docs

The documentation in mem::forget says "...or call `process:exit`..."
instead of `process::exit`.

r? @steveklabnik

7 years agoremoved custom functions and comment
achernyak [Sat, 29 Apr 2017 18:11:01 +0000 (13:11 -0500)]
removed custom functions and comment

7 years agochaned dep nodes impl
achernyak [Sat, 29 Apr 2017 16:04:55 +0000 (11:04 -0500)]
chaned dep nodes impl

7 years agoAuto merge of #39291 - Freyskeyd:check_context_E0423, r=petrochenkov
bors [Sat, 29 Apr 2017 15:18:52 +0000 (15:18 +0000)]
Auto merge of #39291 - Freyskeyd:check_context_E0423, r=petrochenkov

Checker:: Execute levenshtein before other context checking

As explain [here]() i think it's better to check for a miss typing before checking context dependent help.

```rust
struct Handle {}

struct Something {
     handle: Handle
}

fn main() {
     let handle: Handle = Handle {};

     let s: Something = Something {
         // Checker detect an error and propose a solution with `Handle { /* ... */ }`
         // but it's a miss typing of `handle`
         handle: Handle
    };
}
```

Ping: @nagisa for #39226

Signed-off-by: Freyskeyd <simon.paitrault@gmail.com>
7 years agoadded dep nodes and comment
achernyak [Sat, 29 Apr 2017 14:56:01 +0000 (09:56 -0500)]
added dep nodes and comment

7 years agoAuto merge of #41588 - cengizIO:master, r=nikomatsakis
bors [Sat, 29 Apr 2017 12:59:45 +0000 (12:59 +0000)]
Auto merge of #41588 - cengizIO:master, r=nikomatsakis

use diff crate for compile-fail test diagnostics #41474

Hello!

This fixes #41474

We were using a custom implementation to dump the differences between expected and actual outputs of compile-fail tests.

I removed this internal implementation and added `diff` crate as a new dependency to `compile-fail`.

Again, huge thanks to @nikomatsakis for guiding.