about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/check
AgeCommit message (Collapse)AuthorLines
2023-01-08Mention signature rather than fn pointers when comparing impl/trait methodsMichael Goulet-22/+14
2023-01-08Add type flags support for Ty and Const late-bound regionsMichael Goulet-1/+1
2023-01-03Move check_region_obligations_and_report_errors to TypeErrCtxtMichael Goulet-7/+10
2022-12-29Rollup merge of #106221 - Nilstrieb:rptr-more-like-ref-actually, ↵Matthias Krüger-1/+1
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-1/+1
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-28Auto merge of #106129 - compiler-errors:compare_method-tweaks, r=BoxyUwUbors-30/+63
Some `compare_method` tweaks 1. Make some of the comparison functions' names more regular 2. Reduce pub scope of some of the things in `compare_method` ~3. Remove some unnecessary opaque type handling code -- `InferCtxt` already is in a mode that doesn't define opaque types~ * moved to a different PR 4. Bubble up `ErrorGuaranteed` for region constraint errors in `compare_method` - Improves a redundant error message in one unit test. 5. Move the `compare_method` module to have a more general name, since it's more like `compare_impl_item` :) 6. Rename `collect_trait_impl_trait_tys`
2022-12-28better names and a commentMichael Goulet-3/+36
2022-12-28Rename module compare_method -> compare_impl_itemMichael Goulet-14/+14
2022-12-28make some things less pubMichael Goulet-5/+5
2022-12-27Emit fewer errors on invalid `#[repr(transparent)]` on `enum`Esteban Küber-4/+2
Fix #68420.
2022-12-25fix more clippy::style findingsMatthias Krüger-4/+1
match_result_ok obfuscated_if_else single_char_add writeln_empty_string collapsible_match iter_cloned_collect unnecessary_mut_passed
2022-12-24Bubble up ErrorGuaranteed from region constraints in method item compareMichael Goulet-7/+7
2022-12-24Rename some compare_method functionsMichael Goulet-7/+7
2022-12-24Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholkMatthias Krüger-13/+13
rustc: Remove needless lifetimes
2022-12-21Auto merge of #105613 - Nilstrieb:rename-assert_uninit_valid, r=RalfJungbors-4/+4
Rename `assert_uninit_valid` intrinsic It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that. This is actually not fully correct though, as it does still panic for all uninit with `-Zstrict-init-checks`. I'm not sure what the best way is to deal with that not causing confusion. I guess we could just remove the flag? I don't think having it makes a lot of sense anymore with the direction that we have chose to go. It could be relevant again if #100423 lands so removing it may be a bit over eager. r? `@RalfJung`
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-13/+13
2022-12-19Make fast-path for implied wf lint betterMichael Goulet-71/+92
2022-12-19Add IMPLIED_BOUNDS_ENTAILMENT lintMichael Goulet-5/+70
2022-12-18remove redundant fn params that were only "used" in recursionMatthias Krüger-4/+3
2022-12-17Rollup merge of #105711 - compiler-errors:rpitit-references-errors, r=eholkMatthias Krüger-0/+2
bail in `collect_trait_impl_trait_tys` if signatures reference errors Fixes #105290
2022-12-15Rollup merge of #104592 - ComputerDruid:async_check, r=compiler-errorsMatthias Krüger-0/+32
Ensure async trait impls are async (or otherwise return an opaque type) As a workaround for the full `#[refine]` semantics not being implemented yet, forbit returning a concrete future type like `Box<dyn Future>` or a manually implemented Future. `-> impl Future` is still permitted; while that can also cause accidental refinement, that's behind a different feature gate (`return_position_impl_trait_in_trait`) and that problem exists regardless of whether the trait method is async, so will have to be solved more generally. Fixes https://github.com/rust-lang/rust/issues/102745
2022-12-14Ensure async trait impls are async (or otherwise return an opaque type)Dan Johnson-0/+32
As a workaround for the full `#[refine]` semantics not being implemented yet, forbit returning a concrete future type like `Box<dyn Future>` or a manually implemented Future. `-> impl Future` is still permitted; while that can also cause accidental refinement, that's behind a different feature gate (`return_position_impl_trait_in_trait`) and that problem exists regardless of whether the trait method is async, so will have to be solved more generally. Fixes #102745
2022-12-14bail in collect_trait_impl_trait_tys if signatures reference errorsMichael Goulet-0/+2
2022-12-14Prevent the creation of `TraitRef` without dedicated methodsOli Scherer-1/+1
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-1/+1
2022-12-14Guard `AliasTy` creation against passing the wrong number of substsOli Scherer-4/+1
2022-12-13Address nitsMichael Goulet-1/+1
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2022-12-13Combine projection and opaque into aliasMichael Goulet-5/+5
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-2/+2
2022-12-13ProjectionTy.item_def_id -> ProjectionTy.def_idMichael Goulet-17/+13
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-1/+1
2022-12-13Rename `assert_uninit_valid` intrinsicNilstrieb-4/+4
It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that.
2022-12-11Add `round_ties_even` to `f32` and `f64`Jules Bertholet-0/+2
2022-12-10compiler: remove unnecessary imports and qualified pathsKaDiWa-1/+0
2022-12-07Auto merge of #104799 - pcc:linkage-fn, r=tmiaskobors-1/+34
Support Option and similar enums as type of static variable with linkage attribute Compiler MCP: rust-lang/compiler-team#565
2022-12-05On E0195 point at where clause lifetime boundsEsteban Küber-11/+40
Fix #104733
2022-12-05Support Option and similar enums as type of static variable with linkage ↵Peter Collingbourne-1/+20
attribute. Compiler MCP: https://github.com/rust-lang/compiler-team/issues/565
2022-12-05Move linkage type check to HIR analysis and fix semantics issues.Peter Collingbourne-0/+14
This ensures that the error is printed even for unused variables, as well as unifying the handling between the LLVM and GCC backends. This also fixes unusual behavior around exported Rust-defined variables with linkage attributes. With the previous behavior, it appears to be impossible to define such a variable such that it can actually be imported and used by another crate. This is because on the importing side, the variable is required to be a pointer, but on the exporting side, the type checker rejects static variables of pointer type because they do not implement `Sync`. Even if it were possible to import such a type, it appears that code generation on the importing side would add an unexpected additional level of pointer indirection, which would break type safety. This highlighted that the semantics of linkage on Rust-defined variables is different to linkage on foreign items. As such, we now model the difference with two different codegen attributes: linkage for Rust-defined variables, and import_linkage for foreign items. This change gives semantics to the test src/test/ui/linkage-attr/auxiliary/def_illtyped_external.rs which was previously expected to fail to compile. Therefore, convert it into a test that is expected to successfully compile. The update to the GCC backend is speculative and untested.
2022-12-04Auto merge of #105261 - matthiaskrgr:rollup-9ghhc9c, r=matthiaskrgrbors-17/+16
Rollup of 6 pull requests Successful merges: - #101975 (Suggest to use . instead of :: when accessing a method of an object) - #105141 (Fix ICE on invalid variable declarations in macro calls) - #105224 (Properly substitute inherent associated types.) - #105236 (Add regression test for #47814) - #105247 (Use parent function WfCheckingContext to check RPITIT.) - #105253 (Update a couple of rustbuild deps) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-04Use parent function WfCheckingContext to check RPITIT.Camille GILLOT-17/+16
2022-12-04Also avoid creating a terminating scope in mixed chainsest31-13/+13
This avoids creation of a terminating scope in chains that contain both && and ||, because also there we know that a terminating scope is not neccessary: all the chain members are already in such terminating scopes. Also add a mixed && / || test.
2022-12-04Improve commentsest31-6/+18
2022-12-03Remove drop order twist of && and || and make them associativeest31-4/+21
Previously a short circuiting && chain would drop the first element after all the other elements, and otherwise follow evaluation order, so code like: f(1).g() && f(2).g() && f(3).g() && f(4).g() would drop the temporaries in the order 2,3,4,1. This made && and || non-associative regarding drop order, so adding ()'s to the expression would change drop order: f(1).g() && (f(2).g() && f(3).g()) && f(4).g() for example would drop in the order 3,2,4,1. As, except for the bool result, there is no data returned by the sub-expressions of the short circuiting binops, we can safely discard of any temporaries created by the sub-expr. Previously, code was already putting the rhs's into terminating scopes, but missed it for the lhs's. This commit addresses this "twist". In the expression, we now also put the lhs into a terminating scope. The drop order for the above expressions is 1,2,3,4 now.
2022-12-02Check lifetime param count in collect_trait_impl_trait_tysMichael Goulet-21/+18
2022-11-28Make ObligationCtxt::normalize take cause by borrowMichael Goulet-11/+11
2022-11-28FnCtxt normalization stuffMichael Goulet-0/+2
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-3/+4
2022-11-25Introduce PredicateKind::ClauseSantiago Pastorino-19/+31
2022-11-25Simplify a bunch of trait ref obligation creationsOli Scherer-1/+1
2022-11-23Use ObligationCtxt::normalizeSantiago Pastorino-17/+4