Commit Graph

54382 Commits

Author SHA1 Message Date
Ariel Ben-Yehuda
e3af9fa490 make the basic_blocks field private 2016-06-09 14:55:19 +03:00
Ariel Ben-Yehuda
bc1eb67721 introduce the type-safe IdxVec and use it instead of loose indexes 2016-06-09 14:26:08 +03:00
bors
33c8992b80 Auto merge of #34109 - pnkfelix:fix-issue-34101, r=arielb1
Fix issue #34101

Fix issue #34101: do not track subcontent of type with dtor nor gather flags for untracked content.

(Includes a regression test, which needed to go into `compile-fail/`
due to weaknesses when combining `#[deny(warnings)]` with
`tcx.sess.span_warn(..)`)
2016-06-09 04:24:50 -07:00
Ariel Ben-Yehuda
e9003c5574 merge the RemoveDeadBlocks pass into the SimplifyCfg pass 2016-06-09 13:23:00 +03:00
bors
24526cc3cc Auto merge of #34108 - jseyfried:refactor_prelude_injection, r=nrc
Refactor away the prelude injection fold

Instead, just inject `#[prelude_import] use [core|std]::prelude::v1::*;` at the crate root while injecting `extern crate [core|std];` and process `#[no_implicit_prelude]` attributes in `resolve`.

r? @nrc
2016-06-09 01:35:26 -07:00
bors
dc77c5ebe8 Auto merge of #34032 - jseyfried:load_macros_in_expansion, r=nrc
Support `#[macro_use]` on macro-expanded crates

This PR loads macros from `#[macro_use]` crates during expansion so that
 - macro-expanded `#[macro_use]` crates work (fixes #33936, fixes #28071), and
 - macros imported from crates have the same scope as macros imported from modules.

This is a [breaking-change]. For example, this will break:
```rust
macro_rules! m {
    () => { #[macro_use(foo)] extern crate core; } //~ ERROR imported macro not found
}
m!();
```
Also, this will break:
```rust
macro_rules! try { () => {} }
// #[macro_use] mod bar { macro_rules! try { ... } } //< ... just like this would ...
fn main() { try!(); } //< ... making this an error
```

r? @nrc
2016-06-08 22:45:35 -07:00
Pavel Pravosud
8180a910f9 Fix BTreeMap example typo
The whole example is made around movies reviews, but that one line says "review some books".
2016-06-08 20:32:24 -07:00
Srinivas Reddy Thatiparthy
c605480521 clean up for test cases 2016-06-09 08:20:08 +05:30
Srinivas Reddy Thatiparthy
c6ed7adf7a remove redundant assert statements 2016-06-09 08:12:31 +05:30
bors
bb4b3fb7f9 Auto merge of #32202 - arielb1:slice-patterns, r=nikomatsakis
Implement RFC495 semantics for slice patterns

non-MIR translation is still not supported for these and will happily ICE.

This is a [breaking-change] for many uses of slice_patterns.

[RFC 495 text](https://github.com/rust-lang/rfcs/blob/master/text/0495-array-pattern-changes.md)
2016-06-08 19:30:33 -07:00
Jeffrey Seyfried
dbf0326ddc Add comment and clean up expand_annotatable 2016-06-09 00:49:42 +00:00
Jeffrey Seyfried
13e3925e8d Add regression test 2016-06-09 00:45:04 +00:00
Jeffrey Seyfried
51499b6e1f Load macros from extern crates during expansion. 2016-06-09 00:44:17 +00:00
Jeffrey Seyfried
c751ec626d Add regression test 2016-06-09 00:31:19 +00:00
Jeffrey Seyfried
8254e55760 Avoid configuring interpolated items. 2016-06-09 00:26:35 +00:00
bors
34505e2228 Auto merge of #34167 - eddyb:fix-pairs-for-real, r=nikomatsakis
trans: don't misuse C_nil for ZSTs other than ().

`C_nil` is actually `C_null` for `()` so `TempRef::new_operand` was treating all ZSTs as `()`.
This should allow running Servo with `RUSTFLAGS=-Zorbit`, assuming there are no other bugs.
2016-06-08 16:41:01 -07:00
Ariel Ben-Yehuda
2de6ea7a35 fix Cargo.lock 2016-06-09 01:05:37 +03:00
Ariel Ben-Yehuda
f0174fcbee use the slice_pat hack in libstd too 2016-06-09 00:38:38 +03:00
Ariel Ben-Yehuda
9b1abf5c65 remove residual slice pattern junk from mem_categorization 2016-06-09 00:38:38 +03:00
Ariel Ben-Yehuda
fcabfa9735 add an help message when using an old-style slice pattern 2016-06-09 00:38:38 +03:00
Ariel Ben-Yehuda
5cf4139d21 fix tests 2016-06-09 00:38:38 +03:00
Ariel Ben-Yehuda
a673cedf7b fix stdtest 2016-06-09 00:38:38 +03:00
Ariel Ben-Yehuda
b2100cc7b5 fix damage in librustc 2016-06-09 00:38:38 +03:00
Ariel Ben-Yehuda
8ac3b46cac address review comments 2016-06-09 00:38:38 +03:00
Ariel Ben-Yehuda
5af5f26753 handle string literals correctly in match checking
The root of the problem is that a string literal pattern is essentially of
the form `&LITERAL`, in a single block, while match checking wants to
split that.

To fix that, I added a type field to the patterns in match checking,
which allows us to distinguish between a full and split pattern.

That file is ugly and needs to be cleaned. However, `trans::_match` calls
it, so I think we should delay the cleanup until we kill that.

Fixes #30240
2016-06-09 00:38:38 +03:00
Ariel Ben-Yehuda
1a614f8568 wrap calls to lvalue_ty 2016-06-09 00:38:38 +03:00
Ariel Ben-Yehuda
5c717a6fc2 implement RFC495 semantics for slice patterns
non-MIR translation is still not supported for these and will happily ICE.

This is a [breaking-change] for many uses of slice_patterns.
2016-06-09 00:38:38 +03:00
Eduard Burtescu
22fa769bc4 trans: don't misuse C_nil for ZSTs other than (). 2016-06-09 00:33:57 +03:00
Ariel Ben-Yehuda
088b7e2108 fix translation of unsized types and arrays 2016-06-08 23:58:53 +03:00
Ariel Ben-Yehuda
70c25c848c remove the librustc_trans -> librustc_mir dependency 2016-06-08 23:58:53 +03:00
bors
0d531bfb88 Auto merge of #33989 - eddyb:mir-viz, r=nikomatsakis
[MIR] Make scopes debuginfo-specific (visibility scopes).

Fixes #32949 by having MIR (visibility) scopes mimic the lexical structure.
Unlike #33235, this PR also removes all scopes without variable bindings.

Printing of scopes also changed, e.g. for:
```rust
fn foo(x: i32, y: i32) { let a = 0; let b = 0; let c = 0; }
```
Before my changes:
```rust
fn foo(arg0: i32, arg1: i32) -> () {
    let var0: i32;                       // "x" in scope 1 at <anon>:1:8: 1:9
    let var1: i32;                       // "y" in scope 1 at <anon>:1:16: 1:17
    let var2: i32;                       // "a" in scope 3 at <anon>:1:30: 1:31
    let var3: i32;                       // "b" in scope 6 at <anon>:1:41: 1:42
    let var4: i32;                       // "c" in scope 9 at <anon>:1:52: 1:53

    ...

    scope tree:
    0 1 2 3 {
        4 5
        6 {
            7 8
            9 10 11
        }
    }
}
```
After my changes:
```rust
fn foo(arg0: i32, arg1: i32) -> () {
    scope 1 {
        let var0: i32;                   // "x" in scope 1 at <anon>:1:8: 1:9
        let var1: i32;                   // "y" in scope 1 at <anon>:1:16: 1:17
        scope 2 {
            let var2: i32;               // "a" in scope 2 at <anon>:1:30: 1:31
            scope 3 {
                let var3: i32;           // "b" in scope 3 at <anon>:1:41: 1:42
                scope 4 {
                    let var4: i32;       // "c" in scope 4 at <anon>:1:52: 1:53
                }
            }
        }
    }

    ...
}
2016-06-08 13:51:57 -07:00
Oliver Middleton
bc4def9e74 docs: Improve char::to_{lower,upper}case examples
Collect the results to a String to make it clear that it will not always
return only one char and add examples showing that.
2016-06-08 19:24:03 +01:00
bors
4b240fe96a Auto merge of #34083 - alexcrichton:dumb-hack, r=nrc
rustc: Try to contain prepends to PATH

This commit attempts to bring our prepends to PATH on Windows when loading
plugins because we've been seeing quite a few issues with failing to spawn a
process on Windows, the leading theory of which is that PATH is too large as a
result of this. Currently this is mostly a stab in the dark as it's not
confirmed to actually fix the problem, but it's probably not a bad change to
have anyway!

cc #33844
Closes #17360
2016-06-08 07:43:29 -07:00
Hendrik Sollich
92e8228813 Fixed two little Game Of Thrones References
Fixed: conflicting spelling of "Jon Snow"
Fixed: It's call "Night's Watch"
2016-06-08 14:44:00 +02:00
Jacob Clark
4c5f3a6d65 Resolving line length build fail 2016-06-08 13:26:18 +01:00
bors
d3e014e295 Auto merge of #34068 - ollie27:rustdoc_redirect_const, r=brson
rustdoc: Fix generating redirect pages for statics and consts

These were missing from the cache for some reason meaning the redirect pages failed to render.
2016-06-08 04:53:34 -07:00
Morten H. Solvang
d592675de6 Updated README to account for changes in MSYS2
One of the newest versions of MSYS2 now only has one .cmd file which replaces the old bat files. It has to be used to launch the mingw32/64 shell.
2016-06-08 11:27:31 +02:00
bors
ff1315591f Auto merge of #34010 - jseyfried:decorate_expanded, r=nrc
Run decorators on expanded AST

Fixes #32950.
r? @nrc
2016-06-08 02:05:38 -07:00
Jacob Clark
0379493bd9
Resolving build failure 2016-06-08 07:22:49 +01:00
bors
368f6ae8cb Auto merge of #34003 - frewsxcv:13727-regressions, r=brson
Add regression tests for #13727.

Fixes https://github.com/rust-lang/rust/issues/13727.
2016-06-07 21:38:30 -07:00
bors
371bf0eda2 Auto merge of #33982 - LeoTestard:remove-check-matcher-old, r=pnkfelix
Remove the old FOLLOW checking (aka `check_matcher_old`).

It was supposed to be removed at the next release cycle but is still in the tree since like 6 months.
Potential breaking change, since some cases (such as #25658) will change from a warning to an error. But the warning stating that it will be a hard error in the next release has been there for 6 months now.
I think it's safe to break this code. ^_^
2016-06-07 17:56:35 -07:00
Andrew Brinker
af33b30bc6 Fixed based on feedback from steveklabnik 2016-06-07 18:09:24 -04:00
bors
ec872dc8a3 Auto merge of #34141 - eddyb:trans-abi-memcpy, r=nikomatsakis
trans: always use a memcpy for ABI argument/return casts.

When storing incoming arguments or values returned by call/invoke, always do a `memcpy` from a temporary of the cast type, if there is an ABI cast.
While Clang has gotten smarter ([store](https://godbolt.org/g/EphFuK) vs [memcpy](https://godbolt.org/g/5dikH9)), a `memcpy` will always work.
This is what @dotdash has wanted to do all along, and it fixes #32049.
2016-06-07 14:45:39 -07:00
Eduard Burtescu
e252865b74 trans: always use a memcpy for ABI argument/return casts. 2016-06-08 00:35:01 +03:00
Oliver Middleton
02f9be8524 Remove unzip() SizeHint hack
This was using an invalid iterator so is likely to end with buggy
behaviour.

It also doesn't even benefit many type in std including Vec so removing it
shouldn't cause any problems.
2016-06-07 22:32:48 +01:00
bors
39a523ba13 Auto merge of #34139 - steveklabnik:rollup, r=steveklabnik
Rollup of 13 pull requests

- Successful merges: #33645, #33897, #33945, #34007, #34060, #34070, #34094, #34098, #34099, #34104, #34124, #34125, #34138
- Failed merges:
2016-06-07 11:50:31 -07:00
James Lucas
8844fd4e8a Adding sections and brief explanation of libc
Have included an example of a Cargo.toml file containing the libc dependency.

The file has been reformatted to use sections. The note on the default features warning is part of the _Using libc_ section but is in bold.
2016-06-07 10:59:47 -07:00
Aleksey Kladov
7abdbd4483 docs: simplify wording 2016-06-07 20:46:11 +03:00
Eduard Burtescu
0c5930ef25 mir: group span + visibility scope under a new SourceInfo type. 2016-06-07 19:21:56 +03:00
Srinivas Reddy Thatiparthy
96c85f4e37 run rustfmt on libflate folder 2016-06-07 21:29:35 +05:30