about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2019-01-27Add some size assertions for const eval typesOliver Scherer-0/+6
2019-01-27Fix indentationOliver Scherer-1/+1
2019-01-27Create `nvptx64-nvidia-cuda` target specificationDenys Zariaiev-0/+6
2019-01-26remove `_with_applicability` from suggestion fnsAndy Russell-1/+1
2019-01-26Auto merge of #55641 - nagisa:optimize-attr, r=pnkfelixbors-1/+11
Implement optimize(size) and optimize(speed) attributes This PR implements both `optimize(size)` and `optimize(speed)` attributes. While the functionality itself works fine now, this PR is not yet complete: the code might be messy in places and, most importantly, the compiletest must be improved with functionality to run tests with custom optimization levels. Otherwise the new attribute cannot be tested properly. Oh, and not all of the RFC is implemented – attribute propagation is not implemented for example. # TODO * [x] Improve compiletest so that tests can be written; * [x] Assign a proper error number (E9999 currently, no idea how to allocate a number properly); * [ ] Perhaps reduce the duplication in LLVM attribute assignment code…
2019-01-25Auto merge of #57898 - Centril:rollup, r=Centrilbors-10/+0
Rollup of 5 pull requests Successful merges: - #56233 (Miri and miri-related code contains repetitions of `(n << amt) >> amt`) - #57645 (distinguish "no data" from "heterogeneous" in ABI) - #57734 (Fix evaluating trivial drop glue in constants) - #57886 (Add suggestion for moving type declaration before associated type bindings in generic arguments.) - #57890 (Fix wording in diagnostics page) Failed merges: r? @ghost
2019-01-25Rollup merge of #57734 - oli-obk:fixes_and_cleanups, r=pnkfelixMazdak Farrokhzad-10/+0
Fix evaluating trivial drop glue in constants ```rust struct A; impl Drop for A { fn drop(&mut self) {} } const FOO: Option<A> = None; const BAR: () = (FOO, ()).1; ``` was erroring with ``` error: any use of this value will cause an error --> src/lib.rs:9:1 | 9 | const BAR: () = (FOO, ()).1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^-^ | | | calling non-const function `std::ptr::real_drop_in_place::<(std::option::Option<A>, ())> - shim(Some((std::option::Option<A>, ())))` | = note: #[deny(const_err)] on by default error: aborting due to previous error ``` before this PR. According to godbolt this last compiled successfully in 1.27
2019-01-25Auto merge of #57714 - matthewjasper:wellformed-unreachable, r=pnkfelixbors-19/+40
[NLL] Clean up handling of type annotations * Renames (Canonical)?UserTypeAnnotation -> (Canonical)?UserType so that the name CanonicalUserTypeAnnotation is free. * Keep the inferred type associated to user type annotations in the MIR, so that it can be compared against the annotated type, even when the annotated expression gets removed from the MIR. (#54943) * Use the inferred type to allow infallible handling of user type projections (#57531) * Uses revisions for the tests in #56993 * Check the types of `Unevaluated` constants with no annotations (#46702) * Some drive-by cleanup Closes #46702 Closes #54943 Closes #57531 Closes #57731 cc #56993 leaving this open to track the underlying issue: we are not running tests with full NLL enabled on CI at the moment r? @nikomatsakis
2019-01-25Rollup merge of #57802 - davidtwco:issue-56943, r=estebankMazdak Farrokhzad-14/+14
Print visible name for types as well as modules. Fixes #56943 and fixes #57713. This commit extends previous work in #55007 where the name from the visible parent was used for modules. Now, we also print the name from the visible parent for types. r? @estebank
2019-01-25Rollup merge of #57652 - mark-i-m:remove-old, r=nikomatsakisMazdak Farrokhzad-301/+2
Update/remove some old readmes r? @nikomatsakis cc #48478 There are a bunch of READMEs with content that I would like to see a final decision made on: - https://github.com/rust-lang/rust/tree/master/src/librustc/ty/query - https://github.com/rust-lang/rust/tree/master/src/librustc/dep_graph - https://github.com/rust-lang/rust/blob/master/src/librustc/infer/region_constraints - https://github.com/rust-lang/rust/tree/master/src/librustc/infer/higher_ranked - https://github.com/rust-lang/rust/tree/master/src/librustc/infer/lexical_region_resolve - https://github.com/rust-lang/rust/blob/master/src/librustc_borrowck/borrowck It's not clear how useful or obsolete any of these are. I would really appreciate if the appropriate domain experts for each of these could respond with one of (a) delete it, (b) wait for system to be remove, or (c) move it to rustc-guide. @nikomatsakis do you know who to ping for any of these (sorry, I suspect many of them are you)?
2019-01-24Implement optimize(size) and optimize(speed)Simonas Kazlauskas-1/+11
2019-01-21Print visible name for types as well as modules.David Wood-14/+14
This commit extends previous work in #55007 where the name from the visible parent was used for modules. Now, we also print the name from the visible parent for types.
2019-01-19Handle lifetime annotations in unreachable codeMatthew Jasper-2/+3
We equate the type in the annotation with the inferred type first so that we have a fully inferred type to perform the well-formedness check on.
2019-01-19Use a struct for user type annotationsMatthew Jasper-2/+22
2019-01-19Rename CanonicalUserTypeAnnotation -> CanonicalUserTypeMatthew Jasper-7/+7
We want the name `CanonicalUserTypeAnnotation` for our own use.
2019-01-19Rename UserTypeAnnotation -> UserTypeMatthew Jasper-13/+13
2019-01-19Rollup merge of #57502 - nikomatsakis:fix-trait-alias-1b, r=nikomatsakisMazdak Farrokhzad-12/+10
make trait-aliases work across crates This is rebase of a small part of @alexreg's PR #55994. It focuses just on the changes that integrate trait aliases properly into crate metadata, excluding the stylistic edits and the trait objects. The stylistic edits I also rebased and can open a separate PR. The trait object stuff I found challenging and decided it basically needed to be reimplemented. For now I've excluded it. Since this is really @alexreg's work (I really just rebased) I am going to make it r=me once it is working. Fixes #56488. Fixes #57023.
2019-01-19Auto merge of #57752 - Centril:rollup, r=Centrilbors-12/+26
Rollup of 10 pull requests Successful merges: - #57268 (Add a target option "merge-functions", and a corresponding -Z flag (works around #57356)) - #57476 (Move glob map use to query and get rid of CrateAnalysis) - #57501 (High priority resolutions for associated variants) - #57573 (Querify `entry_fn`) - #57610 (Fix nested `?` matchers) - #57634 (Remove an unused function argument) - #57653 (Make the contribution doc reference the guide more) - #57666 (Generalize `huge-enum.rs` test and expected stderr for more cross platform cases) - #57698 (Fix typo bug in DepGraph::try_mark_green().) - #57746 (Update README.md) Failed merges: r? @ghost
2019-01-19Rollup merge of #57573 - Xanewok:querify-entry-fn, r=ZoxcMazdak Farrokhzad-1/+11
Querify `entry_fn` Analogous to https://github.com/rust-lang/rust/pull/57570 but this will also require few fixups in Miri so I decided to separate that (and it seems [CI doesn't let us break tools anymore](https://github.com/rust-lang/rust/pull/57392#issuecomment-453801540)? Or was that because it was a rollup PR?) r? @nikomatsakis
2019-01-19Rollup merge of #57476 - Xanewok:bye-crate-analysis, r=ZoxcMazdak Farrokhzad-11/+15
Move glob map use to query and get rid of CrateAnalysis ~Also includes commits from ~https://github.com/rust-lang/rust/pull/57392~ and ~https://github.com/rust-lang/rust/pull/57436~.~ With glob map calculated unconditionally in https://github.com/rust-lang/rust/pull/57392, this PR moves the calculated glob map to `GlobalCtxt` and exposes a relevant query (as we do with other queries which copy precomputed data over from the `Resolver`). This allows us to get rid of the `CrateAnalysis` struct in an attempt to simplify the compiler interface. cc @Zoxc r? @nikomatsakis @Zoxc @petrochenkov
2019-01-19Auto merge of #57253 - Zoxc:incr-passes2, r=michaelwoeristerbors-0/+36
Make privacy checking, intrinsic checking and liveness checking incremental Blocked on https://github.com/rust-lang/rust/pull/51487 r? @michaelwoerister
2019-01-18remove more old readmesmark-301/+2
2019-01-18Auto merge of #57065 - Zoxc:graph-tweaks, r=michaelwoeristerbors-41/+8
Optimize try_mark_green and eliminate the lock on dep node colors Blocked on https://github.com/rust-lang/rust/pull/56614 r? @michaelwoerister
2019-01-18Manually inline a function that was only used onceOliver Scherer-10/+0
2019-01-17Querify glob map usage (last use of CrateAnalysis)Igor Matuszewski-11/+15
2019-01-17Avoid erase_regions_ty queries if there are no regions to eraseBjörn Steinbrink-1/+6
It's overall faster to perform this extra check than to perform the query, even if the result is already in the query cache.
2019-01-16Auto merge of #57392 - Xanewok:always-calc-glob-map, r=petrochenkovbors-1/+1
Always calculate glob map but only for glob uses Previously calculating glob map was *opt-in*, however it did record node id -> ident use for every use directive. This aims to see if we can unconditionally calculate the glob map and not regress performance. Main motivation is to get rid of some of the moving pieces and simplify the compilation interface - this would allow us to entirely remove `CrateAnalysis`. Later, we could easily expose a relevant query, similar to the likes of `maybe_unused_trait_import` (so using precomputed data from the resolver, but which could be rewritten to be on-demand). r? @nikomatsakis Local perf run showed mostly noise (except `ctfe-stress-*`) but I'd appreciate if we could do a perf run run here and double-check that this won't regress performance.
2019-01-15Make the query comment into a doc commentIgor Matuszewski-1/+2
2019-01-15Querify entry_fnIgor Matuszewski-1/+10
2019-01-15Optimize try_mark_green and eliminate the lock on dep node colorsJohn Kåre Alsaker-41/+8
2019-01-15Make privacy checking, intrinsic checking and liveness checking incrementalJohn Kåre Alsaker-0/+36
2019-01-14Rollup merge of #57480 - Zoxc:query-fix, r=michaelwoeristerMazdak Farrokhzad-20/+21
Clean up and fix a bug in query plumbing r? @michaelwoerister
2019-01-13Auto merge of #57580 - Centril:rollup, r=Centrilbors-45/+66
Rollup of 4 pull requests Successful merges: - #56874 (Simplify foreign type rendering.) - #57113 (Move diagnostics out from QueryJob and optimize for the case with no diagnostics) - #57366 (Point at match discriminant on type error in match arm pattern) - #57538 (librustc_mir: Fix ICE with slice patterns) Failed merges: - #57381 (Tweak output of type mismatch between "then" and `else` `if` arms) r? @ghost
2019-01-13Rollup merge of #57113 - Zoxc:query-perf10, r=michaelwoeristerMazdak Farrokhzad-45/+66
Move diagnostics out from QueryJob and optimize for the case with no diagnostics r? @michaelwoerister
2019-01-13Auto merge of #51487 - Zoxc:incr-passes, r=michaelwoeristerbors-1/+63
Make more passes incremental r? @michaelwoerister
2019-01-13Always calculate glob map but only for glob usesIgor Matuszewski-1/+1
Previously calculating glob map was *opt-in*, however it did record node id -> ident use for every use directive. This aims to see if we can unconditionally calculate the glob map and not regress performance.
2019-01-13Rollup merge of #57547 - Xanewok:ptr-eq, r=petrochenkovMazdak Farrokhzad-10/+7
Use `ptr::eq` where applicable Stumbled upon a few of `A as *const _ as usize == B as *const as usize`, so I decided to follow the programming boy scout rule (:smile:) and replaced the pattern with more widely used `ptr::eq`.
2019-01-12Use `ptr::eq` where applicableIgor Matuszewski-10/+7
2019-01-12Rollup merge of #57042 - ↵Mazdak Farrokhzad-1/+5
pnkfelix:issue-57038-sidestep-ice-in-fieldplacement-count, r=michaelwoerister Don't call `FieldPlacement::count` when count is too large Sidestep ICE in `FieldPlacement::count` by not calling it when count will not fit in host's usize. (I briefly played with trying to fix this by changing `FieldPlacement::count` to return a `u64`. However, based on how `FieldPlacement` is used, it seems like this would be a largely pointless pursuit... I'm open to counter-arguments, however.) Fix #57038
2019-01-11Make more passes incrementalJohn Kåre Alsaker-1/+63
2019-01-10integrate trait aliases into def-paths / metadataNiko Matsakis-12/+10
Co-authored-by: Alexander Regueiro <alexreg@me.com>
2019-01-09Clean up and fix a bug in query plumbingJohn Kåre Alsaker-20/+21
2019-01-08[Cleanup] This is the first in the series of removals of with_freevars usage.Blitzerr-2/+2
Currently, there are many places in rustc, where we use with_freevars to iterate over freevars of a closure. The problem with this is the argument to with_freevars is a NodeId and this will get in the way of our eventual goal of solving for issue (#53488), sub-issue (#56905)
2019-01-08Some more refactoring.Blitzerr-2/+1
Change the key of UpvarListMap from DefId to ast::NodeId
2019-01-08Issue 56905Blitzerr-0/+12
Adding a map to TypeckTables to get the list of all the Upvars given a closureID. This is help us get rid of the recurring pattern in the codebase of iterating over the free vars using with_freevars.
2019-01-08Move diagnostics out from QueryJob and optimize for the case with no diagnosticsJohn Kåre Alsaker-45/+66
2019-01-08Auto merge of #57114 - Zoxc:query-perf11, r=michaelwoeristerbors-6/+6
Clean up and optimize OpenTask / read_index r? @michaelwoerister
2019-01-08Auto merge of #57095 - Zoxc:prof-fix, r=michaelwoeristerbors-23/+31
Fix and optimize query profiling r? @michaelwoerister cc @wesleywiser
2019-01-07Rename some functionsJohn Kåre Alsaker-3/+3
2019-01-07Fix and optimize query profilingJohn Kåre Alsaker-23/+31