about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src
AgeCommit message (Collapse)AuthorLines
2023-09-01Don't manually walk through param indices when adding implicit Sized and ↵Michael Goulet-129/+145
ConstParamHasTy
2023-09-01Auto merge of #113201 - oli-obk:recursive_type_alias, r=estebank,compiler-errorsbors-7/+12
Permit recursive weak type aliases I saw #63097 and thought "we can do ~~better~~ funnier". So here it is. It's not useful, but it's certainly something. This may actually become feasible with lazy norm (so in 5 years (constant, not reducing over time)). r? `@estebank` cc `@GuillaumeGomez`
2023-08-30rustc_layout_scalar_valid_range makes ctors unsafeMichael Goulet-8/+9
2023-08-30Permit recursive weak type aliasesOli Scherer-7/+12
2023-08-30Revert "Auto merge of #102417 - oli-obk:opaque_lifetimes2, r=jackh726"Oli Scherer-1/+9
This reverts commit cb9467515b5a9b15aaa905683c6b4dd9e851056c, reversing changes made to 57781b24c54f9548722927ba88c343ff28da94ce.
2023-08-30Auto merge of #114908 - cjgillot:no-let-under, r=compiler-errorsbors-1/+1
Do not compute unneeded query results. r? `@ghost`
2023-08-29repr(transparent): it's fine if the one non-1-ZST field is a ZSTRalf Jung-37/+21
2023-08-29some more is_zst that should be is_1zstRalf Jung-2/+2
2023-08-28Auto merge of #115326 - matthiaskrgr:rollup-qsoa8ar, r=matthiaskrgrbors-77/+100
Rollup of 8 pull requests Successful merges: - #115164 (MIR validation: reject in-place argument/return for packed fields) - #115240 (codegen_llvm/llvm_type: avoid matching on the Rust type) - #115294 (More precisely detect cycle errors from type_of on opaque) - #115310 (Document panic behavior across editions, and improve xrefs) - #115311 (Revert "Suggest using `Arc` on `!Send`/`!Sync` types") - #115317 (Devacationize oli-obk) - #115319 (don't use SnapshotVec in Graph implementation, as it looks unused; use Vec instead) - #115322 (Tweak output of `to_pretty_impl_header` involving only anon lifetimes) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-28Test variances of opaque capturesMichael Goulet-0/+15
2023-08-27More precisely detect cycle errors from type_of on opaqueMichael Goulet-77/+100
2023-08-23Allow MaybeUninit in input and output of inline assemblyTaiki Endo-19/+34
2023-08-22Rollup merge of #115077 - estebank:issue-115019, r=compiler-errorsMichael Goulet-1/+15
Do not emit invalid suggestion in E0191 when spans overlap Fix #115019.
2023-08-22Do not emit invalid suggestion in E0191 when spans overlapEsteban Küber-1/+15
Fix #115019.
2023-08-22unknown unstable lint command linemojave2-0/+1
fix ##113702 fix #113702 unknown unstable lint command lint improve impelementation
2023-08-20Add projection obligations when comparing impl tooJack Huey-1/+8
2023-08-19Do not compute unneeded results.Camille GILLOT-1/+1
2023-08-16Rollup merge of #114746 - compiler-errors:atb-no-const, r=TaKO8KiMatthias Krüger-10/+28
Don't add associated type bound for non-types We had this fix for equality constraints (#99890), but for some reason not trait constraints :sweat_smile: Fixes #114744
2023-08-15Rollup merge of #114772 - fee1-dead-contrib:typed-did, r=b-naberGuillaume Gomez-9/+9
Add `{Local}ModDefId` to more strongly type DefIds` Based on #110862 by `@Nilstrieb`
2023-08-14Rollup merge of #114752 - RickleAndMortimer:issue-113788-fix, r=compiler-errorsMatthias Krüger-1/+1
fixed *const [type error] does not implement the Copy trait Removes "error: arguments for inline assembly must be copyable" when moving an unknown type Fixes: #113788
2023-08-14fixed *const [type error] does not implement the Copy traitnxya-1/+1
2023-08-14Use `{Local}ModDefId` in many queriesNilstrieb-8/+8
2023-08-14Auto merge of #114787 - compiler-errors:issue-114783, r=jackh726bors-1/+10
Select obligations before processing wf obligation in `compare_method_predicate_entailment` We need to select obligations before processing the WF obligation for the `IMPLIED_BOUNDS_ENTAILMENT` lint, since it skips over type variables. Fixes #114783 r? `@jackh726`
2023-08-13Select obligations before processing wf obligation in ↵Michael Goulet-1/+10
compare_method_predicate_entailment
2023-08-13Add typed `{Local}DefId` for modulesNilstrieb-1/+1
This allows for better type safety in the compiler and also improves the documentation for many things, making it clear that they expect modules.
2023-08-12Opaques do not constrain generic paramsMichael Goulet-1/+1
2023-08-11Only check outlives goals on impl compared to traitJack Huey-12/+39
2023-08-11Don't add associated type bound for non-typesMichael Goulet-10/+28
2023-08-08Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obkbors-32/+55
correctly lower `impl const` to bind to host effect param r? `@oli-obk`
2023-08-08Auto merge of #114602 - compiler-errors:rpit-outlives-sadness, r=oli-obkbors-190/+56
Map RPIT duplicated lifetimes back to fn captured lifetimes Use the [`lifetime_mapping`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.OpaqueTy.html#structfield.lifetime_mapping) to map an RPIT's captured lifetimes back to the early- or late-bound lifetimes from its parent function. We may be going thru several layers of mapping, since opaques can be nested, so we introduce `TyCtxt::map_rpit_lifetime_to_fn_lifetime` to loop through several opaques worth of mapping, and handle turning it into a `ty::Region` as well. We can then use this instead of the identity substs for RPITs in `check_opaque_meets_bounds` to address #114285. We can then also use `map_rpit_lifetime_to_fn_lifetime` to properly install bidirectional-outlives predicates for both RPITs and RPITITs. This addresses #114601. I based this on #114574, but I don't actually know how much of that PR we still need, so some code may be redundant now... :shrug: --- Fixes #114597 Fixes #114579 Fixes #114285 Also fixes #114601, since it turns out we had other bugs with RPITITs and their duplicated lifetime params :sweat_smile:. Supersedes #114574 r? `@oli-obk`
2023-08-08Simplify via map_rpit_lifetime_to_fn_lifetimeMichael Goulet-144/+11
2023-08-08Stop using identity args for opaque type wf checks and instead load the args ↵Oli Scherer-76/+113
from the single use of a RPIT in its parent function's return type
2023-08-08Install bidirectional outlives predicates for RPITITs (and RPITs) correctlyMichael Goulet-66/+28
2023-08-08Unconditionally record lifetime mappingMichael Goulet-1/+1
2023-08-08Rollup merge of #114594 - compiler-errors:new-solver-resolve-aliases, r=lcnrMatthias Krüger-1/+1
Structurally normalize weak and inherent in new solver It seems pretty obvious to me that we should be normalizing weak and inherent aliases too, since they can always be normalized. This PR still leaves open the question of what to do with opaques, though 💀 **Also**, we need to structurally resolve the target of a coercion, for the UI test to work. r? `@lcnr`
2023-08-08Rollup merge of #114566 - fmease:type-alias-laziness-is-crate-specific, ↵Matthias Krüger-22/+21
r=oli-obk Store the laziness of type aliases in their `DefKind` Previously, we would treat paths referring to type aliases as *lazy* type aliases if the current crate had lazy type aliases enabled independently of whether the crate which the alias was defined in had the feature enabled or not. With this PR, the laziness of a type alias depends on the crate it is defined in. This generally makes more sense to me especially if / once lazy type aliases become the default in a new edition and we need to think about *edition interoperability*: Consider the hypothetical case where the dependency crate has an older edition (and thus eager type aliases), it exports a type alias with bounds & a where-clause (which are void but technically valid), the dependent crate has the latest edition (and thus lazy type aliases) and it uses that type alias. Arguably, the bounds should *not* be checked since at any time, the dependency crate should be allowed to change the bounds at will with a *non*-major version bump & without negatively affecting downstream crates. As for the reverse case (dependency: lazy type aliases, dependent: eager type aliases), I guess it rules out anything from slight confusion to mild annoyance from upstream crate authors that would be caused by the compiler ignoring the bounds of their type aliases in downstream crates with older editions. --- This fixes #114468 since before, my assumption that the type alias associated with a given weak projection was lazy (and therefore had its variances computed) did not necessarily hold in cross-crate scenarios (which [I kinda had a hunch about](https://github.com/rust-lang/rust/pull/114253#discussion_r1278608099)) as outlined above. Now it does hold. `@rustbot` label F-lazy_type_alias r? `@oli-obk`
2023-08-07Structurally normalize weak and inherent tooMichael Goulet-1/+1
2023-08-07Fix ICEDeadbeef-17/+48
2023-08-07Store the laziness of type aliases in the DefKindLeón Orell Valerian Liehr-22/+21
2023-08-06Add a new `compare_bytes` intrinsic instead of calling `memcmp` directlyScott McMurray-0/+4
2023-08-06lower impl const to bind to host effect paramDeadbeef-35/+27
2023-08-05Consolidate opaque ty and async fn lowering codeMichael Goulet-1/+1
2023-08-04Rollup merge of #114253 - fmease:compute-variances-for-lazy-ty-aliases, ↵Matthias Krüger-9/+63
r=oli-obk Compute variances for lazy type aliases Fixes #114221. CC ``@oli-obk`` r? types
2023-08-03Forbid old-style `simd_shuffleN` intrinsicsOli Scherer-14/+0
2023-08-03Compute variances for lazy type aliasesLeón Orell Valerian Liehr-9/+63
2023-08-02Remove constness from `TraitPredicate`Deadbeef-74/+18
2023-08-02Rollup merge of #114314 - compiler-errors:sized-crit, r=lcnrMatthias Krüger-1/+1
Tweaks to `adt_sized_constraint` fixes a comment, but also some other nits. r? lcnr
2023-08-02Rollup merge of #114301 - ↵Matthias Krüger-4/+5
compiler-errors:dont-error-on-missing-region-outlives, r=spastorino Don't check unnecessarily that impl trait is RPIT We have this random `return_type_impl_trait` function to detect if a function returns an RPIT which is used in outlives suggestions, but removing it doesn't actually change any diagnostics. Let's just remove it. Also, suppress a spurious outlives error from a ReError. Fixes #114274
2023-08-01Fix a commentMichael Goulet-1/+1
2023-08-01Suppress unnecessary outlivesMichael Goulet-4/+5