Commit Graph

52196 Commits

Author SHA1 Message Date
Matt Brubeck
d93fb02a5e Update Rust version in the Rustonomicon Vec chapter
I verified that the final code compiles in Rust 1.9.0-nightly.
2016-03-30 16:59:38 -07:00
Jeffrey Seyfried
3d9db59566 Detect cycles that include renamed imports 2016-03-30 23:50:19 +00:00
bors
30a3849f22 Auto merge of #32628 - Manishearth:rollup, r=Manishearth
Rollup of 4 pull requests

- Successful merges: #32259, #32494, #32612, #32618
- Failed merges: #32562
2016-03-30 16:41:08 -07:00
Manish Goregaokar
458fae709c Rollup merge of #32618 - ProgVal:patch-1, r=steveklabnik
Book: Fix phrasing: “an associated type” → “an object with an associated type”.

From what I understood, `graph` is the object from which we create a trait object, and the associated types are `Graph::N` and `Graph::E`.
2016-03-31 05:04:59 +05:30
Manish Goregaokar
cb5af8901a Rollup merge of #32612 - frewsxcv:unnecessary-coercions, r=alexcrichton
Remove no longer necessary coercions to fn pointer types.

Originally added in 8fe9e4dff6.

Everything appears to build fine without the coercions, so they can
presumably be removed.
2016-03-31 05:04:59 +05:30
Manish Goregaokar
74546e8ab7 Rollup merge of #32494 - pnkfelix:gate-parser-recovery-via-debugflag, r=nrc
Gate parser recovery via debugflag

Gate parser recovery via debugflag

Put in `-Z continue_parse_after_error`

This works by adding a method, `fn abort_if_no_parse_recovery`, to the
diagnostic handler in `syntax::errors`, and calling it after each
error is emitted in the parser.

(We might consider adding a debugflag to do such aborts in other
places where we are currently attempting recovery, such as resolve,
but I think the parser is the really important case to handle in the
face of #31994 and the parser bugs of varying degrees that were
injected by parse error recovery.)

r? @nikomatsakis
2016-03-31 05:04:59 +05:30
Manish Goregaokar
9957081e78 Rollup merge of #32259 - oli-obk:move_const_eval, r=alexcrichton
move `const_eval` and `check_match` out of `librustc` into their own crate

r? @arielb1
2016-03-31 05:04:59 +05:30
Jeffrey Seyfried
da41e583d6 Fix fallout in tests 2016-03-30 22:00:48 +00:00
Jeffrey Seyfried
0c6f067961 Add method visible_item_path to CStore 2016-03-30 22:00:46 +00:00
Jeffrey Seyfried
48c20b0e73 Improve tests 2016-03-30 21:26:35 +00:00
Vadim Petrochenkov
38bef43652 privacy: Cleanup check_field 2016-03-30 21:26:35 +00:00
Jeffrey Seyfried
48b048deb7 Clean up the privacy visitor 2016-03-30 21:26:35 +00:00
Jeffrey Seyfried
8762fc31db Add tests for #12808 and #22684 2016-03-30 21:26:35 +00:00
Jeffrey Seyfried
09af5036da Fix fallout in tests 2016-03-30 21:26:35 +00:00
Jeffrey Seyfried
6f16c5c81f Autoderef privacy for methods 2016-03-30 21:26:35 +00:00
Jeffrey Seyfried
62d181f474 Autoderef privacy for fields 2016-03-30 21:26:32 +00:00
Felix S. Klock II
e1d8ad3fb0 fix compile-fail and parse-fail tests by blindly opting back into
parser recovery (so that expected errors match up)

I'm opting into parser recovery in all these cases out of expediency,
not because the error messages you get with recovery enabled are
actually all that usable in all cases listed.
2016-03-30 22:23:54 +02:00
Felix S. Klock II
2646663b5a Put in -Z continue-parse-after-error
This works by adding a boolean flag, `continue_after_error`, to
`syntax::errors::Handler` that can be imperatively set to `true` or
`false` via a new `fn set_continue_after_error`.

The flag starts off true (since we generally try to recover from
compiler errors, and `Handler` is shared across all phases).

Then, during the `phase_1_parse_input`, we consult the setting of the
`-Z continue-parse-after-error` debug flag to determine whether we
should leave the flag set to `true` or should change it to `false`.

----

(We might consider adding a debugflag to do such aborts in other
places where we are currently attempting recovery, such as resolve,
but I think the parser is the really important case to handle in the
face of #31994 and the parser bugs of varying degrees that were
injected by parse error recovery.)
2016-03-30 22:23:48 +02:00
bors
bfacabc6a2 Auto merge of #32621 - steveklabnik:rollup, r=steveklabnik
Rollup of 7 pull requests

- Successful merges: #32580, #32591, #32603, #32605, #32606, #32607, #32608
- Failed merges:
2016-03-30 11:33:31 -07:00
Sean McArthur
fc8cf9c5af specialize ToString for str 2016-03-30 10:40:06 -07:00
Valentin Lorentz
b1b37384cd Book: Fix phrasing: “an associated type” → “a trait with an associated type”. 2016-03-30 19:34:53 +02:00
Steve Klabnik
2ba860677c Rollup merge of #32608 - tshepang:grammar, r=aturon
doc: "of the" seems more correct than "to the"

It's also less ambiguous
2016-03-30 10:16:55 -07:00
Steve Klabnik
709be98804 Rollup merge of #32607 - tshepang:we-gots-intoiterator, r=apasel422
doc: no need for an explicit iter()
2016-03-30 10:16:55 -07:00
Steve Klabnik
1978a9951b Rollup merge of #32606 - tshepang:typo, r=bluss
doc: fix typo
2016-03-30 10:16:55 -07:00
Steve Klabnik
45d633db26 Rollup merge of #32605 - tshepang:not-needed, r=Manishearth
doc: "mut" not needed for the examples
2016-03-30 10:16:54 -07:00
Steve Klabnik
662e7af0f9 Rollup merge of #32603 - tshepang:capitalise, r=bluss
doc: first letter should be upper case
2016-03-30 10:16:54 -07:00
Steve Klabnik
6f885c3c15 Rollup merge of #32591 - CryZe:patch-1, r=steveklabnik
Fix panic_fmt in the Book

While implementing panic_fmt for the GameCube I noticed that the parameters given to it were completely broken. Turns out that panic_fmt requires the C ABI to work correctly. This should be fixed in the documentation, so that others don't make the same mistake. Thanks to mbrubeck in the IRC for helping me figure this out.

Not specifying extern for lang_items correctly should potentially also be a compiler error.
2016-03-30 10:16:54 -07:00
Steve Klabnik
9f403abba2 Rollup merge of #32580 - durka:patch-17, r=steveklabnik
verb agreement in core::convert docs
2016-03-30 10:16:54 -07:00
Corey Farwell
99501e6177 Remove no longer necessary coercions to fn pointer types.
Originally added in 8fe9e4dff6.

Everything appears to build fine without the coercions, so they can
presumably be removed.
2016-03-30 09:50:55 -04:00
bors
102a5be712 Auto merge of #32603 - tshepang:capitalise, r=bluss
doc: first letter should be upper case
2016-03-30 06:18:59 -07:00
Oliver Schneider
3eac64747f move const_eval and check_match out of librustc 2016-03-30 13:43:36 +02:00
Tshepang Lekhonkhobe
fd78ae860f doc: no need for an explicit iter() 2016-03-30 13:35:52 +02:00
Oliver Schneider
6cc449ad24 rename rustc_const_eval to rustc_const_math 2016-03-30 11:10:21 +02:00
bors
70b8b9487a Auto merge of #32581 - GuillaumeGomez:patch-3, r=steveklabnik
Add doc examples on pointer types

r? @steveklabnik

Fixes #29336
2016-03-30 00:53:57 -07:00
Tshepang Lekhonkhobe
65cdf5d44d doc: "of the" seems more correct than "to the"
It's also less ambiguous
2016-03-30 09:01:22 +02:00
Alex Crichton
08ca5d9558 rustbuild: Fix compile on OSX for 10.7
This commit should help configure our OSX rustbuild builder for targeting 10.7.
A key part of this is using `libc++` instead of `libstdc++` as apparently it's
more filled out and otherwise LLVM's cmake configuration would fail.
2016-03-29 21:51:00 -07:00
bors
a48c9a11a6 Auto merge of #32593 - alexcrichton:fix-i586-msvc, r=brson
mk: A few build fixes for i586-pc-windows-msvc

Detect the triple in the configure script for probing MSVC shenanigans and also
be sure to use `llvm-config` from the build host and not the target when
configuring compiler-rt.
2016-03-29 21:25:52 -07:00
Masood Malekghassemi
dcdf3d62c1 Plumb obligations through librustc/infer 2016-03-29 20:06:42 -07:00
bors
b678600ac9 Auto merge of #32576 - alexcrichton:metadata-for-our-crates, r=brson
mk: Fix cross-host builds

The change in b20e748 had the unintended consequence of breaking cross-host
builds as we apparently relied on the incorrect definition of this variable in
the makefiles. That change, however, was required to get tests passing so we
couldn't just revert it.

This commit fixes the underlying bug by leaving the "more correct" definition of
`LD_LIBRARY_PATH_ENV_TARGETDIR` (also fixing it with a hardcoded reference to
`CFG_BUILD`) and updating the `RPATH_VAR` definition below. Turned out we
already had special-casing logic for passing `--cfg stage1` during the
well-we-print-this-as-stage0 build of a cross-host. That logic was just updated
to pull from a different variable as opposed to relying on the definition of
that variable to accommodate this.

Closes #32568
2016-03-29 18:03:35 -07:00
James Miller
6935782b07 Add a test 2016-03-30 13:00:02 +13:00
James Miller
02cb1d4ef1 Delete obviously-unreachable blocks
Some blocks won't be translated at all because they aren't reachable at
the LLVM level, these need to be dealt with because they lack a
terminator and therefore trigger an LLVM assertion.

Other blocks aren't reachable because of codegen-time optimistions, for
example not dropping types that don't need it, often resulting in blocks
with no predecessors. We'll clean those up as well.
2016-03-30 13:00:02 +13:00
James Miller
c70bc3a5da Don't build a map of predecessors, just count them instead 2016-03-30 13:00:02 +13:00
James Miller
eee7f3c732 Add and use a break critical edges transform
This is a fairly standard transform that inserts blocks along critical
edges so code can be inserted along the edge without it affecting other
edges. The main difference is that it considers a Drop or Call
terminator that would require an `invoke` instruction in LLVM a critical
edge. This is because we can't actually insert code after an invoke, so
it ends up looking similar to a critical edge anyway.

The transform is run just before translation right now.
2016-03-30 12:59:57 +13:00
James Miller
60a28e60aa Add some standard traversal iterators for MIR
Adds Preorder, Postorder and Reverse Postorder traversal iterators.

Also makes trans/mir use Reverse Postorder traversal for blocks.
2016-03-30 12:57:43 +13:00
Alex Crichton
7668b4bec2 mk: A few build fixes for i586-pc-windows-msvc
Detect the triple in the configure script for probing MSVC shenanigans and also
be sure to use `llvm-config` from the build host and not the target when
configuring compiler-rt.
2016-03-29 16:43:49 -07:00
bors
ec666a5977 Auto merge of #32571 - eddyb:llvm-back-to-back, r=alexcrichton
Weed out dependencies on librustc_llvm and librustc.

Found while working on #32570. cc @nikomatsakis
2016-03-29 14:43:51 -07:00
Christopher Serr
e9b1c3ccb5 Fix panic_fmt in the Book
While implementing panic_fmt for the GameCube I noticed that the parameters given to it were completely broken. Turns out that panic_fmt requires the C ABI to work correctly. This should be fixed in the documentation, so that others don't make the same mistake. Thanks to mbrubeck in the IRC for helping me figure this out.

Not specifying extern for lang_items correctly should potentially also be a compiler error.
2016-03-29 22:28:17 +02:00
bors
8f5c3f1fcf Auto merge of #32557 - dotdash:issue-32518, r=nikomatsakis
Use weak_odr linkage when reusing definitions across codegen units

When reuing a definition across codegen units, we obviously cannot use
internal linkage, but using external linkage means that we can end up
with multiple conflicting definitions of a single symbol across
multiple crates. Since the definitions should all be equal
semantically, we can use weak_odr linkage to resolve the situation.

Fixes #32518

r? @nikomatsakis
2016-03-29 11:10:39 -07:00
Tshepang Lekhonkhobe
cd92e9f966 doc: "mut" not needed for the examples 2016-03-29 19:59:55 +02:00
Tshepang Lekhonkhobe
05d0aa6dcc doc: fix typo 2016-03-29 19:48:46 +02:00