about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/check/check.rs
AgeCommit message (Collapse)AuthorLines
2025-09-27Rename various "concrete opaque type" terminology to say "hidden type"Boxy Uwu-2/+2
2025-09-12Split AssocContainer::{InherentImpl,TraitImpl}Cameron Steffen-9/+6
2025-09-12Rename AssocItemContainer -> AssocContainerCameron Steffen-6/+6
2025-09-02stabilize extended_varargs_abi_supportRalf Jung-1/+1
2025-08-22change HIR typeck unification handling approachlcnr-0/+26
2025-07-31remove rustc_attr_data_structuresJana Dönszelmann-7/+7
2025-07-27check_static_item: explain should_check_for_sync choicesRalf Jung-1/+3
2025-07-27Rollup merge of #144226 - cjgillot:known-panics-panics, r=oli-obkMatthias Krüger-1/+2
Do not assert layout in KnownPanicsLint. Fixes rust-lang/rust#121176 Fixes rust-lang/rust#129109 Fixes rust-lang/rust#130970 Fixes rust-lang/rust#131347 Fixes rust-lang/rust#139872 Fixes rust-lang/rust#140332
2025-07-26Do not check Sync during type_of.Camille GILLOT-0/+2
2025-07-25Check statics' type in type_of.Camille GILLOT-1/+0
2025-07-24Remove dead code and extend test coverage and diagnostics around itOli Scherer-9/+29
We lost the following comment during refactorings: The current code for niche-filling relies on variant indices instead of actual discriminants, so enums with explicit discriminants (RFC 2363) would misbehave.
2025-07-17Rollup merge of #143895 - compiler-errors:trait-wc-item-bound-host-eff, ↵León Orell Valerian Liehr-4/+6
r=oli-obk Dont collect assoc ty item bounds from trait where clause for host effect predicates For background, we uplift `where Self::Assoc: Trait` bounds in a trait's where clauses into *item bounds* on `type Assoc;`. This is because before we *had* syntactical item bounds, users would express their item bounds like so. Let's opt out of doing this same behavior for `HostEffect` predicates like `where Self::Assoc: [const] Trait`. I left a comment in the code: ```rust // FIXME(const_trait_impl): We *could* uplift the // `where Self::Assoc: [const] Trait` bounds from the parent trait // here too, but we'd need to split `const_conditions` into two // queries (like we do for `trait_explicit_predicates_and_bounds`) // since we need to also filter the predicates *out* of the const // conditions or they lead to cycles in the trait solver when // utilizing these bounds. For now, let's do nothing. ``` As an aside, this was an ICE that was only triggerable when building libraries and not binaries because we never were calling `tcx.ensure_ok().explicit_implied_const_bounds(def_id);` on associated types like we should have been. I adjusted the calls to `ensure_ok` to make sure this happens, so we catch bugs like this in the future more easily. As another aside, I fixed the bound uplifting logic for *always const* predicates, since those act like normal clauses and have no notion of conditional constness. r? ```@oli-obk``` ```@fee1-dead``` or anyone really Fixes rust-lang/rust#133275
2025-07-13Ensure proper item queries for assoc tysMichael Goulet-4/+6
2025-07-13Retire hir::ForeignItemRef.Camille GILLOT-14/+16
2025-07-07Add `ty_span` queryOli Scherer-6/+5
2025-07-06Rewrite empty attribute lintJonathan Brouwer-4/+3
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-30Don't run hir wfcheck if ty wfcheck handled everythingOli Scherer-5/+53
2025-06-30Stop requiring HIR for impl item wf checksOli Scherer-1/+5
2025-06-30Stop requiring HIR for trait item wf checksOli Scherer-1/+16
2025-06-30Merge `lower_trait_item` and `lower_impl_item` into `check_item_type`Oli Scherer-0/+26
2025-06-30Merge `lower_item` into `check_item_type`Oli Scherer-13/+75
2025-06-30Move lazy type alias checks to non-hir-wfckOli Scherer-3/+18
2025-06-30Check variances in the non-hir wfcheckerOli Scherer-0/+7
2025-06-30Don't look at static items' HIR for wfcheckOli Scherer-9/+8
2025-06-30Unconditionally run `check_item_type` on all itemsOli Scherer-4/+0
2025-06-27Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-deadMatthias Krüger-1/+1
New const traits syntax This PR only affects the AST and doesn't actually change anything semantically. All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error r? ``@fee1-dead`` cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
2025-06-26Change const trait bound syntax from ~const to [const]Oli Scherer-1/+1
2025-06-25rename RegionVariableOrigin::MiscVariable to RegionVariableOrigin::MiscMichael Goulet-1/+1
2025-06-23unsupported_calling_conventions: print which ABI this is aboutRalf Jung-1/+3
2025-06-23Clarify note in rustc_ast_lowering still appliesJubilee Young-2/+3
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-06-23compiler: Remove unsupported_fn_ptr_calling_conventions lintJubilee Young-26/+2
2025-06-23hir_analysis: Avoid repeating unsupported ABI errorsJubilee Young-8/+2
2025-06-23move naked checks out of check_attr.rsJana Dönszelmann-1/+0
2025-06-23rewrite #[naked] parserJana Dönszelmann-1/+2
2025-06-21Port `#[rustc_pub_transparent]` to the new attribute systemPavel Grigorenko-1/+6
2025-06-12add `extern "custom"` functionsFolkert de Vries-1/+13
2025-06-09hir_analysis: Elaborate on lint strategy for unsupported ABIsJubilee-1/+3
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-06-09compiler: Fix reusing same lint on fn ptrs with newly-deprecated ABIsJubilee Young-16/+24
2025-06-09Auto merge of #141435 - RalfJung:unsupported_calling_conventions, ↵bors-18/+51
r=workingjubilee Add (back) `unsupported_calling_conventions` lint to reject more invalid calling conventions This adds back the `unsupported_calling_conventions` lint that was removed in https://github.com/rust-lang/rust/pull/129935, in order to start the process of dealing with https://github.com/rust-lang/rust/issues/137018. Specifically, we are going for the plan laid out [here](https://github.com/rust-lang/rust/issues/137018#issuecomment-2672118326): - thiscall, stdcall, fastcall, cdecl should only be accepted on x86-32 - vectorcall should only be accepted on x86-32 and x86-64 The difference to the status quo is that: - We stop accepting stdcall, fastcall on targets that are windows && non-x86-32 (we already don't accept these on targets that are non-windows && non-x86-32) - We stop accepting cdecl on targets that are non-x86-32 - (There is no difference for thiscall, this was already a hard error on non-x86-32) - We stop accepting vectorcall on targets that are windows && non-x86-* Vectorcall is an unstable ABI so we can just make this a hard error immediately. The others are stable, so we emit the `unsupported_calling_conventions` forward-compat lint. I set up the lint to show up in dependencies via cargo's future-compat report immediately, but we could also make it show up just for the local crate first if that is preferred. try-job: i686-msvc-1 try-job: x86_64-msvc-1 try-job: test-various
2025-06-08add specific help messages for stdcall and cdeclRalf Jung-4/+22
2025-06-08add (back) unsupported_calling_conventions lint to reject more invalid ↵Ralf Jung-17/+32
calling conventions
2025-06-08Auto merge of #142074 - oli-obk:its-finally-gone, r=petrochenkovbors-0/+42
Remove CollectItemTypesVisitor I always felt like we were very unnecessarily walking the HIR, let's see if perf agrees There is lots to ~~improve~~ consolidate further here, as we still have 3 item wfchecks: * check_item (matching on the hir::ItemKind) * actually doing trait solver based checks (by using HIR spans) * lower_item (matching on the hir::ItemKind after loading it again??) * just ensure_ok-ing a bunch of queries * check_item_type (matching on DefKind) * some type based checks, mostly ensure_ok-ing a bunch of queries fixes rust-lang/rust#121429
2025-06-06Rollup merge of #142103 - scottmcm:fieldidx-in-interp, r=oli-obkGuillaume Gomez-1/+1
Update `InterpCx::project_field` to take `FieldIdx` As suggested by Ralf in https://github.com/rust-lang/rust/pull/142005#discussion_r2125839015
2025-06-05Update `InterpCx::project_field` to take `FieldIdx`Scott McMurray-1/+1
As suggested by Ralf in 142005.
2025-06-05Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of NoneOli Scherer-1/+1
2025-06-05wfcheck closuresOli Scherer-0/+9
2025-06-05Move generic arg checks from the hir item types visitor to ty wfcheckOli Scherer-1/+23
2025-06-05Move opaque type checks from the hir item types visitor onto the wfcheck of ↵Oli Scherer-0/+11
the opaqe type itself
2025-05-28Stabilise `repr128`beetrees-14/+1
2025-05-27Rename unpack to kindMichael Goulet-2/+2