about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils
AgeCommit message (Collapse)AuthorLines
2021-12-02use try_normalize_erasing_regions in needs_dropb-naber-2/+4
2021-12-02Auto merge of #91354 - fee1-dead:const_env, r=spastorinobors-12/+73
Cleanup: Eliminate ConstnessAnd This is almost a behaviour-free change and purely a refactoring. "almost" because we appear to be using the wrong ParamEnv somewhere already, and this is now exposed by failing a test using the unstable `~const` feature. We most definitely need to review all `without_const` and at some point should probably get rid of many of them by using `TraitPredicate` instead of `TraitRef`. This is a continuation of https://github.com/rust-lang/rust/pull/90274. r? `@oli-obk` cc `@spastorino` `@ecstatic-morse`
2021-12-01FormatDeadbeef-6/+26
2021-11-29`ParamEnv` should be const when `ImplItem` is within a const impl.Deadbeef-1/+37
2021-11-29Completely remove ConstnessAndOli Scherer-3/+1
2021-11-29Re-use `constness_for_typeck` instead of rolling it ourselvesOli Scherer-11/+1
2021-11-29Add constness to ParamEnvOli Scherer-10/+27
This now causes a lot of queries to be executed twice, as reveal_all forces NotConst
2021-11-28Take a LocalDefId in expect_*item.Camille GILLOT-7/+4
2021-11-13Recurse through query system when checking ADT drop types, hopefully ↵Jakob Degen-23/+61
improving perf
2021-11-08impl Copy/Clone for arrays in std, not in compilerbstrie-1/+1
2021-11-06Improve terminology around "after typeck"pierwill-1/+1
2021-10-28Auto merge of #90218 - JakobDegen:adt_significant_drop_fix, r=nikomatsakisbors-45/+56
Fixes incorrect handling of ADT's drop requirements Fixes #90024 and a bunch of duplicates. The main issue was just that the contract of `NeedsDropTypes::adt_components` was inconsistent; the list of types it might return were the generic parameters themselves or the fields of the ADT, depending on the nature of the drop impl. This meant that the caller could not determine whether a `.subst()` call was still needed on those types; it called `.subst()` in all cases, and this led to ICEs when the returned types were the generic params. First contribution of more than a few lines, so feedback definitely appreciated.
2021-10-25Clean up debug statements in needs_dropJakob Degen-7/+5
2021-10-25expose default substs in param_envb-naber-0/+12
2021-10-23Fixes incorrect handling of ADT's drop requirementsJakob Degen-41/+54
See https://github.com/rust-lang/rust/issues/90024#issuecomment-950105433
2021-10-19Replace FnLikeNode by FnKind.Camille GILLOT-3/+2
2021-10-02Remove various unused feature gatesbjorn3-2/+0
2021-09-26Auto merge of #89144 - sexxi-goose:insig_stdlib, r=nikomatsakisbors-18/+57
2229: Mark insignificant dtor in stdlib I looked at all public [stdlib Drop implementations](https://doc.rust-lang.org/stable/std/ops/trait.Drop.html#implementors) and categorized them into Insigificant/Maybe/Significant Drop. Reasons are noted here: https://docs.google.com/spreadsheets/d/19edb9r5lo2UqMrCOVjV0fwcSdS-R7qvKNL76q7tO8VA/edit#gid=1838773501 One thing missing from this PR is tagging HashMap as insigificant destructor as that needs some discussion. r? `@Mark-Simulacrum` cc `@nikomatsakis`
2021-09-22PR fixupAman Arora-7/+16
2021-09-21Auto merge of #89103 - Mark-Simulacrum:migrate-2021, r=estebankbors-1/+1
Migrate in-tree crates to 2021 This replaces #89075 (cherry picking some of the commits from there), and closes #88637 and fixes #89074. It excludes a migration of the library crates for now (see tidy diff) because we have some pending bugs around macro spans to fix there. I instrumented bootstrap during the migration to make sure all crates moved from 2018 to 2021 had the compatibility warnings applied first. Originally, the intent was to support cargo fix --edition within bootstrap, but this proved fairly difficult to pull off. We'd need to architect the check functionality to support running cargo check and cargo fix within the same x.py invocation, and only resetting sysroots on check. Further, it was found that cargo fix doesn't behave too well with "not quite workspaces", such as Clippy which has several crates. Bootstrap runs with --manifest-path ... for all the tools, and this makes cargo fix only attempt migration for that crate. We can't use e.g. --workspace due to needing to maintain sysroots for different phases of compilation appropriately. It is recommended to skip the mass migration of Cargo.toml's to 2021 for review purposes; you can also use `git diff d6cd2c6c877110748296760aefddc21a0ea1d316 -I'^edition = .20...$'` to ignore the edition = 2018/21 lines in the diff.
2021-09-21Handle type params in insig dtorsAman Arora-10/+16
2021-09-212229: Early exit when we see an insigificant dropAman Arora-9/+33
2021-09-20Migrate to 2021Mark Rousskov-1/+1
2021-09-20Do not store visibility in *ItemRef.Camille GILLOT-1/+1
2021-09-09Remove the queriesDeadbeef-75/+13
2021-09-09Const drop selection candidatesDeadbeef-1/+2
2021-09-09Const droppingDeadbeef-11/+76
2021-08-27Auto merge of #88371 - Manishearth:rollup-pkkjsme, r=Manishearthbors-1/+12
Rollup of 11 pull requests Successful merges: - #87832 (Fix debugger stepping behavior with `match` expressions) - #88123 (Make spans for tuple patterns in E0023 more precise) - #88215 (Reland #83738: "rustdoc: Don't load all extern crates unconditionally") - #88216 (Don't stabilize creation of TryReserveError instances) - #88270 (Handle type ascription type ops in NLL HRTB diagnostics) - #88289 (Fixes for LLVM change 0f45c16f2caa7c035e5c3edd40af9e0d51ad6ba7) - #88320 (type_implements_trait consider obligation failure on overflow) - #88332 (Add argument types tait tests) - #88340 (Add `c_size_t` and `c_ssize_t` to `std::os::raw`.) - #88346 (Revert "Add type of a let tait test impl trait straight in let") - #88348 (Add field types tait tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-08-26Rollup merge of #88123 - camelid:tup-pat-precise-spans, r=estebankManish Goregaokar-1/+12
Make spans for tuple patterns in E0023 more precise As suggested in #86307. Closes #86307. r? ````@estebank````
2021-08-26add `tcx` to `fn walk`lcnr-2/+2
2021-08-26make unevaluated const substs optionallcnr-2/+3
2021-08-26require a `tcx` for `TypeVisitor`lcnr-0/+3
2021-08-22Fix typos “a”→“an”Frank Steffahn-2/+2
2021-08-21Make E0023 spans even more preciseNoah Lev-1/+12
2021-08-18Fold `vtable_trait_upcasting_coercion_new_vptr_slot` logic into obligation ↵Charles Lew-1/+2
processing.
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-1/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
2021-07-10Add impl_constness queryDeadbeef-0/+11
2021-07-06Revert "Revert "Merge CrateDisambiguator into StableCrateId""bjorn3-8/+1
This reverts commit 8176ab8bc18fdd7d3c2cf7f720c51166364c33a3.
2021-07-04Combine individual limit queries into single `limits` queryAaron Hill-1/+1
2021-07-04Query-ify global limit attribute handlingAaron Hill-1/+1
2021-07-03Simplify `visit_region` implementationYuki Okushi-13/+4
2021-07-03Correct `visit_region` implementationYuki Okushi-1/+26
2021-07-03Use `BoundVarsCollector` for nowYuki Okushi-9/+92
2021-07-03Fix const-generics ICE related to bindingYuki Okushi-1/+8
2021-07-01Include terminators in instance size estimateTomasz Miąsko-1/+1
For example, drop glue generated for struct below, doesn't have any statements, only terminators. Previously it received an estimate of 0, the new estimate is 13 (6+5 drop terminators, +1 resume, +1 return). struct S { a: String, b: String, c: String, d: String, e: String, f: String, } Originally reported in https://github.com/rust-lang/rust/issues/69382#issue-569392141
2021-06-07Revert "Merge CrateDisambiguator into StableCrateId"bjorn3-1/+8
This reverts commit d0ec85d3fb6d322496cb8f4bc1c21e19f23284ad.
2021-06-02Restrict access to crate_name.Camille GILLOT-8/+1
Also remove original_crate_name, which had the exact same implementation
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-1/+8
2021-05-30Restrict access to crate_name.Camille GILLOT-8/+1
Also remove original_crate_name, which had the exact same implementation
2021-05-30Merge CrateDisambiguator into StableCrateIdbjorn3-7/+0