summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty
AgeCommit message (Collapse)AuthorLines
2021-02-04use generic arguments of associated item in trait_ref methodb-naber-1/+9
2021-02-03Auto merge of #81346 - hug-dev:nonsecure-call-abi, r=jonas-schievinkbors-0/+1
Add a new ABI to support cmse_nonsecure_call This adds support for the `cmse_nonsecure_call` feature to be able to perform non-secure function call. See the discussion on Zulip [here](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Support.20for.20callsite.20attributes/near/223054928). This is a followup to #75810 which added `cmse_nonsecure_entry`. As for that PR, I assume that the changes are small enough to not have to go through a RFC but I don't mind doing one if needed 😃 I did not yet create a tracking issue, but if most of it is fine, I can create one and update the various files accordingly (they refer to the other tracking issue now). On the Zulip chat, I believe `@jonas-schievink` volunteered to be a reviewer 💯
2021-02-02Bump rustfmt versionMark Rousskov-13/+26
Also switches on formatting of the mir build module
2021-02-02Add a new ABI to support cmse_nonsecure_callHugues de Valon-0/+1
This commit adds a new ABI to be selected via `extern "C-cmse-nonsecure-call"` on function pointers in order for the compiler to apply the corresponding cmse_nonsecure_call callsite attribute. For Armv8-M targets supporting TrustZone-M, this will perform a non-secure function call by saving, clearing and calling a non-secure function pointer using the BLXNS instruction. See the page on the unstable book for details. Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2021-01-29Fix typosAman Arora-0/+2
2021-01-29Fix incorrect use mut diagnosticsAman Arora-0/+9
2021-01-29Compute mutability of closure capturesAman Arora-1/+7
When `capture_disjoint_fields` is not enabled, checking if the root variable binding is mutable would suffice. However with the feature enabled, the captured place might be mutable because it dereferences a mutable reference. This PR computes the mutability of each capture after capture analysis in rustc_typeck. We store this in `ty::CapturedPlace` and then use `ty::CapturedPlace::mutability` in mir_build and borrow_check.
2021-01-28Auto merge of #81388 - bjorn3:wasm_bindgen_fix, r=nikomatsakisbors-4/+3
Fix abi for wasm-bindgen Hopefully fixes https://github.com/rust-lang/rust/issues/81386. `@alexcrichton` can you confirm this fixes wasm-bindgen? r? `@alexcrichton`
2021-01-28Rollup merge of #81062 - sexxi-goose:precise_capture_diagnostics, r=nikomatsakisYuki Okushi-2/+19
Improve diagnostics for Precise Capture This is just the capture analysis part and borrow checker logging will updated as part of rust-lang/project-rfc-2229#8 Closes rust-lang/project-rfc-2229#22
2021-01-28Rollup merge of #79951 - LeSeulArtichaut:ty-ir, r=nikomatsakisYuki Okushi-289/+158
Refractor a few more types to `rustc_type_ir` In the continuation of #79169, ~~blocked on that PR~~. This PR: - moves `IntVarValue`, `FloatVarValue`, `InferTy` (and friends) and `Variance` - creates the `IntTy`, `UintTy` and `FloatTy` enums in `rustc_type_ir`, based on their `ast` and `chalk_ir` equilavents, and uses them for types in the rest of the compiler. ~~I will split up that commit to make this easier to review and to have a better commit history.~~ EDIT: done, I split the PR in commits of 200-ish lines each r? `````@nikomatsakis````` cc `````@jackh726`````
2021-01-26Use PassMode::Direct for Abi::Aggregate by defaultbjorn3-4/+3
2021-01-26Revert "Wasm-bindgen abi compat using cast_to"bjorn3-1/+1
This reverts commit 903c553f4a2fc8344edac0da565e6c1a7fad4b39.
2021-01-26Wasm-bindgen abi compat using cast_tobjorn3-1/+1
2021-01-26Revert "Fix abi for wasm-bindgen"bjorn3-8/+0
This reverts commit 4d2766e3524129f0d7ec6ad34c4045150ad4f978.
2021-01-26Revert "Share wasm-bindgen compat abi selection code"bjorn3-1/+1
This reverts commit e7a056fe20f7ec5a475923ff2f4eda8ca9e1a74b.
2021-01-26Auto merge of #80692 - Aaron1011:feature/query-result-debug, r=estebankbors-6/+6
Enforce that query results implement Debug Currently, we require that query keys implement `Debug`, but we do not do the same for query values. This can make incremental compilation bugs difficult to debug - there isn't a good place to print out the result loaded from disk. This PR adds `Debug` bounds to several query-related functions, allowing us to debug-print the query value when an 'unstable fingerprint' error occurs. This required adding `#[derive(Debug)]` to a fairly large number of types - hopefully, this doesn't have much of an impact on compiler bootstrapping times.
2021-01-25Share wasm-bindgen compat abi selection codebjorn3-1/+1
2021-01-25Auto merge of #68828 - oli-obk:inline_cycle, r=wesleywiserbors-0/+11
Prevent query cycles in the MIR inliner r? `@eddyb` `@wesleywiser` cc `@rust-lang/wg-mir-opt` The general design is that we have a new query that is run on the `validated_mir` instead of on the `optimized_mir`. That query is forced before going into the optimization pipeline, so as to not try to read from a stolen MIR. The query should not be cached cross crate, as you should never call it for items from other crates. By its very design calls into other crates can never cause query cycles. This is a pessimistic approach to inlining, since we strictly have more calls in the `validated_mir` than we have in `optimized_mir`, but that's not a problem imo.
2021-01-25Fix abi for wasm-bindgenbjorn3-0/+8
2021-01-24Auto merge of #80919 - cjgillot:defkey-span, r=oli-obkbors-0/+16
Generate metadata by iterating on DefId instead of traversing the HIR tree 1/N Sample from #80347.
2021-01-23Fix review commentsbjorn3-7/+6
2021-01-23Prevent query cycles during inliningoli-0/+11
2021-01-23Iterate to encode def_kind.Camille GILLOT-0/+16
2021-01-23Never create an temporary PassMode::Direct when it is not a valid pass mode ↵bjorn3-33/+15
for a type
2021-01-23Move some code aroundbjorn3-55/+76
2021-01-23Use PassMode::Pair by default for Abi::ScalarPair for all abi's and in ↵bjorn3-16/+13
return position Abi::ScalarPair is only ever used for types that don't have a stable layout anyway so this doesn't break any FFI. It does however reduce the amount of special casing on the abi outside of the code responsible for abi specific adjustments to the pass mode.
2021-01-18Use `rustc_type_ir::{IntTy,UintTy,FloatTy} instead of the `rustc_ast` ones ↵LeSeulArtichaut-74/+143
in types
2021-01-18Move a few more types to `rustc_type_ir`LeSeulArtichaut-215/+15
2021-01-18Rollup merge of #81131 - pierwill:edit-rustc_middle-cast, r=varkorAshley Mannix-5/+6
Edit rustc_middle::ty::cast docs Link to RFC 401 and add missing punctuation.
2021-01-18Rollup merge of #81100 - lcnr:encode_with_shorthand, r=oli-obkAshley Mannix-3/+3
prevent potential bug in `encode_with_shorthand`. see https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Remove.20PredicateKind.20in.20favor.20of.20only.20Bin.E2.80.A6.20compiler-team.23397/near/223012169
2021-01-17Auto merge of #80679 - jackh726:predicate-kind-take2, r=lcnrbors-247/+168
Remove PredicateKind and instead only use Binder<PredicateAtom> Originally brought up in https://github.com/rust-lang/rust/pull/76814#discussion_r546858171 r? `@lcnr`
2021-01-17Edit rustc_middle::ty::cast docspierwill-5/+6
Link to RFC 401 and add missing punctuation.
2021-01-17Whitespace and typoJack Huey-1/+1
2021-01-17Add comment about Encodable/Decodable implJack Huey-0/+2
2021-01-17Rollup merge of #80635 - sexxi-goose:use-place-instead-of-symbol, ↵Mara Bos-4/+46
r=nikomatsakis` Improve diagnostics when closure doesn't meet trait bound Improves the diagnostics when closure doesn't meet trait bound by modifying `TypeckResuts::closure_kind_origins` such that `hir::Place` is used instead of `Symbol`. Using `hir::Place` to describe which capture influenced the decision of selecting a trait a closure satisfies to (Fn/FnMut/FnOnce, Copy) allows us to show precise path in the diagnostics when `capture_disjoint_field` feature is enabled. Closes rust-lang/project-rfc-2229/issues/21 r? ```@nikomatsakis```
2021-01-17Don't derive TyEncodable/TyDecodable for BinderJack Huey-10/+35
2021-01-17Impl EncodableWithShorthand for PredicateKindJack Huey-1/+37
2021-01-16Can't use EncodableWithShorthand for PredicateJack Huey-29/+2
2021-01-16More review commentsJack Huey-23/+18
2021-01-16Review changesJack Huey-122/+112
2021-01-16CleanupJack Huey-31/+6
2021-01-16CleanupJack Huey-40/+30
2021-01-16fold_with not super_fold_with in TypeFoldable impl for PredicateJack Huey-1/+1
2021-01-16Remove PredicateKindJack Huey-56/+30
2021-01-16Intermediate formatting and suchJack Huey-24/+14
2021-01-16Remove PredicateKind::AtomJack Huey-39/+10
2021-01-17prevent potential bug in `encode_with_shorthand`.Bastian Kauschke-3/+3
2021-01-16Implement Debug for DefIdForestAaron Hill-1/+1
2021-01-16Enforce that query results implement DebugAaron Hill-5/+5
2021-01-16correctly deal with late-bound lifetimes in anon constsBastian Kauschke-1/+2