Commit Graph

221 Commits

Author SHA1 Message Date
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
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
Oliver Schneider
3eac64747f move const_eval and check_match out of librustc 2016-03-30 13:43:36 +02:00
Eduard Burtescu
035a645e64 rustc_trans: move the contents of the trans module to top-level. 2016-03-27 01:23:28 +02:00
Eduard Burtescu
5efdde0de1 rustc: move cfg, infer, traits and ty from middle to top-level. 2016-03-27 01:05:54 +02:00
Niko Matsakis
7b6270b537 store krate information more uniformly
make DefPath store krate and enable uniform access to crate_name/crate_disambiguator
2016-03-25 14:07:19 -04:00
Michael Woerister
2eebb7b605 Make the compiler emit an error if the crate graph contains two crates with the same crate-name and crate-salt but different SVHs. 2016-03-25 14:07:18 -04:00
Michael Woerister
3a756fea50 Make the definite name of the local crate available in the tcx. 2016-03-25 14:07:17 -04:00
Michael Woerister
32a2e9a8e1 Compute a salt from arguments passed via -Cmetadata. 2016-03-25 14:07:17 -04:00
Jorge Aparicio
2628f3cc8f fix alignment 2016-03-22 22:03:54 -05:00
Jorge Aparicio
0f02309e4b try! -> ?
Automated conversion using the untry tool [1] and the following command:

```
$ find -name '*.rs' -type f | xargs untry
```

at the root of the Rust repo.

[1]: https://github.com/japaric/untry
2016-03-22 22:01:37 -05:00
Felix S. Klock II
5757e65f7a scaffolding for borrowck on MIR.
emit (via debug!) scary message from `fn borrowck_mir` until basic
prototype is in place.

Gather children of move paths and set their kill bits in
dataflow. (Each node has a link to the child that is first among its
siblings.)

Hooked in libgraphviz based rendering, including of borrowck dataflow
state.

doing this well required some refactoring of the code, so I cleaned it
up more generally (adding comments to explain what its trying to do
and how it is doing it).

Update: this newer version addresses most review comments (at least
the ones that were largely mechanical changes), but I left the more
interesting revisions to separate followup commits (in this same PR).
2016-03-21 18:36:22 +01:00
bors
6d215fe04c Auto merge of #32169 - mitaa:anon-tip, r=nrc
Allow custom filenames for anonymous inputs

This came out of #29253 but doesn't fix it.

I thought it might be worth merging on its own nonetheless.
2016-03-14 14:44:55 -07:00
mitaa
ea7cf904b0 Allow custom filenames for anonymous inputs 2016-03-14 20:03:43 +01:00
bors
c21644ad16 Auto merge of #31916 - nagisa:mir-passmgr-2, r=arielb1
Add Pass manager for MIR

A new PR, since rebasing the original one (https://github.com/rust-lang/rust/pull/31448) properly was a pain. Since then there has been several changes most notable of which:

1. Removed the pretty-printing with `#[rustc_mir(graphviz/pretty)]`, mostly because we now have `--unpretty=mir`, IMHO that’s the direction we should expand this functionality into;
2. Reverted the infercx change done for typeck, because typeck can make an infercx for itself by being a `MirMapPass`

r? @nikomatsakis
2016-03-13 05:33:28 -07:00
bors
ef3d051630 Auto merge of #32073 - jseyfried:fix_another_trait_privacy_error, r=nikomatsakis
Fix incorrect trait privacy error

This PR fixes #21670 by using the crate metadata instead of `ExternalExports` to determine if an external item is public.

r? @nikomatsakis
2016-03-09 07:14:05 -08:00
bors
cbbd3d9b92 Auto merge of #31631 - jonas-schievink:agoraphobia, r=nrc
[breaking-batch] Move more uses of `panictry!` out of libsyntax
2016-03-09 05:25:48 -08:00
Jeffrey Seyfried
2998564615 Refactor away ExternalExports 2016-03-06 05:46:49 +00:00
Simonas Kazlauskas
27d91d73f9 Address comments 2016-03-04 15:20:42 +02:00
Simonas Kazlauskas
811b874716 Add Pass manager for MIR 2016-03-04 15:20:10 +02:00
Jeffrey Seyfried
37ba66a66e Rename middle::ty::ctxt to TyCtxt 2016-03-03 07:37:56 +00:00
Ariel Ben-Yehuda
880b6c260a fix a few remaining bugs - make check runs! 2016-02-20 01:54:58 +02:00
Jonas Schievink
11e0ba4340 Do less panicking in general 2016-02-19 14:43:13 +01:00
Jonas Schievink
3a872782d3 Move more uses of panictry! out of libsyntax
[breaking-change] for syntax extensions
2016-02-16 13:32:40 +01:00
bors
3548b8c273 Auto merge of #31524 - jonas-schievink:autoderef, r=steveklabnik 2016-02-13 00:16:03 +00:00
Jonas Schievink
2b69c989ee Use more autoderef in rustc_driver 2016-02-12 19:27:20 +01:00
bors
ce4b75f256 Auto merge of #30726 - GuillaumeGomez:compile-fail, r=brson
r? @brson
cc @alexcrichton

I still need to add error code explanation test with this, but I can't figure out a way to generate the `.md` files in order to test example source codes.

Will fix #27328.
2016-02-12 18:25:08 +00:00
Oliver Schneider
4b067183ba Allow registering MIR-passes through compiler plugins 2016-02-09 16:53:43 +01:00
Oliver Schneider
41c892f5e1 make MirMap a struct instead of a type alias for NodeMap 2016-02-09 16:53:42 +01:00
Guillaume Gomez
eb5b9037ad Add compile-fail test in rustdoc 2016-02-07 13:03:32 +01:00
Niko Matsakis
35b6e2b0bb Instrument a bunch of tasks that employ the HIR map in one way or
another and were not previously instrumented.
2016-02-05 13:19:55 -05:00
Nick Cameron
6bd782c4ca Try to run compiler callbacks when we error out 2016-02-01 08:42:27 +13:00
Nick Cameron
b6e4f18e55 Replace some aborts with Results
Fixes #31207

by removing abort_if_new_errors
2016-02-01 08:42:27 +13:00
Nick Cameron
7b47f5e34e rebasing 2016-01-26 18:28:31 +13:00
Nick Cameron
0b511e82ab Initial work towards abort-free compilation
The goal is that the compiler will pass `Result`s around rather than using abort_if_errors. To preserve behaviour we currently abort at the top level. I've removed all other aborts from the driver, but haven't touched any of the nested aborts.
2016-01-26 17:51:11 +13:00
Nick Cameron
f3b525fb97 test fallout 2016-01-22 08:19:27 +13:00
Nick Cameron
0ac8915875 The war on abort_if_errors 2016-01-22 08:19:27 +13:00
Oliver Schneider
c124deca7b move more checks out of librustc 2016-01-21 10:52:37 +01:00
Oliver Schneider
1471d932a9 move const block checks before lowering step
this makes sure the checks run before typeck (which might use the constant or const
function to calculate an array length) and gives prettier error messages in case of for
loops and such (since they aren't expanded yet).
2016-01-15 13:16:54 +01:00
Matt Kraai
5fb15d0237 Replace --show-span with -Z show-span 2016-01-11 20:44:24 -08:00
Niko Matsakis
005fa14358 Annotate the compiler with information about what it is doing when. 2016-01-05 21:05:50 -05:00
Nick Cameron
95dc7efad0 use structured errors 2015-12-30 14:27:59 +13:00
Jonas Schievink
389e8e3b81 Delete the AST after lowering 2015-12-25 17:17:45 +01:00
Jonas Schievink
93a655940d ast_map => hir_map 2015-12-24 21:30:27 +01:00
Alex Crichton
617a7af704 syntax: Respect allow_internal_unstable in macros
This change modifies the feature gating of special `#[cfg]` attributes to not
require a `#![feature]` directive in the crate-of-use if the source of the macro
was declared with `#[allow_internal_unstable]`. This enables the standard
library's macro for `thread_local!` to make use of the
`#[cfg(target_thread_local)]` attribute despite it being feature gated (e.g.
it's a hidden implementation detail).
2015-12-21 22:05:37 -08:00
Seo Sanghyeon
f9ba107824 Move built-in syntax extensions to a separate crate 2015-12-15 15:04:46 +09:00
Vadim Petrochenkov
eb789de803 Do MTWT resolution during lowering to HIR 2015-12-05 00:40:21 +03:00
Niko Matsakis
ad1b998bb6 Now that MIR regressions are fixed, re-enable MIR for all users. 2015-12-02 15:11:01 -05:00
Ariel Ben-Yehuda
0a8bb4c509 split the metadata code into rustc_metadata
tests & rustdoc still broken
2015-11-26 18:22:40 +02:00
Ariel Ben-Yehuda
1430a35000 move librustc/plugin to librustc_plugin
this is a [breaking-change] to all plugin authors - sorry
2015-11-26 18:22:39 +02:00