about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis
AgeCommit message (Collapse)AuthorLines
2023-09-19Don't complain on a single non-exhaustive 1-zstMichael Goulet-19/+29
2023-09-18Prototype using const generic for simd_shuffle IDX arrayOli Scherer-21/+23
2023-09-17Auto merge of #115334 - RalfJung:transparent-aligned-zst, r=compiler-errorsbors-43/+27
repr(transparent): it's fine if the one non-1-ZST field is a ZST This code currently gets rejected: ```rust #[repr(transparent)] struct MyType([u16; 0]) ``` That clearly seems like a bug to me: `repr(transparent)` [got defined ](https://github.com/rust-lang/rust/issues/77841#issuecomment-716575747) as having any number of 1-ZST fields plus optionally one more field; `MyType` clearly satisfies that definition. This PR changes the `repr(transparent)` logic to actually match that definition.
2023-09-16Rollup merge of #115860 - Soveu:varargs2, r=WaffleLapkinMatthias Krüger-1/+1
Enable varargs support for AAPCS calling convention Welp, I was looking for a reason why this shouldn't be stabilized after so long... and here it is.
2023-09-15Auto merge of #115853 - obeis:hir-analysis-migrate-diagnostics-6, ↵bors-77/+116
r=compiler-errors Migrate `rustc_hir_analysis` to session diagnostic [Part 6] Part 6: Finish `coherence/inherent_impls.rs` file
2023-09-14Enable varargs support for AAPCS calling conventionSoveu-1/+1
This is the default calling convention for ARM - it is used for extern "C", therefore it supports varargs.
2023-09-14Auto merge of #115677 - matthewjasper:let-expr-recovery, r=b-naberbors-1/+5
Improve invalid let expression handling - Move all of the checks for valid let expression positions to parsing. - Add a field to ExprKind::Let in AST/HIR to mark whether it's in a valid location. - Suppress some later errors and MIR construction for invalid let expressions. - Fix a (drop) scope issue that was also responsible for #104172. Fixes #104172 Fixes #104868
2023-09-14Migrate `rustc_hir_analysis` to session diagnosticObei Sideg-77/+116
Part 6: Finish `coherence/inherent_impls.rs`
2023-09-14Paper over an accidental regressionOli Scherer-1/+9
2023-09-12Auto merge of #115699 - RalfJung:interpret-abi-compat, r=oli-obkbors-0/+8
interpret: change ABI-compat test to be type-based This makes the test consistent across targets. Otherwise the chances are very high that ABI mismatches get accepted on x86_64 but still fail on many other targets with more complicated ABIs. This implements (most of) the rules described in https://github.com/rust-lang/rust/pull/115476.
2023-09-11Move let expression checking to parsingMatthew Jasper-1/+1
There was an incomplete version of the check in parsing and a second version in AST validation. This meant that some, but not all, invalid uses were allowed inside macros/disabled cfgs. It also means that later passes have a hard time knowing when the let expression is in a valid location, sometimes causing ICEs. - Add a field to ExprKind::Let in AST/HIR to mark whether it's in a valid location. - Suppress later errors and MIR construction for invalid let expressions.
2023-09-11Don't create drop scopes after item statementsMatthew Jasper-1/+5
These scopes would not exist in MIR and can cause ICEs with invalid uses of let expressions.
2023-09-11Rollup merge of #115727 - fee1-dead-contrib:effect-fallback, r=oli-obkMatthias Krüger-3/+6
Implement fallback for effect param r? `@oli-obk` or `@lcnr` tracking issue for this ongoing work: https://github.com/rust-lang/rust/issues/110395
2023-09-11add `is_host_effect` to `GenericParamDefKind::Const` and address reviewDeadbeef-3/+6
2023-09-11explain why DispatchFromDyn does the check it doesRalf Jung-0/+8
2023-09-08E0220: only suggests associated types if there's only one candidateLieselotte-25/+19
2023-09-08Improve "associated type not found" diagnosticsLieselotte-11/+42
2023-09-08Stabilize impl_trait_projectionsMichael Goulet-132/+3
2023-09-07Add noteMichael Goulet-0/+2
2023-09-07Don't emit refining_impl_trait for private itemsMichael Goulet-0/+28
2023-09-07Use self instead of the actual self tyMichael Goulet-3/+15
2023-09-07Implement refinement lint for RPITITMichael Goulet-0/+299
2023-09-06Auto merge of #115401 - Zoxc:freeze, r=oli-obkbors-0/+4
Add `FreezeLock` type and use it to store `Definitions` This adds a `FreezeLock` type which allows mutation using a lock until the value is frozen where it can be accessed lock-free. It's used to store `Definitions` in `Untracked` instead of a `RwLock`. Unlike the current scheme of leaking read guards this doesn't deadlock if definitions is written to after no mutation are expected.
2023-09-05Correctly deny late-bound lifetimes from parent in anon consts and TAITsMichael Goulet-30/+73
2023-09-02Freeze `Definitions` earlierJohn Kåre Alsaker-0/+4
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-43/+27
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/+31
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.