Commit Graph

289 Commits

Author SHA1 Message Date
Tamir Duberstein
b3f50caee0
*: remove crate_{name,type} attributes
Fixes #41701.
2017-08-25 16:18:21 -04:00
Vadim Petrochenkov
de4dbe5789 rustc: Remove some dead code 2017-08-19 13:27:16 +03:00
Corey Farwell
a4387d54dc Rollup merge of #43891 - Fourchaux:master, r=steveklabnik
Fix typos & us spellings

Fixing some typos and non en-US spellings.

(Update of PR https://github.com/rust-lang/rust/pull/42812 )
2017-08-17 10:44:07 -04:00
Zack M. Davis
1b6c9605e4 use field init shorthand EVERYWHERE
Like #43008 (f668999), but _much more aggressive_.
2017-08-15 15:29:17 -07:00
Fourchaux
c7104be1a3 Fix typos & us spellings 2017-08-15 21:56:30 +02:00
Michael Woerister
7e09d1e170 async-llvm(18): Instantiate OngoingCrateTranslation before starting translation. 2017-07-31 15:15:09 +02:00
Alex Crichton
02219642bc rustc: Add some build scripts for librustc crates
This commit adds some "boilerplate" build scripts to librustc/libsyntax crates
to declare dependencies on various environment variables that are configured
throughout the build. Cargo recently gained the ability to depend on environment
variables in build scripts which can help trigger recompilation of a crate.

This should fix weird bugs where after you make a commit or a few days later
you'll get weird "not built with the same compiler" errors hopefully.
2017-07-22 22:04:13 -07:00
Michael Woerister
089860b603 incr.comp.: Manage dependency graph on main thread. 2017-07-10 12:21:39 +02:00
Michael Woerister
ca0a40396c incr.comp.: Improve debug output for work products. 2017-07-10 12:20:56 +02:00
Stjepan Glavina
66f8cddae5 Remove the remaining feature gates 2017-07-02 21:29:39 +02:00
Michael Woerister
12b11d8346 Print -Zincremental-info to stderr instead of stdout. 2017-06-22 10:27:51 +02:00
Alex Crichton
be7ebdd512 Bump version and stage0 compiler 2017-06-19 22:25:05 -07:00
Niko Matsakis
3f99118871 kill various tasks we no longer need and remove outdated README text
In the case of `TransCrateItem`, I had to tweak the tests a bit, but
it's a concept that doesn't work well under new system.
2017-06-12 16:00:31 -04:00
Michael Woerister
7f482808f9 incr.comp.: Clean up and optimize dep-graph loading. 2017-06-09 15:03:34 +02:00
Michael Woerister
3607174909 incr.comp.: Uniformly represent DepNodes as (Kind, StableHash) pairs. 2017-06-09 15:03:34 +02:00
Michael Woerister
8b36d3308e Allocate DefIndices for global crate metadata.
This allows for treating global crate metadata the same as regular metadata with regard to incr. comp.
2017-06-07 12:11:40 +02:00
Michael Woerister
12e5b699a4 incr.comp.: Make WorkProductId opaque so we don't accidentally rely on being able to reconstruct obj-file names from one. 2017-06-06 15:09:21 +02:00
Michael Woerister
b6e8635fef ICH: Make StableHashingContext work with any TyCtxt, not just the global one. 2017-06-06 13:50:13 +02:00
Michael Woerister
a3417bf302 incr.comp.: Use a more efficient encoding for the on-disk dependency graph. 2017-06-01 17:04:46 +02:00
Michael Woerister
0cbb8b58e8 incr.comp.: Use DefPathHash-based DepNodes in the serialized DepGraph and remove obsolete DefIdDirectory. 2017-05-31 16:42:52 +02:00
Michael Woerister
59ebe8e115 Make a newtype for DefPathHash so they are not confused with content hashes 2017-05-31 13:54:38 +02:00
Michael Woerister
21dd71f514 incr.comp.: Track expanded spans instead of FileMaps. 2017-05-23 18:20:51 +02:00
Michael Woerister
4549423f28 Use 128 instead of 64 bits for DefPath hashes 2017-05-18 11:10:11 +02:00
bors
4640e18572 Auto merge of #41911 - michaelwoerister:querify_trait_def, r=nikomatsakis
Remove interior mutability from TraitDef by turning fields into queries

This PR gets rid of anything `std::cell` in `TraitDef` by
- moving the global list of trait impls from `TraitDef` into a query,
- moving the list of trait impls relevent for some self-type from `TraitDef` into a query
- moving the specialization graph of trait impls into a query, and
- moving `TraitDef::object_safety` into a query.

I really like how querifying things not only helps with incremental compilation and on-demand, but also just plain makes the code cleaner `:)`

There are also some smaller fixes in the PR. Commits can be reviewed separately.

r? @eddyb or @nikomatsakis
2017-05-17 21:44:08 +00:00
Michael Woerister
c2d9b4e334 ICH: Hash lists of local trait impls as part of the HIR. 2017-05-15 15:27:49 +02:00
est31
0d0cb2796b librustc_incremental: remove unused macro in test case 2017-05-14 05:06:21 +02:00
bors
4f3886abf1 Auto merge of #41847 - alexcrichton:less-unstable-annotations, r=eddyb
rustc: Add a new `-Z force-unstable-if-unmarked` flag

This commit adds a new `-Z` flag to the compiler for use when bootstrapping the
compiler itself. We want to be able to use crates.io crates, but we also want
the usage of such crates to be as ergonomic as possible! To that end compiler
crates are a little tricky in that the crates.io crates are not annotated as
unstable, nor do they expect to pull in unstable dependencies.

To cover all these situations it's intended that the compiler will forever now
bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose
of forcing crates.io crates to themselves be unstable while also allowing them
to use other "unstable" crates.io crates. This should mean that adding a
dependency to compiler no longer requires upstream modification with
unstable/staged_api attributes for inclusion!
2017-05-13 05:22:08 +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
Michael Woerister
84a40c1443 ICH: Handle case of removed FileMaps. 2017-05-10 12:35:36 +02:00
bors
f3fc547194 Auto merge of #41709 - michaelwoerister:close-metadata-ich-holes, r=nikomatsakis
incr.comp.: Hash more pieces of crate metadata to detect changes there.

This PR adds incr. comp. hashes for non-`Entry` pieces of data in crate metadata.

The first part of it I like: `EntryBuilder` is refactored into the more generally applicable `IsolatedEncoder` which provides means of encoding something into metadata while also feeding the encoded data into an incr. comp. hash. We already did this for `Entry`, now we are doing it for various other pieces of data too, like the set of exported symbols and so on. The hashes generated there are persisted together with the per-`Entry` hashes and are also used for dep-graph dirtying the same way.

The second part of the PR I'm not entirely happy with: In order to make sure that we don't forget registering a read to the new `DepNodes` introduced here, I added the `Tracked<T>` struct. This struct wraps a value and requires a `DepNode` when accessing the wrapped value. This makes it harder to overlook adding read edges in the right places and works just fine.
However, crate metadata is already used in places where there is no `tcx` yet or even in places where no `cnum` has been assigned -- this makes it harder to apply this feature consistently or implement it ergonomically. The result is not too bad but there's a bit more code churn and a bit more opportunity to get something wrong than I would have liked. On the other hand, wrapping things in `Tracked<T>` already has revealed some bugs, so there's definitely some value in it.

This is still a work in progress:
- [x] I need to write some test cases.
- [x] Accessing the CodeMap should really be dependency tracked too, especially with the new path-remapping feature.

cc @nikomatsakis
2017-05-09 11:55:37 +00:00
Oliver Schneider
dd87eabd83 Remove need for &format!(...) or &&"" dances in span_label calls 2017-05-08 12:56:15 +02:00
Michael Woerister
6a5e2a5a9e incr.comp.: Hash more pieces of crate metadata to detect changes there. 2017-05-08 12:31:26 +02:00
Niko Matsakis
e8f6fbb255 allow dep-graph assertions on fields 2017-05-03 16:42:07 -04:00
Alex Crichton
5daf557a77 Update stage0 bootstrap compiler
We've got a freshly minted beta compiler, let's update to use that on nightly!
This has a few other changes associated with it as well

* A bump to the rustc version number (to 1.19.0)
* Movement of the `cargo` and `rls` submodules to their "proper" location in
  `src/tools/{cargo,rls}`. Now that Cargo workspaces support the `exclude`
  option this can work.
* Updates of the `cargo` and `rls` submodules to their master branches.
* Tweak to the `src/stage0.txt` format to be more amenable for Cargo version
  numbers. On the beta channel Cargo will bootstrap from a different version
  than rustc (e.g. the version numbers are different), so we need different
  configuration for this.
* Addition of `dev` as a readable key in the `src/stage0.txt` format. If present
  then stage0 compilers are downloaded from `dev-static.rust-lang.org` instead
  of `static.rust-lang.org`. This is added to accomodate our updated release
  process with Travis and AppVeyor.
2017-04-29 12:11:14 -07:00
Eduard-Mihai Burtescu
6dc21b71cf rustc: use monomorphic const_eval for cross-crate enum discriminants. 2017-04-16 01:31:37 +03:00
Michael Woerister
ca2dce9b48 ICH: Replace old, transitive metadata hashing with direct hashing approach.
Instead of collecting all potential inputs to some metadata entry and
hashing those, we directly hash the values we are storing in metadata.
This is more accurate and doesn't suffer from quadratic blow-up when
many entries have the same dependencies.
2017-04-12 11:47:26 +02:00
Michael Woerister
bb6387295a SVH: Don't hash the HIR twice when once is enough.
The SVH (Strict Version Hash) of a crate is currently computed
by hashing the ICHes (Incremental Computation Hashes) of the
crate's HIR. This is fine, expect that for incr. comp. we compute
two ICH values for each HIR item, one for the complete item and
one that just includes the item's interface. The two hashes are
are needed for dependency tracking but if we are compiling
non-incrementally and just need the ICH values for the SVH,
one of them is enough, giving us the opportunity to save some
work in this case.
2017-04-07 14:37:48 +02:00
Michael Woerister
edc1ac3016 ICH: Centrally compute and cache DefPath hashes as part of DefPathTable. 2017-04-07 14:36:51 +02:00
Michael Woerister
c47cdc0d93 Introduce HashStable trait and base ICH implementations on it.
This initial commit provides implementations for HIR, MIR, and
everything that also needs to be supported for those two.
2017-04-06 16:01:51 +02:00
bors
5c94997b6b Auto merge of #40524 - alexcrichton:update-bootstrap, r=alexcrichton
rustbuild: Update bootstrap compiler

Now that we've also updated cargo's release process this commit also changes the
download location of Cargo from Cargos archives back to the static.r-l.o
archives. This should ensure that the Cargo download is the exact Cargo paired
with the rustc that we release.
2017-03-30 17:10:11 +00:00
Alex Crichton
c033942925 rustbuild: Update bootstrap compiler
Now that we've also updated cargo's release process this commit also changes the
download location of Cargo from Cargos archives back to the static.r-l.o
archives. This should ensure that the Cargo download is the exact Cargo paired
with the rustc that we release.
2017-03-29 08:55:15 -07:00
Jeffrey Seyfried
ec7c0aece1 Merge ExpnId and SyntaxContext. 2017-03-29 00:41:10 +00: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
Michael Woerister
03b8091d10 Move some constants to rustc::ich. 2017-03-22 09:14:24 +01:00
Michael Woerister
9af97e7ff2 Move CachingCodemapView to rustc::ich. 2017-03-22 09:14:24 +01:00
Michael Woerister
1445ed272e Move DefPathHashes to rustc::ich 2017-03-22 09:14:24 +01:00
Michael Woerister
8c00e63f3f Move Fingerprint to rustc::ich::Fingerprint. 2017-03-22 09:14:24 +01:00
Corey Farwell
17656ab328 Rollup merge of #40556 - cramertj:stabilize-pub-restricted, r=petrochenkov
Stabilize pub(restricted)

Fix https://github.com/rust-lang/rust/issues/32409
2017-03-20 23:44:59 -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