summary refs log tree commit diff
path: root/compiler/rustc_passes/src
AgeCommit message (Collapse)AuthorLines
2023-01-19Auto merge of #106810 - oli-obk:resolver_reverse_plumbing, r=petrochenkovbors-1/+1
Various cleanups around pre-TyCtxt queries and functions part of #105462 based on https://github.com/rust-lang/rust/pull/106776 (everything starting at [0e2b39f](https://github.com/rust-lang/rust/pull/106810/commits/0e2b39fd1ffde51b50d45ccbe41de52b85136b8b) is new in this PR) r? `@petrochenkov` I think this should be most of the uncontroversial part of #105462.
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-15/+15
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-15/+15
2023-01-17Auto merge of #106627 - Ezrashaw:no-e0711-without-staged-api, r=Mark-Simulacrumbors-0/+6
fix: don't emit `E0711` if `staged_api` not enabled Fixes #106589 Simple fix, added UI test. As an aside, it seems a lot of features are susceptible to this, `E0711` stands out to me because it's perma-unstable and we are effectively exposing an implementation detail.
2023-01-16Move compiler input and ouput paths into sessionOli Scherer-1/+1
2023-01-14fix: don't emit `E0711` if `staged_api` not enabledEzra Shaw-0/+6
2023-01-14change impl_trait_ref query to return EarlyBinder; remove ↵Kyle Matsuda-4/+4
bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata
2023-01-14change usages of impl_trait_ref to bound_impl_trait_refKyle Matsuda-4/+4
2023-01-12[RFC 2397] Deny incorrect locationsCaio-0/+18
2022-12-28Rename `Rptr` to `Ref` in AST and HIRNilstrieb-2/+2
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-25fix more clippy::style findingsMatthias Krüger-3/+1
match_result_ok obfuscated_if_else single_char_add writeln_empty_string collapsible_match iter_cloned_collect unnecessary_mut_passed
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-26/+18
2022-12-20Auto merge of #105880 - Nilstrieb:make-newtypes-less-not-rust, r=oli-obkbors-6/+4
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-19Rollup merge of #105864 - matthiaskrgr:compl, r=NilstriebDylan DPC-1/+0
clippy::complexity fixes filter_next needless_question_mark bind_instead_of_map manual_find derivable_impls map_identity redundant_slicing skip_while_next unnecessary_unwrap needless_bool r? `@compiler-errors`
2022-12-19clippy::complexity fixesMatthias Krüger-1/+0
filter_next needless_question_mark bind_instead_of_map manual_find derivable_impls map_identity redundant_slicing skip_while_next unnecessary_unwrap needless_bool
2022-12-18A few small cleanups for `newtype_index`Nilstrieb-4/+2
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-18Make `#[debug_format]` an attribute in `newtype_index`Nilstrieb-2/+2
This removes the `custom` format functionality as its only user was trivially migrated to using a normal format. If a new use case for a custom formatting impl pops up, you can add it back.
2022-12-18Rollup merge of #105875 - matthiaskrgr:needless_borrowed_reference, r=oli-obkMatthias Krüger-2/+2
don't destuct references just to reborrow
2022-12-18don't restuct references just to reborrowMatthias Krüger-2/+2
2022-12-18avoid .into() conversion to identical typesMatthias Krüger-2/+0
2022-12-07Rollup merge of #105267 - compiler-errors:issue-104613, r=oli-obkMatthias Krüger-3/+3
Don't ICE in ExprUseVisitor on FRU for non-existent struct Fixes #104613 Fixes #105202
2022-12-06Rollup merge of #105174 - chenyukang:yukang/fix-105028-unused, r=eholkMatthias Krüger-1/+7
Suggest removing struct field from destructive binding only in shorthand scenario Fixes #105028
2022-12-04drive-by: move field_index to typeck resultsMichael Goulet-3/+3
2022-12-01rustc_hir: Change representation of import paths to support multiple resolutionsVadim Petrochenkov-1/+1
2022-12-01rustc_hir: Relax lifetime requirements on `Visitor::visit_path`Vadim Petrochenkov-5/+5
2022-12-01fix #105028, Only suggest removing struct field from destructive binding in ↵yukang-1/+7
shorthand scenario
2022-11-29Rollup merge of #105023 - tmiasko:asm-sym-static-reachable, r=wesleywiserMatthias Krüger-0/+11
Statics used in reachable function's inline asm are reachable Fixes #104925.
2022-11-29Auto merge of #104947 - cjgillot:verify-hir-nest, r=oli-obkbors-24/+51
Verify that HIR parenting and Def parenting match. This relationship is relied upon for `tcx.hir_owner_parent` query to return an accurate result.
2022-11-28Statics used in reachable function's inline asm are reachableTomasz Miąsko-0/+11
2022-11-28Rename `NestedMetaItem::[Ll]iteral` as `NestedMetaItem::[Ll]it`.Nicholas Nethercote-6/+3
We already use a mix of `Literal` and `Lit`. The latter is better because it is shorter without causing any ambiguity.
2022-11-28Rename `ast::Lit` as `ast::MetaItemLit`.Nicholas Nethercote-2/+5
2022-11-26Verify that HIR parenting and Def parenting match.Camille GILLOT-24/+51
2022-11-24Auto merge of #104507 - WaffleLapkin:asderefsyou, r=wesleywiserbors-5/+4
Use `as_deref` in compiler (but only where it makes sense) This simplifies some code :3 (there are some changes that are not exacly `as_deref`, but more like "clever `Option`/`Result` method use")
2022-11-20Change to Ty::is_inhabited_fromCameron Steffen-13/+12
2022-11-18couple of clippy::perf fixesMatthias Krüger-2/+2
2022-11-17Auto merge of #104170 - cjgillot:hir-def-id, r=fee1-deadbors-41/+22
Record `LocalDefId` in HIR nodes instead of a side table This is part of an attempt to remove the `HirId -> LocalDefId` table from HIR. This attempt is a prerequisite to creation of `LocalDefId` after HIR lowering (https://github.com/rust-lang/rust/pull/96840), by controlling how `def_id` information is accessed. This first part adds the information to HIR nodes themselves instead of a table. The second part is https://github.com/rust-lang/rust/pull/103902 The third part will be to make `hir::Visitor::visit_fn` take a `LocalDefId` as last parameter. The fourth part will be to completely remove the side table.
2022-11-16Use `as_deref` in compiler (but only where it makes sense)Maybe Waffle-5/+4
2022-11-13Rollup merge of #104320 - fee1-dead-contrib:use-derive-const-in-std, r=oli-obkMatthias Krüger-0/+8
Use `derive_const` and rm manual StructuralEq impl This does not change any semantics of the impl except for the const stability. It should be fine because trait methods and const bounds can never be used in stable without enabling `const_trait_impl`. cc `@oli-obk`
2022-11-13Store a LocalDefId in hir::Variant & hir::Field.Camille GILLOT-20/+16
2022-11-13Store a LocalDefId in hir::GenericParam.Camille GILLOT-3/+2
2022-11-13Store LocalDefId in hir::Closure.Camille GILLOT-6/+4
2022-11-13Ensure codegen_fn_attrs during collection.Camille GILLOT-12/+0
2022-11-12Auto merge of #103812 - clubby789:improve-include-bytes, r=petrochenkovbors-1/+2
Delay `include_bytes` to AST lowering Hopefully addresses #65818. This PR introduces a new `ExprKind::IncludedBytes` which stores the path and bytes of a file included with `include_bytes!()`. We can then create a literal from the bytes during AST lowering, which means we don't need to escape the bytes into valid UTF8 which is the cause of most of the overhead of embedding large binary blobs.
2022-11-12Use `derive_const` and rm manual StructuralEq implDeadbeef-0/+8
2022-11-12Rollup merge of #103970 - oli-obk:unhide_unknown_spans, r=estebankDylan DPC-13/+45
Unhide unknown spans r? ```@estebank```
2022-11-11Introduce `ExprKind::IncludedBytes`clubby789-1/+2
2022-11-11Print all labels, even if they have no span. Fall back to main item's span.Oli Scherer-13/+45
2022-11-10Consider `#[must_use]` annotation on `async fn` as also affecting the ↵Esteban Küber-12/+2
`Future::Output` No longer lint against `#[must_use] async fn foo()`. When encountering a statement that awaits on a `Future`, check if the `Future`'s parent item is annotated with `#[must_use]` and emit a lint if so. This effectively makes `must_use` an annotation on the `Future::Output` instead of only the `Future` itself. Fix #78149.
2022-11-09DiagnosticBuilder -> DiagnosticMichael Goulet-1/+2
2022-11-06Auto merge of #103720 - crlf0710:most_translation_attr, r=compiler-errorsbors-2/+0
Lint against usages of `struct_span_lint_hir`. r? `@compiler-errors`