about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2017-10-17Lifted generics into TraitItem and ImplItem from MethodSig -- HIR now ↵Sunjay Varma-8/+7
matches AST
2017-10-17Generate FirstStatementIndex using newtype_index macroSantiago Pastorino-21/+6
2017-10-17Rollup merge of #45097 - nivkner:fixme_fixup2, r=estebankkennytm-8/+4
address more FIXME whose associated issues were marked as closed part of #44366
2017-10-16fix nitsNiko Matsakis-1/+1
2017-10-16convert constant promotion into a queryNiko Matsakis-9/+53
2017-10-14rustc: Remove `used_mut_nodes` from `TyCtxt`Alex Crichton-0/+31
This updates the borrowck query to return a result, and this result is then used to incrementally check for unused mutable nodes given sets of all the used mutable nodes. Closes #42384
2017-10-12rustc: Handle `#[linkage]` anywhere in a crateAlex Crichton-0/+6
This commit updates the reachability pass of the compiler to seed the local worklist with `#[linkage]`-like items anywhere in a crate, not just those reachable from public items. Closes #45165
2017-10-08Rollup merge of #45058 - hunteke:fix_rustc_private_typo_2017Oct, r=shepmasterkennytm-1/+1
Fix typo, per #45057. This looks like a simple string -- one character -- fix. Given that I'm currently running low on battery, I have not actually compiled and tested this. But I am fully confident this passes muster. If not, I'll be maintainer-educated, yes? ;-)
2017-10-08address more FIXME whose associated issues were marked as closedNiv Kaminer-8/+4
update FIXME(#6298) to point to open issue 15020 update FIXME(#6268) to point to RFC 811 update FIXME(#10520) to point to RFC 1751 remove FIXME for emscripten issue 4563 and include target in `test_estimate_scaling_factor` remove FIXME(#18207) since node_id isn't used for `ref` pattern analysis remove FIXME(#6308) since DST was implemented in #12938 remove FIXME(#2658) since it was decided to not reorganize module remove FIXME(#20590) since it was decided to stay conservative with projection types remove FIXME(#20297) since it was decided that solving the issue is unnecessary remove FIXME(#27086) since closures do correspond to structs now remove FIXME(#13846) and enable `function_sections` for windows remove mention of #22079 in FIXME(#22079) since this is a general FIXME remove FIXME(#5074) since the restriction on borrow were lifted
2017-10-06implement pattern-binding-modes RFCTobias Schottdorf-1/+51
See the [RFC] and [tracking issue]. [tracking issue]: https://github.com/rust-lang/rust/issues/42640 [RFC]: https://github.com/rust-lang/rfcs/blob/491e0af/text/2005-match-ergonomics.md
2017-10-05Fix typo, per #45057.Kevin Hunter Kesling-1/+1
2017-10-01Fix typo: geneartor -> generatorThomas Jespersen-2/+2
2017-09-29Auto merge of #44847 - estebank:unused-signature, r=nikomatsakisbors-7/+21
Point at signature on unused lint ``` warning: struct is never used: `Struct` --> $DIR/unused-warning-point-at-signature.rs:22:1 | 22 | struct Struct { | ^^^^^^^^^^^^^ ``` Fix #33961.
2017-09-27Auto merge of #44782 - estebank:issue-36700, r=GuillaumeGomezbors-2/+2
Point at parameter type on E0301 On "the parameter type `T` may not live long enough" error, point to the parameter type suggesting lifetime bindings: ``` error[E0310]: the parameter type `T` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 | 27 | struct Foo<T> { | - help: consider adding an explicit lifetime bound `T: 'static`... 28 | foo: &'static T | ^^^^^^^^^^^^^^^ | note: ...so that the reference type `&'static T` does not outlive the data it points at --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 | 28 | foo: &'static T | ^^^^^^^^^^^^^^^ ``` Fix #36700.
2017-09-25Auto merge of #44279 - smaeul:crt_static-deps, r=alexcrichtonbors-39/+47
Require rlibs for dependent crates when linking static executables This handles the case for `CrateTypeExecutable` and `+crt_static`. I reworked the match block to avoid duplicating the `attempt_static` and error checking code again (this case would have been a copy of the `CrateTypeCdylib`/`CrateTypeStaticlib` case). On `linux-musl` targets where `std` was built with `crt_static = false` in `config.toml`, this change brings the test suite from entirely failing to mostly passing. This change should not affect behavior for other crate types, or for targets which do not respect `+crt_static`.
2017-09-25Point at signature on unused lintEsteban Küber-7/+21
2017-09-25Auto merge of #44809 - arielb1:small-scope, r=eddybbors-23/+117
encode region::Scope using fewer bytes Now that region::Scope is no longer interned, its size is more important. This PR encodes region::Scope in 8 bytes instead of 12, which should speed up region inference somewhat (perf testing needed) and should improve the margins on #36799 by 64MB (that's not a lot, I did this PR mostly to speed up region inference). This is a perf-sensitive PR. Please don't roll me up. r? @eddyb This is based on #44743 so I could get more accurate measurements on #36799.
2017-09-25fix Debug implsAriel Ben-Yehuda-2/+19
2017-09-25Auto merge of #44700 - arielb1:mir-effectck, r=nikomatsakisbors-316/+0
Move effect-checking to MIR This allows emitting lints from MIR and moves the effect-checking pass to work on it. I'll make `repr(packed)` misuse unsafe in a separate PR. r? @eddyb
2017-09-24Point at parameter type on E0301Esteban Küber-2/+2
On "the parameter type `T` may not live long enough" error, point to the parameter type suggesting lifetime bindings: ``` error[E0310]: the parameter type `T` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 | 27 | struct Foo<T> { | - help: consider adding an explicit lifetime bound `T: 'static`... 28 | foo: &'static T | ^^^^^^^^^^^^^^^ | note: ...so that the reference type `&'static T` does not outlive the data it points at --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 | 28 | foo: &'static T | ^^^^^^^^^^^^^^^ ```
2017-09-24encode region::Scope using fewer bytesAriel Ben-Yehuda-17/+28
Now that region::Scope is no longer interned, its size is more important. This PR encodes region::Scope in 8 bytes instead of 12, which should speed up region inference somewhat (perf testing needed) and should improve the margins on #36799 by 64MB (that's not a lot, I did this PR mostly to speed up region inference).
2017-09-24move Scope behind an enumAriel Ben-Yehuda-19/+85
2017-09-24move unsafety checking to MIRAriel Ben-Yehuda-316/+0
No functional changes intended.
2017-09-24put empty generic lists behind a pointerAriel Ben-Yehuda-1/+3
This reduces the size of hir::Expr from 128 to 88 bytes (!) and shaves 200MB out of #36799.
2017-09-23incr.comp.: Remove support for loading metadata fingerprints.Michael Woerister-0/+6
2017-09-23Rollup merge of #44658 - leodasvacas:remove-str-eq-lang-item, r=arielb1Corey Farwell-2/+0
Remove str_eq lang item It's not really a lang item. Also remove outdated note. The reference uses this as an example so it has to be updated.
2017-09-22Auto merge of #44696 - michaelwoerister:fingerprints-in-dep-graph-3, ↵bors-1/+2
r=nikomatsakis incr.comp.: Move task result fingerprinting into DepGraph. This PR - makes the DepGraph store all `Fingerprints` of task results, - allows `DepNode` to be marked as input nodes, - makes HIR node hashing use the regular fingerprinting infrastructure, - removes the now unused `IncrementalHashesMap`, and - makes sure that `traits_in_scope_map` fingerprints are stable. r? @nikomatsakis cc @alexcrichton
2017-09-21Refactor lifetime name into an enumTaylor Cramer-36/+48
2017-09-20Implement underscore lifetimesTaylor Cramer-2/+8
2017-09-20rebase fixupAriel Ben-Yehuda-0/+2
2017-09-20address review commentsAriel Ben-Yehuda-13/+53
2017-09-20add proofs and fix postorder traversalAriel Ben-Yehuda-4/+32
I don't think the "quasi-postorder" travesal could cause any issues, but there's no reason for it to stay broken.
2017-09-20Mark yields after visiting subexpressions. Never ignore yields for scopes in ↵John Kåre Alsaker-17/+17
bindings.
2017-09-20Sanity check the Expr visitation countJohn Kåre Alsaker-0/+16
2017-09-20Only consider yields coming after the expressions when computing generator ↵John Kåre Alsaker-13/+16
interiors
2017-09-20incr.comp.: Store result fingerprints in DepGraph.Michael Woerister-1/+2
2017-09-19Adjust dependency-resolution errors to be more consistentSamuel Holland-5/+5
2017-09-18Require rlibs for dependent crates when linking static executablesSamuel Holland-34/+42
This handles the case for `CrateTypeExecutable` and `+crt_static`. I reworked the match block to avoid duplicating the `attempt_static` and error checking code again (this case would have been a copy of the `CrateTypeCdylib`/`CrateTypeStaticlib` case). On `linux-musl` targets where `std` was built with `crt_static = false` in `config.toml`, this change brings the test suite from entirely failing to mostly passing. This change should not affect behavior for other crate types, or for targets which do not respect `+crt_static`.
2017-09-18incr.comp.: Fix rebase fallout.Michael Woerister-0/+84
2017-09-18incr.comp.: Remove tcx from StableHashingContext.Michael Woerister-2/+2
2017-09-18incr.comp.: Use StableHash impls instead of functions for hashing most maps.Michael Woerister-18/+7
2017-09-18incr.comp.: Already hash HIR bodies during metadata export so they don't ↵Michael Woerister-0/+22
have to be hashed in downstream crates.
2017-09-18Fix issues uncovered by rebasing:Michael Woerister-3/+14
- Don't hash traits in scope as part of HIR hashing any more. - Some queries returned DefIndexes from other crates. - Provide a generic way of stably hashing maps (not used everywhere yet).
2017-09-18incr.comp.: Compute hashes of all query results.Michael Woerister-2/+51
2017-09-18Use DefId instead of NodeId as identifier in resolve_lifetime::Region.Michael Woerister-17/+33
These Region values end up in crate metadata so they should not use NodeId.
2017-09-17rustc: Move codegen to a queryAlex Crichton-0/+31
This commit moves the actual code generation in the compiler behind a query keyed by a codegen unit's name. This ended up entailing quite a few internal refactorings to enable this, along with a few cut corners: * The `OutputFilenames` structure is now tracked in the `TyCtxt` as it affects a whole bunch of trans and such. This is now behind a query and threaded into the construction of the `TyCtxt`. * The `TyCtxt` now has a channel "out the back" intended to send data to worker threads in rustc_trans. This is used as a sort of side effect of the codegen query but morally what's happening here is the return value of the query (currently unit but morally a path) is only valid once the background threads have all finished. * Dispatching work items to the codegen threads was refactored to only rely on data in `TyCtxt`, which mostly just involved refactoring where data was stored, moving it from the translation thread to the controller thread's `CodegenContext` or the like. * A new thread locals was introduced in trans to work around the query system. This is used in the implementation of `assert_module_sources` which looks like an artifact of the old query system and will presumably go away once red/green is up and running.
2017-09-17rustc: Mostly remove `ExportedSymbols`Alex Crichton-55/+10
This is a big map that ends up inside of a `CrateContext` during translation for all codegen units. This means that any change to the map may end up causing an incremental recompilation of a codegen unit! In order to reduce the amount of dependencies here between codegen units and the actual input crate this commit refactors dealing with exported symbols and such into various queries. The new queries are largely based on existing queries with filled out implementations for the local crate in addition to external crates, but the main idea is that while translating codegen untis no unit needs the entire set of exported symbols, instead they only need queries about particulare `DefId` instances every now and then. The linking stage, however, still generates a full list of all exported symbols from all crates, but that's going to always happen unconditionally anyway, so no news there!
2017-09-17rustc: Move some attr methods to queriesAlex Crichton-2/+12
Otherwise we may emit double errors related to the `#[export_name]` attribute, for example, and using a query should ensure that it's only emitted at most once.
2017-09-17rustc: Make trans collect/partition a queryAlex Crichton-0/+69
This commit moves the `collect_and_partition_translation_items` function into a query on `TyCtxt` instead of a free function in trans, allowing us to track dependencies and such of the function.
2017-09-17rustc: Calculate `ExportedSymbols` in a queryAlex Crichton-0/+77
This commit moves the definition of the `ExportedSymbols` structure to the `rustc` crate and then creates a query that'll be used to construct the `ExportedSymbols` set. This in turn uses the reachablity query exposed in the previous commit.