about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty
AgeCommit message (Collapse)AuthorLines
2021-03-28Rollup merge of #83526 - klensy:lazy-too, r=petrochenkovYuki Okushi-4/+5
lazily calls some fns Replaced some fn's with it's lazy variants.
2021-03-27lazily calls some fnsklensy-4/+5
2021-03-26fix doc comment for `ty::Dynamiclcnr-1/+1
2021-03-26Auto merge of #83465 - michaelwoerister:safe-read_raw_bytes, r=cjgillotbors-2/+2
Allow for reading raw bytes from rustc_serialize::Decoder without unsafe code The current `read_raw_bytes` method requires using `MaybeUninit` and `unsafe`. I don't think this is necessary. Let's see if a safe interface has any performance drawbacks. This is a followup to #83273 and will make it easier to rebase #82183. r? `@cjgillot`
2021-03-25Allow for reading raw bytes from rustc_serialize::Decoder without unsafe code.Michael Woerister-2/+2
2021-03-24resolve late lifetimes by itemJack Huey-2/+2
This reverts commit 22ae20733515d710c1134600bc1e29cdd76f6b9b.
2021-03-23Update with commentskadmin-1/+1
2021-03-23Update with commentskadmin-4/+5
A bunch of nits fixed, and a new test for pretty printing the AST.
2021-03-23Add query for const_param_defaultkadmin-13/+25
2021-03-23progress, stuff compiles nowlcnr-1/+5
2021-03-23Add has_default to GenericParamDefKind::Constkadmin-24/+29
This currently creates a field which is always false on GenericParamDefKind for future use when consts are permitted to have defaults Update const_generics:default locations Previously just ignored them, now actually do something about them. Fix using type check instead of value Add parsing This adds all the necessary changes to lower const-generics defaults from parsing. Change P<Expr> to AnonConst This matches the arguments passed to instantiations of const generics, and makes it specific to just anonymous constants. Attempt to fix lowering bugs
2021-03-22Auto merge of #83376 - Dylan-DPC:rollup-s2fsjwj, r=Dylan-DPCbors-2/+5
Rollup of 7 pull requests Successful merges: - #82374 (Add license metadata for std dependencies) - #82683 (Document panicking cases for integer division and remainder) - #83272 (Clarify non-exact length in the Iterator::take documentation) - #83338 (Fix test for #82270) - #83351 (post-drop-elab check-const: explain why we still check qualifs) - #83367 (Improve error message for unassigned query provider) - #83372 (SplitInclusive is public API) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-03-22Rollup merge of #83367 - richkadel:query-err-msg, r=jyn514Dylan DPC-2/+5
Improve error message for unassigned query provider Fixes: #83122 r? `@jyn514` This implements the change we agreed on. Thanks!
2021-03-22Auto merge of #83273 - cjgillot:endecode, r=michaelwoeristerbors-50/+7
Simplify encoder and decoder Extracted from https://github.com/rust-lang/rust/pull/83036 and https://github.com/rust-lang/rust/pull/82780.
2021-03-21Improve error message for unassigned query providerRich Kadel-2/+5
Fixes: 83122
2021-03-21Don't compute optimized PointerKind for unoptimized buildsNikita Popov-17/+24
This saves us both the Freeze/Unpin queries, and avoids placing noalias attributes, which have a compile-time impact on LLVM even in optnone builds (due to always_inline functions).
2021-03-21Don't consider !Unpin references as noaliasNikita Popov-3/+52
Such structures may contain self-references, in which case the same location may be accessible through a pointer that is not based-on the noalias pointer. This is still grey area as far as language semantics are concerned, but checking for !Unpin as an indicator for self-referential sturctures seems like a good approach for the meantime.
2021-03-21Move decision aboute noalias into codegen_llvmNikita Popov-20/+11
The frontend shouldn't be deciding whether or not to use mutable noalias attributes, as this is a pure LLVM concern. Only provide the necessary information and do the actual decision in codegen_llvm.
2021-03-20update `const_eval_resolve`lcnr-1/+2
2021-03-20extract `ConstKind::Unevaluated` into a structlcnr-32/+48
2021-03-19Rollup merge of #83297 - oli-obk:why_bug_today_if_you_can_delay_to_tomorrow, ↵Dylan DPC-5/+9
r=petrochenkov Do not ICE on ty::Error as an error must already have been reported fixes #83253
2021-03-19Remove FingerprintEncoder/Decoder.Camille GILLOT-13/+0
2021-03-19Move raw bytes handling to Encoder/Decoder.Camille GILLOT-0/+6
2021-03-19Do not ICE on ty::Error as an error must already have been reportedOli Scherer-5/+9
2021-03-19Hash hir_owner in typeck resultsAman Arora-1/+3
2021-03-18Replace closures_captures and upvar_capture with closure_min_capturesJennifer Wills-35/+52
make changes to liveness to use closure_min_captures use different span borrow check uses new structures rename to CapturedPlace stop using upvar_capture in regionck remove the bridge cleanup from rebase + remove the upvar_capture reference from mutability_errors.rs remove line from livenes test make our unused var checking more consistent update tests adding more warnings to the tests move is_ancestor_or_same_capture to rustc_middle/ty update names to reflect the closures add FIXME check that all captures are immutable borrows before returning add surrounding if statement like the original move var out of the loop and rename Co-authored-by: Logan Mosier <logmosier@gmail.com> Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
2021-03-18Move IntEncodedWithFixedSize to rustc_serialize.Camille GILLOT-37/+1
2021-03-18hir: Preserve used syntax in `TyKind::TraitObject`Vadim Petrochenkov-0/+1
2021-03-17Auto merge of #83090 - jackh726:bound_var_replacer_option, r=varkorbors-55/+53
Make functions passed to BoundVarReplacer be optional This means we can reuse the bound vars when we don't care to change them
2021-03-16Auto merge of #82936 - oli-obk:valtree, r=RalfJung,lcnr,matthewjasperbors-141/+248
Implement (but don't use) valtree and refactor in preparation of use This PR does not cause any functional change. It refactors various things that are needed to make valtrees possible. This refactoring got big enough that I decided I'd want it reviewed as a PR instead of trying to make one huge PR with all the changes. cc `@rust-lang/wg-const-eval` on the following commits: * 2027184 implement valtree * eeecea9 fallible Scalar -> ScalarInt * 042f663 ScalarInt convenience methods cc `@eddyb` on ef04a6d cc `@rust-lang/wg-mir-opt` for cf1700c (`mir::Constant` can now represent either a `ConstValue` or a `ty::Const`, and it is totally possible to have two different representations for the same value)
2021-03-16Auto merge of #82536 - sexxi-goose:handle-patterns-take-2, r=nikomatsakisbors-0/+28
2229: Handle patterns within closures correctly when `capture_disjoint_fields` is enabled This PR fixes several issues related to handling patterns within closures when `capture_disjoint_fields` is enabled. 1. Matching is always considered a use of the place, even with `_` patterns 2. Compiler ICE when capturing fields in closures through `let` assignments To do so, we - Introduced new Fake Reads - Delayed use of `Place` in favor of `PlaceBuilder` - Ensured that `PlaceBuilder` can be resolved before attempting to extract `Place` in any of the pattern matching code Closes rust-lang/project-rfc-2229/issues/27 Closes rust-lang/project-rfc-2229/issues/24 r? `@nikomatsakis`
2021-03-16Update compiler/rustc_middle/src/ty/consts/valtree.rsOli Scherer-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2021-03-16Update compiler/rustc_middle/src/ty/consts/valtree.rsOli Scherer-1/+2
Co-authored-by: Ralf Jung <post@ralfj.de>
2021-03-16Use delay_span_bug instead of panic in layout_scalar_valid_rangeTomasz Miąsko-6/+9
83054 introduced validation of scalar range attributes, but panicking code that uses the attribute remained reachable. Use `delay_span_bug` instead to avoid the ICE.
2021-03-15Make functions passed to BoundVarReplacer be optionalJack Huey-55/+53
2021-03-15Add comments with examples and testsRoxane-1/+23
2021-03-15Pacify tidyOli Scherer-1/+1
2021-03-15Do not expose fallible `to_int` operation on `Scalar`.Oli Scherer-1/+1
Any use of it has been shown to be a bug in the past.
2021-03-15Document valtreeOli Scherer-0/+18
2021-03-14Don't encode file information for span with a dummy locationAaron Hill-3/+3
Fixes #83112 The location information for a dummy span isn't real, so don't encode it. This brings the incr comp cache code into line with the Span `StableHash` impl, which doesn't hash the location information for dummy spans. Previously, we would attempt to load the 'original' file from a dummy span - if the file id changed (e.g. due to being moved on disk), we would get an ICE, since the Span was still valid due to its hash being unchanged.
2021-03-14Use the correct FakeReadCauseRoxane-2/+2
2021-03-14Introduce new fake readsRoxane-0/+6
2021-03-12Directly intern allocations so that we can write a `Lift` impl for themOli Scherer-6/+29
2021-03-12Split pretty printer logic for scalar int and scalar ptrOli Scherer-46/+67
Value trees won't have scalar ptr at all, so we need a scalar int printing method anyway. This way we'll be able to share that method between all const representations.
2021-03-12Pull out ConstValue relating into its own functionOli Scherer-46/+51
2021-03-12Reduce the duplication in the relation logic for constantsOli Scherer-67/+45
2021-03-12Reduce destructuring and re-interning where possibleOli Scherer-15/+18
2021-03-12Resolve a FIXME around type equality checks in Relate for constantsOli Scherer-6/+9
2021-03-12Add convenience conversion methods for ScalarIntOli Scherer-2/+30
2021-03-12Intern valtree field vectorOli Scherer-5/+15