about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2019-03-13Auto merge of #56864 - Zoxc:stable-hash-macro, r=michaelwoeristerbors-63/+102
Use derive macro for HashStable Blocked on https://github.com/rust-lang/rust/pull/56795
2019-03-13Rollup merge of #59132 - nikomatsakis:issue-53548-generator-bound, r=pnkfelixMazdak Farrokhzad-2/+1
ignore higher-ranked object bound conditions created by WF In the `issue-53548` test added in this PR, the `Box<dyn Trait>` type is expanded to `Box<dyn Trait + 'static>`, but the generator "witness" that results is `for<'r> { Box<dyn Trait + 'r> }`. The WF code was encountering an ICE (when debug-assertions were enabled) and an unexpected compilation error (without debug-asserions) when trying to process this `'r` region bound. In particular, to be WF, the region bound must meet the requirements of the trait, and hence we got `for<'r> { 'r: 'static }`. This would ICE because the `Binder` constructor we were using was assering that no higher-ranked regions were involved (because the WF code is supposed to skip those). The error (if debug-asserions were disabled) came because we obviously cannot prove that `'r: 'static` for any region `'r`. Pursuant with our "lazy WF" strategy for higher-ranked regions, the fix is not to require that `for<'r> { 'r: 'static }` holds (this is also analogous to what we would do for higher-ranked regions appearing within the trait in other positions). Fixes #53548 r? @pnkfelix
2019-03-13Use derive macro for HashStableJohn Kåre Alsaker-63/+102
2019-03-12ignore higher-ranked WF requirements for trait objectsNiko Matsakis-2/+1
In the `issue-53548` test added in this commit, the `Box<dyn Trait>` type is expanded to `Box<dyn Trait + 'static>`, but the generator "witness" that results is `for<'r> { Box<dyn Trait + 'r> }`. The WF code was encountering an ICE (when debug-assertions were enabled) and an unexpected compilation error (without debug-asserions) when trying to process this `'r` region bound. In particular, to be WF, the region bound must meet the requirements of the trait, and hence we got `for<'r> { 'r: 'static }`. This would ICE because the `Binder` constructor we were using was assering that no higher-ranked regions were involved (because the WF code is supposed to skip those). The error (if debug-asserions were disabled) came because we obviously cannot prove that `'r: 'static` for any region `'r`. Pursuant with our "lazy WF" strategy for higher-ranked regions, the fix is not to require that `for<'r> { 'r: 'static }` holds (this is also analogous to what we would do for higher-ranked regions appearing within the trait in other positions).
2019-03-11Remove precompute_in_scope_traits_hashesJohn Kåre Alsaker-10/+0
2019-03-10hir: replace NodeId with HirId in trait_implsljedrz-2/+2
2019-03-10Make the rustc driver and interface demand drivenJohn Kåre Alsaker-51/+38
2019-03-09Rollup merge of #58679 - Zoxc:passes-refactor, r=michaelwoeristerMazdak Farrokhzad-1/+9
Refactor passes and pass execution to be more parallel For `syntex_syntax` (with 16 threads and 8 cores): - Cuts `misc checking 1` from `0.096s` to `0.08325s`. - Cuts `misc checking 2` from `0.3575s` to `0.2545s`. - Cuts `misc checking 3` from `0.34625s` to `0.21375s`. - Cuts `wf checking` from `0.3085s` to `0.05025s`. Reduces overall execution time for `syntex_syntax` (with 8 threads and cores) from `4.92s` to `4.34s`. Subsumes https://github.com/rust-lang/rust/pull/58494 Blocked on https://github.com/rust-lang/rust/pull/58250 r? @michaelwoerister
2019-03-09Rollup merge of #58670 - saleemjaffer:refactor_typecast_check_kinds, r=oli-obkMazdak Farrokhzad-17/+17
fixes rust-lang#52482
2019-03-08expand unused doc comment diagnosticAndy Russell-80/+83
Report the diagnostic on macro expansions, and add a label indicating why the comment is unused.
2019-03-07HirIdification: replace NodeId method callsljedrz-16/+16
2019-03-06Rename check_privacy to check_private_in_publicJohn Kåre Alsaker-4/+4
2019-03-06Split up privacy checking so privacy_access_levels only does computations ↵John Kåre Alsaker-1/+9
required for AccessLevels
2019-03-05Handle const generics elsewherevarkor-4/+19
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05Implement structural_impls for const genericsvarkor-1/+21
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05Add HAS_CT_INFERvarkor-2/+5
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05Add const type flagsvarkor-17/+34
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05Take const into account in contextvarkor-26/+74
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05Add const kind and UnpackedKind::Constvarkor-6/+110
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05Add type_flags helper methods to constsvarkor-0/+43
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05Add InferConstvarkor-0/+11
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05Add ConstVidvarkor-0/+7
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05Add ParamConstvarkor-0/+20
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05Add Const generic param to tyvarkor-4/+24
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-05Only insert nodes which changes lint levels in the LintLevelMapJohn Kåre Alsaker-23/+37
2019-03-05fixes rust-lang#52482Saleem Jaffer-17/+17
2019-03-03Auto merge of #58673 - matthewjasper:typeck-ptr-coercions, r=pnkfelixbors-8/+12
[NLL] Type check operations with pointer types It seems these were forgotten about. Moving to `Rvalue::AddressOf` simplifies the coercions from references, but I want this to be fixed as soon as possible. r? @pnkfelix
2019-03-03Auto merge of #58866 - kennytm:rollup, r=kennytmbors-10/+12
Rollup of 14 pull requests Successful merges: - #58730 (Have all methods of Filter and FilterMap use internal iteration) - #58780 (ManuallyDrop != MaybeUninit) - #58782 (Replace `s` with `self` in docs for str methods taking self.) - #58785 (allow specifying attributes for tool lints) - #58802 (Ensure `record_layout_for_printing()` is inlined.) - #58821 (Fixed a syntax error in the pin docs) - #58830 (tidy: deny(rust_2018_idioms)) - #58832 (Revert switching to GCP on AppVeyor) - #58833 (tools/rustbook: deny(rust_2018_idioms)) - #58835 (tools/remote-test-{client,server}: deny(rust_2018_idioms)) - #58838 (Fix typo in Vec#resize_with documentation) - #58842 (Forbid duplicating Cargo as a dependency) - #58852 (Update toolchain to build NetBSD release) - #58865 (Fix C-variadic function printing)
2019-03-02Rollup merge of #58802 - nnethercote:inline-record_layout, r=oli-obkkennytm-10/+12
Ensure `record_layout_for_printing()` is inlined. This reduces instruction counts for the `ctfe-stress-2` benchmark by about 1%. r? @oli-obk
2019-03-02hir: HirIdify Impl&TraitItemIdljedrz-16/+12
2019-03-02hir: remove NodeId from Itemljedrz-4/+8
2019-03-02Auto merge of #56946 - Zoxc:jobserver, r=nikomatsakisbors-0/+5
Add support for using a jobserver with Rayon The Rayon changes are here: https://github.com/Zoxc/rayon/pull/2 cc @alexcrichton r? @nikomatsakis
2019-03-01ty: HirIdify some lintsljedrz-27/+6
2019-03-01Add support for using a jobserver with RayonJohn Kåre Alsaker-0/+5
2019-02-28Introduce rustc_interface and move some methods thereJohn Kåre Alsaker-5/+14
2019-02-28Auto merge of #57760 - dlrobertson:varargs1, r=alexregbors-15/+15
Support defining C compatible variadic functions ## Summary Add support for defining C compatible variadic functions in unsafe rust with `extern "C"` according to [RFC 2137]. ## Details ### Parsing When parsing a user defined function that is `unsafe` and `extern "C"` allow variadic signatures and inject a "spoofed" `VaList` in the new functions signature. This allows the user to interact with the variadic arguments via a `VaList` instead of manually using `va_start` and `va_end` (See [RFC 2137] for details). ### Codegen When running codegen for a variadic function, remove the "spoofed" `VaList` from the function signature and inject `va_start` when the arg local references are created for the function and `va_end` on return. ## TODO - [x] Get feedback on injecting `va_start/va_end` in MIR vs codegen - [x] Properly inject `va_end` - It seems like it should be possible to inject `va_end` on the `TerminatorKind::Return`. I just need to figure out how to get the `LocalRef` here. - [x] Properly call Rust defined C variadic functions in Rust - The spoofed `VaList` causes problems here. Related to: #44930 r? @ghost [RFC 2137]: https://github.com/rust-lang/rfcs/blob/master/text/2137-variadic.md
2019-02-28Ensure `record_layout_for_printing()` is inlined.Nicholas Nethercote-10/+12
This reduces instruction counts for the `ctfe-stress-2` benchmark by about 1%.
2019-02-27Rename variadic to c_variadicDan Robertson-13/+13
Function signatures with the `variadic` member set are actually C-variadic functions. Make this a little more explicit by renaming the `variadic` boolean value, `c_variadic`.
2019-02-27Support defining C compatible variadic functionsDan Robertson-3/+3
Add support for defining C compatible variadic functions in unsafe rust with extern "C".
2019-02-27Rollup merge of #58749 - kenta7777:reduce-repetition, r=oli-obkMazdak Farrokhzad-7/+8
Reduce Repetitions of (n << amt) >> amt Fixes part of [#49937](https://github.com/rust-lang/rust/issues/49937).
2019-02-27rename Substs to InternalSubstscsmoe-39/+39
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
2019-02-26replace &'tcx Substs with SubstsRefcsmoe-80/+82
2019-02-26reduce repetitions of (n << amt) >> amtkenta7777-7/+8
2019-02-26Auto merge of #58561 - ljedrz:HirIdify_some_nodes, r=Zoxcbors-4/+3
Remove NodeId from some HIR nodes The next iteration of https://github.com/rust-lang/rust/pull/57578. Removes `NodeId` from: - [x] `Lifetime` - [x] `Ty` - [x] `GenericParam` - [x] `WhereClause` - [x] `WhereEqPredicate` - [x] `MacroDef` - [x] `Block` - [x] `Expr` r? @Zoxc
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-24hir: remove NodeId from Exprljedrz-2/+1
2019-02-24hir: remove NodeId from Blockljedrz-2/+2
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-23Type check coercions to pointer typesMatthew Jasper-8/+12