Commit Graph

231 Commits

Author SHA1 Message Date
Corey Farwell
80e14a0fe3 Rollup merge of #42766 - nrc:versions, r=nagisa
Update rls-data version

And update the RLS submod
2017-06-21 10:40:17 -04:00
Nick Cameron
7a18a77e1b Update rls-data dep 2017-06-20 18:55:14 +12:00
Alex Crichton
be7ebdd512 Bump version and stage0 compiler 2017-06-19 22:25:05 -07:00
bors
08d920cd4d Auto merge of #42650 - nrc:save-slim, r=eddyb
save-analysis: remove a lot of stuff

This commits us to the JSON format and the more general def/ref style of output, rather than also supporting different data formats for different data structures. This does not affect the RLS at all, but will break any clients of the CSV form - AFAIK there are none (beyond a few of my own toy projects) - DXR stopped working long ago.

r? @eddyb
2017-06-17 04:36:02 +00:00
Nick Cameron
8a2857e644 Remove intermediate forms and some other refactoring 2017-06-16 12:52:37 +12:00
Taylor Cramer
c98ca953b0 Switch CrateNum queries to DefId 2017-06-14 22:49:07 -07:00
Taylor Cramer
48356987c1 On-demandify extern_crate 2017-06-14 00:13:35 -07:00
Nick Cameron
9a471606c0 Remove CSV format of save-analysis data 2017-06-14 10:45:59 +12:00
Nick Cameron
d438b8180c Fix a bug where Json API save-analysis was not labelled as such 2017-06-12 14:14:23 +12:00
Nick Cameron
cb7fcdd520 Impl and trait item sigs 2017-06-12 14:14:23 +12:00
Nick Cameron
5ebb0e2498 Implement a bunch more signature functions 2017-06-12 14:14:23 +12:00
Nick Cameron
35abf139a2 Small refactoring + docs 2017-06-12 14:14:23 +12:00
Nick Cameron
a2a999f035 Use the new signature stuff
And fix a couple of bugs
2017-06-12 14:14:23 +12:00
Nick Cameron
0058fdd110 Update rls-data 2017-06-12 14:14:23 +12:00
Nick Cameron
600237fa19 Add a sig module to save-analysis
Generates signatures for use in Rustdoc and similar tools.
2017-06-12 14:14:23 +12:00
bors
4ed2edaafe Auto merge of #42281 - eddyb:well-adjusted, r=nikomatsakis
Decompose Adjustment into smaller steps and remove the method map.

The method map held method callee information for:
* actual method calls (`x.f(...)`)
* overloaded unary, binary, indexing and call operators
* *every overloaded deref adjustment* (many can exist for each expression)

That last one was a historical ~~accident~~ hack, and part of the motivation for this PR, along with:
* a desire to compose adjustments more freely
* containing the autoderef logic better to avoid mutation within an inference snapshot
* not creating `TyFnDef` types which are incompatible with the original one
  * i.e. we used to take a`TyFnDef`'s `for<'a> &'a T -> &'a U` signature and instantiate `'a` using a region inference variable, *then* package the resulting `&'b T -> &'b U` signature in another `TyFnDef`, while keeping *the same* `DefId` and `Substs`
* to fix #3548 by explicitly writing autorefs for the RHS of comparison operators

Individual commits tell their own story, of "atomic" changes avoiding breaking semantics.

Future work based on this PR could include:
* removing the signature from `TyFnDef`, now that it's always "canonical"
  * some questions of variance remain, as subtyping *still* treats the signature differently
* moving part of the typeck logic for methods, autoderef and coercion into `rustc::traits`
* allowing LUB coercions (joining multiple expressions) to "stack up" many adjustments
* transitive coercions (e.g. reify or unsize after multiple steps of autoderef)

r? @nikomatsakis
2017-06-01 11:34:13 +00:00
Eduard-Mihai Burtescu
552ab37a10 rustc: replace method_map with Def::Method and node_substs entries. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
b4988f0792 rustc: keep overloaded autoderef MethodCallee's in Adjust. 2017-06-01 08:59:47 +03:00
Tobias Schottdorf
e5e664fb07 Upgrade ProjectionTy's Name to a DefId
Part of #42171, in preparation for downgrading the contained `TraitRef` to
only its `substs`.
2017-05-31 12:35:13 -04:00
Jeffrey Seyfried
7fdc1fb2e4 Hygienize lifetimes. 2017-05-25 05:52:09 +00:00
bors
93dd1cab5d Auto merge of #41919 - nrc:save-crate, r=eddyb
Include the crate's root module in save-analysis

r? @eddyb
2017-05-13 22:58:04 +00:00
Alex Crichton
ab54f4b226 rustc: Remove #![unstable] annotation
These are now no longer necessary with `-Z force-unstable-if-unmarked`
2017-05-11 16:03:05 -07:00
Nick Cameron
fb7ba4772c Pass crate attributes in visit.rs 2017-05-12 07:15:29 +12:00
Nick Cameron
67a0d27c65 Ensure we walk the root module of the crate 2017-05-11 17:45:27 +12:00
Nick Cameron
7bed5437fa Update save-analysis deps and RLS submodule 2017-05-09 07:15:48 +12:00
Niko Matsakis
3039398c68 convert save-analysis to use ItemCtxt and not ast_ty_to_ty_cache 2017-05-03 21:33:15 -04:00
est31
d290849a23 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.
2017-05-02 05:55:20 +02:00
bors
128aa262e8 Auto merge of #41368 - nikomatsakis:incr-comp-dep-tracking-map, r=eddyb
make *most* maps private

Currently we access the `DepTrackingMap` fields directly rather than using the query accessors. This seems bad. This branch removes several such uses, but not all, and extends the macro so that queries can hide their maps (so we can prevent regressions). The extension to the macro is kind of ugly :/ but couldn't find a simple way to do it otherwise (I guess I could use a nested macro...). Anyway I figure it's only temporary.

r? @eddyb
2017-04-28 18:53:24 +00:00
Niko Matsakis
d7d3f197f6 introduce ability to if we have typeck-tables for a given def-id
And use this in save-analysis, which used to read the map directly.
This is an attempt to sidestep the failure occuring on homu that I
cannot reproduce.
2017-04-28 10:02:06 -04:00
bors
2971d491b9 Auto merge of #41508 - michaelwoerister:generic-path-remapping, r=alexcrichton
Implement a file-path remapping feature in support of debuginfo and reproducible builds

This PR adds the `-Zremap-path-prefix-from`/`-Zremap-path-prefix-to` commandline option pair and is a more general implementation of #41419. As opposed to the previous attempt, this implementation should enable reproducible builds regardless of the working directory of the compiler.

This implementation of the feature is more general in the sense that the re-mapping will affect *all* paths the compiler emits, including the ones in error messages.

r? @alexcrichton
2017-04-28 12:09:37 +00:00
Niko Matsakis
d26a7a48fe do not access typeck_tables map directly 2017-04-28 04:15:03 -04:00
bors
54ef80043a Auto merge of #37860 - giannicic:defaultimpl, r=nagisa
#37653 support `default impl` for specialization

this commit implements the first step of the `default impl` feature:

> all items in a `default impl` are (implicitly) `default` and hence
> specializable.

In order to test this feature I've copied all the tests provided for the
`default` method implementation (in run-pass/specialization and
compile-fail/specialization directories) and moved the `default` keyword
from the item to the impl.
See [referenced](https://github.com/rust-lang/rust/issues/37653) issue for further info

r? @aturon
2017-04-27 02:48:17 +00:00
Michael Woerister
39ffea31df Implement a file-path remapping feature in support of debuginfo and reproducible builds. 2017-04-26 15:44:02 +02:00
Gianni Ciccarelli
715811d0be support default impl for specialization
pr review
2017-04-25 05:28:22 +00:00
Eduard-Mihai Burtescu
612bb1f54e rustc: rename some of the queries to match tcx methods. 2017-04-24 15:20:52 +03:00
Gianni Ciccarelli
116e9831a5 support default impl for specialization
this commit implements the first step of the `default impl` feature:
all items in a `default impl` are (implicitly) `default` and hence
specializable.
In order to test this feature I've copied all the tests provided for the
`default` method implementation (in run-pass/specialization and
compile-fail/specialization directories) and moved the `default` keyword
from the item to the impl.
See referenced issue for further info
2017-04-24 10:08:48 +00:00
A.J. Gardner
768e902941 First attempt at global_asm! macro 2017-04-12 19:12:49 -05:00
Nick Cameron
d76daf5c61 rebased 2017-04-04 16:08:00 +12:00
Nick Cameron
ccdbb31a47 save-analysis: index extern blocks 2017-04-04 15:56:47 +12:00
Nick Cameron
4143d409ee save-analysis: only index path references once 2017-04-04 15:56:46 +12:00
bors
5309a3e31d Auto merge of #40915 - nrc:save-assoc, r=eddyb
save-analysis: track associated types

r? @eddyb
2017-04-03 03:26:09 +00:00
Nick Cameron
e3acebff66 save-analysis: track associated types 2017-03-30 12:14:04 +13:00
Jeffrey Seyfried
f08d5ad4c5 Refactor how spans are combined in the parser. 2017-03-29 11:17:59 +00:00
Jeffrey Seyfried
ec7c0aece1 Merge ExpnId and SyntaxContext. 2017-03-29 00:41:10 +00:00
Alex Crichton
51371157e2 Rollup merge of #40751 - nrc:save-callback, r=eddyb
save-analysis: allow clients to get data directly without writing to a file.
2017-03-27 15:56:23 -07:00
Oliver Schneider
eb447f4ef4
Fix various useless derefs and slicings 2017-03-27 08:58:00 +02:00
Alex Crichton
e341d603fe Remove internal liblog
This commit deletes the internal liblog in favor of the implementation that
lives on crates.io. Similarly it's also setting a convention for adding crates
to the compiler. The main restriction right now is that we want compiler
implementation details to be unreachable from normal Rust code (e.g. requires a
feature), and by default everything in the sysroot is reachable via `extern
crate`.

The proposal here is to require that crates pulled in have these lines in their
`src/lib.rs`:

    #![cfg_attr(rustbuild, feature(staged_api, rustc_private))]
    #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))]

This'll mean that by default they're not using these attributes but when
compiled as part of the compiler they do a few things:

* Mark themselves as entirely unstable via the `staged_api` feature and the
  `#![unstable]` attribute.
* Allow usage of other unstable crates via `feature(rustc_private)` which is
  required if the crate relies on any other crates to compile (other than std).
2017-03-23 11:28:00 -07:00
Nick Cameron
3ec61ea921 save-analysis: allow clients to get data directly without writing to a file 2017-03-23 16:32:49 +13:00
Corey Farwell
dedf9d3593 Rollup merge of #40554 - nrc:rls-data, r=alexcrichton
Use rls-data crate

This basically pulls out a bunch of data structures used by save-analysis for serialization into an external crate, and pulls that crate in using Rustbuild. The RLS can then share these data structures with the compiler which in some cases will allow more efficient communication between the compiler and the RLS (i.e., without serialisation).

Along the way, I have to pull in rls-span, which is the RLS's way of defining spans (more type-safe than the compiler's built-in way). This is basically just to convert from compiler spans to RLS spans.

I also pull in the crates.io version of rustc-serialize, which is a bit annoying, but seems to be the only way to have serialisable data in an external crate. To make this work, all of the save-analysis crate has to use this version too (cc #40527).

Finally I pull in a line from #40347 to make the unstable crate checking stuff working.

There are a lot of changes to save-analysis but they are all mechanical and trivial - changing from using `From` to `Into` (because of orphan rules) being the main thing.

r? @alexcrichton
2017-03-19 20:51:10 -04:00
bors
6eb9960d36 Auto merge of #39799 - dpc:create_dir_all, r=alexcrichton
Fix race condition in fs::create_dir_all

The code would crash if the directory was created after create_dir_all
checked whether the directory already existed.  This was contrary to
the documentation which claimed to create the directory if it doesn't
exist, implying (but not stating) that there would not be a failure
due to the directory existing.
2017-03-19 21:02:53 +00:00