summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2019-02-25Rollup merge of #58690 - kenta7777:reduce-code-repetition-miri-related, ↵Mazdak Farrokhzad-3/+2
r=oli-obk Reduce a Code Repetition like `(n << amt) >> amt` Fixes a part of [#49937](https://github.com/rust-lang/rust/issues/49937).
2019-02-24Rollup merge of #58511 - oli-obk:const_to_op, r=RalfJungMazdak Farrokhzad-2/+2
Const to op simplification r? @RalfJung alternative to https://github.com/rust-lang/rust/pull/58486
2019-02-24reduce a code repetition like (n << amt) >> amtkenta7777-3/+2
2019-02-21restore the actual leak-checkNiko Matsakis-1/+23
2019-02-20Auto merge of #58578 - kennytm:rollup, r=kennytmbors-5/+5
Rollup of 24 pull requests Successful merges: - #56470 (Modify doctest's auto-`fn main()` to allow `Result`s) - #58044 (Make overflowing and wrapping negation const) - #58303 (Improve stability tags display) - #58336 (Fix search results interactions) - #58384 (Fix tables display) - #58392 (Use less explicit shifting in std::net::ip) - #58409 (rustdoc: respect alternate flag when formatting impl trait) - #58456 (Remove no longer accurate diagnostic code about NLL) - #58528 (Don't use an allocation for ItemId in StmtKind) - #58530 (Monomorphize less code in fs::{read|write}) - #58534 (Mention capping forbid lints) - #58536 (Remove UB in pointer tests) - #58538 (Add missing fmt structs examples) - #58539 (Add alias methods to PathBuf for underlying OsString (#58234)) - #58544 (Fix doc for rustc "-g" flag) - #58545 (Add regression test for a specialization-related ICE (#39448)) - #58546 (librustc_codegen_llvm => 2018) - #58551 (Explain a panic in test case net::tcp::tests::double_bind) - #58553 (Use more impl header lifetime elision) - #58562 (Fix style nits) - #58565 (Fix typo in std::future::Future docs) - #58568 (Fix a transposition in driver.rs.) - #58569 (Reduce Some Code Repetitions like `(n << amt) >> amt`) - #58576 (Stabilize iter::successors and iter::from_fn)
2019-02-19Auto merge of #57896 - oli-obk:permissive_existence, r=cramertjbors-2/+13
Be more permissive with required bounds on existential types fixes #54184 r? @pnkfelix
2019-02-18Fix style nitsDan Robertson-5/+5
Fix style nits discovered in reading code.
2019-02-16Reuse the `Pointer` type instead of passing reassembling it at many use sitesOliver Scherer-2/+2
2019-02-15Remove `stolen`John Kåre Alsaker-4/+0
2019-02-15Always emit an error for a query cycleJohn Kåre Alsaker-150/+103
2019-02-14Rollup merge of #58309 - wesleywiser:add_more_profiler_events, ↵Mazdak Farrokhzad-2/+15
r=michaelwoerister Add more profiler events - Adds Start\Stop events for time spent loading incremental query results from disk. - Adds Start\Stop events for time spent blocked waiting for queries to complete (when parallel queries are enabled). r? @michaelwoerister
2019-02-13Rollup merge of #58386 - Zoxc:fix-54242, r=michaelwoeristerMazdak Farrokhzad-58/+56
Fix #54242 r? @michaelwoerister
2019-02-13HirId-ify hir::BodyIdljedrz-13/+13
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-18/+19
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-13Rollup merge of #58137 - ljedrz:cleanup_node_id_to_type, r=estebankMazdak Farrokhzad-18/+9
Cleanup: rename node_id_to_type(_opt) Renames `node_id_to_type(_opt)` to `hir_id_to_type(_opt)`; this makes it clear we are dealing with HIR nodes and their IDs here. In addition, a drive-by commit removing `ty::item_path::hir_path_str` (as requested by @eddyb).
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-270/+274
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-13Cleanup importsTaiki Endo-16/+17
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-9/+9
2019-02-12Set the query in the ImplicitCtxt before trying to mark it greenJohn Kåre Alsaker-58/+56
2019-02-11Capture time spent blocked waiting on queriesWesley Wiser-2/+13
This captures time spent blocked when a query is waiting for another query to finish executing in another thread.
2019-02-11Add self profiler events for loading incremental query results from diskWesley Wiser-0/+2
2019-02-11Remove two dead functions.Nicholas Nethercote-25/+0
2019-02-10rustc: doc commentsAlexander Regueiro-270/+274
2019-02-10Auto merge of #58151 - ljedrz:HirIdify_rustc, r=Zoxcbors-8/+8
Partially HirId-ify rustc Another step towards https://github.com/rust-lang/rust/pull/57578.
2019-02-10Auto merge of #58085 - wesleywiser:profiler_2, r=wesleywiserbors-9/+10
Implement more detailed self profiling Timing data and cache hits/misses are now recorded at the query level. This allows us to show detailed per query information such as total time for each query. To see detailed query information in the summary pass the `-Z verbose` flag. For example: ``` rustc -Z self-profile -Z verbose hello_world.rs ``` results in something like: ```md Self profiling results: | Phase | Time (ms) | Time (%) | Queries | Hits (%) | ----------------------------------------- | -------------- | -------- | -------------- | -------- | Other | 177 | 54.97 | 8094 | 45.47 | - {time spent not running queries} | 113 | 35.09 | 0 | 0.00 | - const_eval | 16 | 4.97 | 26 | 11.54 | - type_of | 9 | 2.80 | 627 | 27.75 | - const_eval_raw | 8 | 2.48 | 22 | 0.00 | - adt_def | 7 | 2.17 | 381 | 11.55 | - visible_parent_map | 7 | 2.17 | 99 | 98.99 | - item_attrs | 6 | 1.86 | 698 | 50.14 | - item_children | 5 | 1.55 | 2815 | 0.00 | - adt_dtorck_constraint | 4 | 1.24 | 2 | 0.00 | - adt_destructor | 2 | 0.62 | 15 | 86.67 | TypeChecking | 53 | 16.46 | 2834 | 79.89 | - trait_impls_of | 9 | 2.80 | 65 | 86.15 | - evaluate_obligation | 7 | 2.17 | 80 | 2.50 | - const_is_rvalue_promotable_to_static | 6 | 1.86 | 1 | 0.00 | - is_copy_raw | 6 | 1.86 | 29 | 58.62 | - rvalue_promotable_map | 6 | 1.86 | 2 | 50.00 | - {time spent not running queries} | 6 | 1.86 | 0 | 0.00 | - typeck_item_bodies | 5 | 1.55 | 1 | 0.00 | - typeck_tables_of | 5 | 1.55 | 19 | 94.74 | - dropck_outlives | 2 | 0.62 | 1 | 0.00 | - layout_raw | 1 | 0.31 | 668 | 87.87 | Linking | 48 | 14.91 | 43 | 46.51 | - {time spent not running queries} | 48 | 14.91 | 0 | 0.00 | Codegen | 29 | 9.01 | 420 | 61.90 | - {time spent not running queries} | 16 | 4.97 | 0 | 0.00 | - collect_and_partition_mono_items | 11 | 3.42 | 13 | 92.31 | - mir_const | 1 | 0.31 | 1 | 0.00 | - mir_validated | 1 | 0.31 | 3 | 66.67 | Expansion | 14 | 4.35 | 0 | 0.00 | - {time spent not running queries} | 14 | 4.35 | 0 | 0.00 | BorrowChecking | 1 | 0.31 | 12 | 41.67 | - borrowck | 1 | 0.31 | 2 | 50.00 | Parsing | 0 | 0.00 | 0 | 0.00 Optimization level: No Incremental: off ``` <details> <summary>Rendered</summary> Self profiling results: | Phase | Time (ms) | Time (%) | Queries | Hits (%) | ----------------------------------------- | -------------- | -------- | -------------- | -------- | **Other** | **177** | **54.97** | **8094** | **45.47** | - {time spent not running queries} | 113 | 35.09 | 0 | 0.00 | - const_eval | 16 | 4.97 | 26 | 11.54 | - type_of | 9 | 2.80 | 627 | 27.75 | - const_eval_raw | 8 | 2.48 | 22 | 0.00 | - adt_def | 7 | 2.17 | 381 | 11.55 | - visible_parent_map | 7 | 2.17 | 99 | 98.99 | - item_attrs | 6 | 1.86 | 698 | 50.14 | - item_children | 5 | 1.55 | 2815 | 0.00 | - adt_dtorck_constraint | 4 | 1.24 | 2 | 0.00 | - adt_destructor | 2 | 0.62 | 15 | 86.67 | TypeChecking | 53 | 16.46 | 2834 | 79.89 | - trait_impls_of | 9 | 2.80 | 65 | 86.15 | - evaluate_obligation | 7 | 2.17 | 80 | 2.50 | - const_is_rvalue_promotable_to_static | 6 | 1.86 | 1 | 0.00 | - is_copy_raw | 6 | 1.86 | 29 | 58.62 | - rvalue_promotable_map | 6 | 1.86 | 2 | 50.00 | - {time spent not running queries} | 6 | 1.86 | 0 | 0.00 | - typeck_item_bodies | 5 | 1.55 | 1 | 0.00 | - typeck_tables_of | 5 | 1.55 | 19 | 94.74 | - dropck_outlives | 2 | 0.62 | 1 | 0.00 | - layout_raw | 1 | 0.31 | 668 | 87.87 | Linking | 48 | 14.91 | 43 | 46.51 | - {time spent not running queries} | 48 | 14.91 | 0 | 0.00 | Codegen | 29 | 9.01 | 420 | 61.90 | - {time spent not running queries} | 16 | 4.97 | 0 | 0.00 | - collect_and_partition_mono_items | 11 | 3.42 | 13 | 92.31 | - mir_const | 1 | 0.31 | 1 | 0.00 | - mir_validated | 1 | 0.31 | 3 | 66.67 | Expansion | 14 | 4.35 | 0 | 0.00 | - {time spent not running queries} | 14 | 4.35 | 0 | 0.00 | BorrowChecking | 1 | 0.31 | 12 | 41.67 | - borrowck | 1 | 0.31 | 2 | 50.00 | Parsing | 0 | 0.00 | 0 | 0.00 Optimization level: No Incremental: off </details> cc @nikomatsakis @michaelwoerister @Zoxc Fixes #54141
2019-02-10Auto merge of #57770 - Zoxc:no-hash-query, r=michaelwoeristerbors-14/+38
Add a query type which is always marked as red if it runs This is useful for queries which produce results which are very likely to change if their inputs do. I also expect this to be useful for end to end queries because 1) we don't need `HashStable` impls and 2) we avoid the overhead of hashing the result of large results like the AST or the HIR map. r? @michaelwoerister
2019-02-09cleanup: remove hir_path_strljedrz-5/+0
2019-02-09cleanup: rename node_id_to_type(_opt)ljedrz-13/+9
2019-02-09Auto merge of #58207 - nnethercote:intern_lazy_const, r=oli-obkbors-12/+14
Make `intern_lazy_const` actually intern its argument. Currently it just unconditionally allocates it in the arena. For a "Clean Check" build of the the `packed-simd` benchmark, this change reduces both the `max-rss` and `faults` counts by 59%; it slightly (~3%) increases the instruction counts but the `wall-time` is unchanged. For the same builds of a few other benchmarks, `max-rss` and `faults` drop by 1--5%, but instruction counts and `wall-time` changes are in the noise. Fixes #57432, fixes #57829.
2019-02-08Remove no_hash from optimized_mirJohn Kåre Alsaker-1/+1
2019-02-08Move no_hash from mir_built to optimized_mirJohn Kåre Alsaker-2/+2
2019-02-08Remove no_hash from typeck_tables_ofJohn Kåre Alsaker-1/+1
2019-02-08Remove no_hash from optimized_mirJohn Kåre Alsaker-1/+1
2019-02-08Add a query type which is always marked as red if it runsJohn Kåre Alsaker-17/+41
2019-02-07Add const params to Defvarkor-0/+1
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-07Implement more detailed self profilingWesley Wiser-9/+10
Timing data and cache hits/misses are now recorded at the query level. This allows us to show detailed per query information such as total time for each query. To see detailed query information in the summary pass the `-Z verbose` flag. For example: ``` rustc -Z self-profile -Z verbose hello_world.rs ```
2019-02-07Rollup merge of #58242 - notriddle:patch-3, r=zackmdaviskennytm-0/+1
Document the one TyKind that isn't documented This is especially confusing since the name `Foreign` and the name `extern type` are so different. I deduced that they're the same by consulting git-blame.
2019-02-06Document the one TyKind that isn't documentedMichael Howell-0/+1
This is especially confusing since the name `Foreign` and the name `extern type` are so different. I deduced that they're the same by consulting git-blame.
2019-02-06Make `intern_lazy_const` actually intern its argument.Nicholas Nethercote-12/+14
Currently it just unconditionally allocates it in the arena. For a "Clean Check" build of the the `packed-simd` benchmark, this change reduces both the `max-rss` and `faults` counts by 59%; it slightly (~3%) increases the instruction counts but the `wall-time` is unchanged. For the same builds of a few other benchmarks, `max-rss` and `faults` drop by 1--5%, but instruction counts and `wall-time` changes are in the noise. Fixes #57432, fixes #57829.
2019-02-05rustc: partially HirIdifyljedrz-8/+8
2019-02-05move librustc to 2018Mark Mansi-341/+343
2019-02-03hir: add HirId methodsljedrz-0/+6
2019-02-01Auto merge of #57937 - denzp:nvptx, r=nagisabors-0/+6
NVPTX target specification This change adds a built-in `nvptx64-nvidia-cuda` GPGPU no-std target specification and a basic PTX assembly smoke tests. The approach is taken here and the target spec is based on `ptx-linker`, a project started about 1.5 years ago. Key feature: bitcode object files being linked with LTO into the final module on the linker's side. Prior to this change, the linker used a `ld` linker-flavor, but I think, having the special CLI convention is a more reliable way. Questions about further progress on reliable CUDA workflow with Rust: 1. Is it possible to create a test suite `codegen-asm` to verify end-to-end integration with LLVM backend? 1. How would it be better to organise no-std `compile-fail` tests: add `#![no_std]` where possible and mark others as `ignore-nvptx` directive, or alternatively, introduce `compile-fail-no-std` test suite? 1. Can we have the `ptx-linker` eventually be integrated as `rls` or `clippy`? Hopefully, this should allow to statically link against LLVM used in Rust and get rid of the [current hacky solution](https://github.com/denzp/rustc-llvm-proxy). 1. Am I missing some methods from `rustc_codegen_ssa::back::linker::Linker` that can be useful for bitcode-only linking? Currently, there are no major public CUDA projects written in Rust I'm aware of, but I'm expecting to have a built-in target will create a solid foundation for further experiments and awesome crates. Related to #38789 Fixes #38787 Fixes #38786
2019-02-01Restrict concrete types to equivalent typesOliver Scherer-2/+13
2019-01-29Only store the result of mir_borrowck for closuresJohn Kåre Alsaker-26/+29
2019-01-29Make impl_wf_check incrementalJohn Kåre Alsaker-0/+12
2019-01-29Add an ensure() method to TyCtxt used to ensure queries are runJohn Kåre Alsaker-13/+22
2019-01-29Auto merge of #57948 - Zoxc:parallel, r=michaelwoeristerbors-33/+33
Use multiple threads by default. Limits tests to one thread. Do some renaming. r? @michaelwoerister
2019-01-28Rollup merge of #57674 - dotdash:erase_reg, r=varkorMazdak Farrokhzad-1/+6
Avoid erase_regions_ty queries if there are no regions to erase 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-28Use multiple threads by default. Limits tests to one thread. Do some renaming.John Kåre Alsaker-33/+33