about summary refs log tree commit diff
path: root/compiler/rustc_hir/src
AgeCommit message (Collapse)AuthorLines
2023-02-25Add ErrorGuaranteed to HIR ExprKind::ErrMichael Goulet-5/+5
2023-02-25Add ErrorGuaranteed to HIR TyKind::ErrMichael Goulet-4/+4
2023-02-22diagnostics: if AssocFn has self argument, describe as methodMichael Howell-0/+9
Discussed in https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515 This commit also changes the tooltips on rustdoc intra-doc links targeting methods.
2023-02-21Rollup merge of #108141 - spastorino:add_rpitit_queries, r=compiler-errorsDylan DPC-2/+4
Add rpitit queries This is part of the changes we are making to lower RPITITs as an associated type. The rest of the stuff will follow under a `-Z` flag. I still need to add comments to the code, explain stuff and also I'd need to avoid encoding in metadata when rpitit queries return `&[]` r? `@compiler-errors`
2023-02-20Rollup merge of #108255 - fee1-dead-contrib:fix-old-fixme, r=cjgillotMatthias Krüger-2/+0
Remove old FIXMEs referring to #19596 Having an inner function that accepts a mutable reference seems to be the only way this can be expressed. Taking a mutable reference would call the same function with a new type &mut F which then causes the infinite recursion error in #19596.
2023-02-20Remove old FIXMEs referring to #19596Deadbeef-2/+0
2023-02-19Add associated_items_for_impl_trait_in_trait querySantiago Pastorino-2/+4
2023-02-16`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`Maybe Waffle-7/+4
2023-02-14Add `of_trait` to DefKind::Impl.Camille GILLOT-6/+8
2023-02-13rustc_resolve: Remove `Resolver::clone_output`Vadim Petrochenkov-2/+2
And remove `Clone` impls and `Lrc`s that are no longer necessary
2023-02-10Resolve documentation links in rustc and store the results in metadataVadim Petrochenkov-1/+15
This commit implements MCP https://github.com/rust-lang/compiler-team/issues/584 It also removes code that is no longer used, and that includes code cloning resolver, so issue #83761 is fixed.
2023-02-07Rename PointerSized to PointerLikeMichael Goulet-1/+1
2023-01-30Rollup merge of #107125 - ↵Matthias Krüger-3/+360
WaffleLapkin:expect_an_item_in_your_hir_by_the_next_morning, r=Nilstrieb Add and use expect methods to hir. [The future has come](https://github.com/rust-lang/rust/pull/106090/files#r1070062462). r? `@Nilstrieb` tbh I'm not even sure if it's worth it
2023-01-30fix `TraitItemKind::expect_type` docsMaybe Waffle-1/+1
2023-01-30Improve ICE messages for `*::expect_*`Maybe Waffle-49/+69
2023-01-28Remove `HirId -> LocalDefId` map from HIR.Camille GILLOT-10/+2
2023-01-28Take a LocalDefId in hir::Visitor::visit_fn.Camille GILLOT-21/+27
2023-01-27Impl HashStable/Encodable/Decodable for ObligationCause.Camille GILLOT-2/+2
2023-01-26Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obkbors-0/+11
Move format_args!() into AST (and expand it during AST lowering) Implements https://github.com/rust-lang/compiler-team/issues/541 This moves FormatArgs from rustc_builtin_macros to rustc_ast_lowering. For now, the end result is the same. But this allows for future changes to do smarter things with format_args!(). It also allows Clippy to directly access the ast::FormatArgs, making things a lot easier. This change turns the format args types into lang items. The builtin macro used to refer to them by their path. After this change, the path is no longer relevant, making it easier to make changes in `core`. This updates clippy to use the new language items, but this doesn't yet make clippy use the ast::FormatArgs structure that's now available. That should be done after this is merged.
2023-01-23Add hint for missing lifetime bound on trait object when type alias is usedyanchen4791-0/+7
2023-01-20Add and use expect methods to hir.Maybe Waffle-3/+340
2023-01-19Rollup merge of #106927 - Ezrashaw:e0606-make-machine-applicable, r=estebankGuillaume Gomez-0/+8
make `CastError::NeedsDeref` create a `MachineApplicable` suggestion Fixes #106903 Simple impl for the linked issue. I also made some other small changes: - `CastError::ErrorGuaranteed` now owns an actual `ErrorGuaranteed`. This better enforces the static guarantees of `ErrorGuaranteed`. - `CastError::NeedDeref` code simplified a bit, we now just suggest the `*`, instead of the whole expression as well.
2023-01-19Transform async ResumeTy in generator transformArpad Borsos-0/+1
- Eliminates all the `get_context` calls that async lowering created. - Replace all `Local` `ResumeTy` types with `&mut Context<'_>`. The `Local`s that have their types replaced are: - The `resume` argument itself. - The argument to `get_context`. - The yielded value of a `yield`. The `ResumeTy` hides a `&mut Context<'_>` behind an unsafe raw pointer, and the `get_context` function is being used to convert that back to a `&mut Context<'_>`. Ideally the async lowering would not use the `ResumeTy`/`get_context` indirection, but rather directly use `&mut Context<'_>`, however that would currently lead to higher-kinded lifetime errors. See <https://github.com/rust-lang/rust/issues/105501>. The async lowering step and the type / lifetime inference / checking are still using the `ResumeTy` indirection for the time being, and that indirection is removed here. After this transform, the generator body only knows about `&mut Context<'_>`.
2023-01-18special case removing `&` suggestionEzra Shaw-0/+8
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-3/+3
2023-01-12parse const closuresDeadbeef-0/+2
2023-01-12Expand format_args!() in rust_ast_lowering.Mara Bos-0/+3
2023-01-11Turn format arguments types into lang items.Mara Bos-0/+8
2023-01-11fix typo LocalItemId -> ItemLocalIdklensy-2/+2
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-9/+7
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2023-01-04get_parent and find_parentMichael Goulet-1/+1
2023-01-04rename get_parent_node to parent_idMichael Goulet-1/+1
2023-01-02Reduce HIR debug outputNilstrieb-4/+33
HIR debug output is currently very verbose, especially when used with the alternate (`#`) flag. This commit reduces the amount of noisy newlines by forcing a few small key types to stay on one line, which makes the output easier to read and scroll by. ``` $ rustc +after hello_world.rs -Zunpretty=hir-tree | wc -l 582 $ rustc +before hello_world.rs -Zunpretty=hir-tree | wc -l 932 ```
2022-12-29Rollup merge of #106221 - Nilstrieb:rptr-more-like-ref-actually, ↵Matthias Krüger-3/+3
r=compiler-errors Rename `Rptr` to `Ref` in AST and HIR The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-28Rename `Rptr` to `Ref` in AST and HIRNilstrieb-3/+3
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-28Update bootstrap cfgPietro Albini-8/+1
2022-12-22abort immediately on bad mem::zeroed/uninitRalf Jung-2/+3
2022-12-20Auto merge of #105880 - Nilstrieb:make-newtypes-less-not-rust, r=oli-obkbors-1/+1
Improve syntax of `newtype_index` This makes it more like proper Rust and also makes the implementation a lot simpler. Mostly just turns weird flags in the body into proper attributes. It should probably also be converted to an attribute macro instead of function-like, but that can be done in a future PR.
2022-12-19Revert "Replace usage of `ResumeTy` in async lowering with `Context`"Andrew Pollack-1/+2
2022-12-18A few small cleanups for `newtype_index`Nilstrieb-1/+1
Remove the `..` from the body, only a few invocations used it and it's inconsistent with rust syntax. Use `;` instead of `,` between consts. As the Rust syntax gods inteded.
2022-12-12minor code cleanupsMatthias Krüger-6/+1
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-1/+1
2022-12-08Rollup merge of #105441 - nnethercote:rm-UnsafetyState, r=lcnrMatthias Krüger-1/+1
Remove `UnsafetyState` r? `@lcnr`
2022-12-08Rollup merge of #105423 - oli-obk:symbols, r=jackh726Matthias Krüger-17/+21
Use `Symbol` for the crate name instead of `String`/`str` It always got converted to a symbol anyway
2022-12-08Fix a typo.Nicholas Nethercote-1/+1
2022-12-07Use `Symbol` for the crate name instead of `String`/`str`Oli Scherer-17/+21
2022-12-06Rollup merge of #105250 - Swatinem:async-rm-resumety, r=oli-obkMatthias Krüger-2/+1
Replace usage of `ResumeTy` in async lowering with `Context` Replaces using `ResumeTy` / `get_context` in favor of using `&'static mut Context<'_>`. Usage of the `'static` lifetime here is technically "cheating", and replaces the raw pointer in `ResumeTy` and the `get_context` fn that pulls the correct lifetimes out of thin air. fixes https://github.com/rust-lang/rust/issues/104828 and https://github.com/rust-lang/rust/pull/104321#issuecomment-1336363077 r? `@oli-obk`
2022-12-06Auto merge of #105175 - michaelwoerister:add-stable-ord-trait, r=nagisabors-1/+5
Add StableOrd trait as proposed in MCP 533. The `StableOrd` trait can be used to mark types as having a stable sort order across compilation sessions. Collections that sort their items in a stable way can safely implement HashStable by hashing items in sort order. See https://github.com/rust-lang/compiler-team/issues/533 for more information.
2022-12-06Replace usage of `ResumeTy` in async lowering with `Context`Arpad Borsos-2/+1
Replaces using `ResumeTy` / `get_context` in favor of using `&'static mut Context<'_>`. Usage of the `'static` lifetime here is technically "cheating", and replaces the raw pointer in `ResumeTy` and the `get_context` fn that pulls the correct lifetimes out of thin air.
2022-12-03Rollup merge of #105050 - WaffleLapkin:uselessrefign, r=jyn514Matthias Krüger-20/+20
Remove useless borrows and derefs They are nothing more than noise. <sub>These are not all of them, but my clippy started crashing (stack overflow), so rip :(</sub>