Commit Graph

51933 Commits

Author SHA1 Message Date
Benjamin Herr e3a7a66f1a librustc: replace panic!() with bug!() 2016-03-31 22:04:23 +02:00
Benjamin Herr 2fa867a203 librustc: replace unimplemented!() with bug!() 2016-03-31 22:04:23 +02:00
Benjamin Herr dfd0e937ac librustc: replace unreachable! with bug!() 2016-03-31 22:04:23 +02:00
Benjamin Herr bcdaccfbbe librustc: replace span_bug calls with span_bug!() 2016-03-31 22:04:23 +02:00
Benjamin Herr 859b5a141c librustc: replace tcx.sess.bug calls with bug!() 2016-03-31 22:04:23 +02:00
Benjamin Herr fc7ec6b614 librustc: add {span_,}bug! macros
... as single "internal compiler error" entry point.

The macros pass `file!()`, `line!()` and `format_args!(...)` on to a
cold, never-inlined function, ultimately calling `bug()` or `span_bug()`
on the `Handler` from `session::diagnostic()` via the tcx in tls or,
failing that, panicking directly.
2016-03-31 22:04:23 +02:00
bors 3399d19a2c Auto merge of #31938 - jseyfried:autoderef_privacy, r=nikomatsakis
Integrate privacy into field and method selection

This PR integrates privacy checking into field and method selection so that an inaccessible field/method can not stop an accessible field/method from being used (fixes #12808 and fixes #22684).
r? @eddyb
2016-03-31 09:09:34 -07:00
bors 4583dc9b13 Auto merge of #32439 - jseyfried:visible_suggestions, r=nrc
diagnostics: make paths to external items more visible

This PR changes the reported path for an external item so that it is visible from at least one local module (i.e. it does not use any inaccessible external modules) if possible. If the external item's crate was declared with an `extern crate`, the path is guarenteed to use the `extern crate`.

Fixes #23224, fixes #23355, fixes #26635, fixes #27165.

r? @nrc
2016-03-30 21:13:43 -07: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
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
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
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
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
Eduard Burtescu f22ec2992b mk: move rustc_const_eval to RUSTC_CRATES where it belongs. 2016-03-29 19:36:02 +03:00
Eduard Burtescu 0abd3139db rustc_platform_intrinsics: remove unused rustc dependency. 2016-03-29 19:36:01 +03:00