about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis
AgeCommit message (Collapse)AuthorLines
2022-10-22Stabilize arbitrary_enum_discriminant, take 2Deadbeef-1/+1
2022-10-22Note scope of TAIT more accuratelyMichael Goulet-0/+7
2022-10-22Rollup merge of #103351 - oli-obk:tilde_const_impls, r=fee1-deadMatthias Krüger-7/+1
Require Drop impls to have the same constness on its bounds as the bounds on the struct have r? ``@fee1-dead``
2022-10-21Require Drop impls to have the same constness on its bounds as the bounds on ↵Oli Scherer-7/+1
the struct have
2022-10-21Auto merge of #103344 - Dylan-DPC:rollup-d1rpfvx, r=Dylan-DPCbors-11/+14
Rollup of 6 pull requests Successful merges: - #102287 (Elaborate supertrait bounds when triggering `unused_must_use` on `impl Trait`) - #102922 (Filtering spans when emitting json) - #103051 (translation: doc comments with derives, subdiagnostic-less enum variants, more derive use) - #103111 (Account for hygiene in typo suggestions, and use them to point to shadowed names) - #103260 (Fixup a few tests needing asm support) - #103321 (rustdoc: improve appearance of source page navigation bar) Failed merges: - #103209 (Diagnostic derives: allow specifying multiple alternative suggestions) r? `@ghost` `@rustbot` modify labels: rollup
2022-10-21Rollup merge of #102922 - kper:bugfix/102902-filtering-json, r=oli-obkDylan DPC-11/+14
Filtering spans when emitting json According to the issue #102902, we shouldn't emit spans which have an empty span and no suggested replacement.
2022-10-20Add fix suggestions for E0199, E0200, and E0569Nicolas Barrios-0/+30
2022-10-20update doc linkslcnr-2/+1
2022-10-20rustc_hir_typeck: fix paths and partially mv fileslcnr-1027/+31
2022-10-20rustc_hir_typeck: move whole fileslcnr-32901/+0
2022-10-20Implement assertions and fixes to not emit empty spans without suggestionsKevin Per-11/+14
2022-10-20Auto merge of #102417 - oli-obk:opaque_lifetimes2, r=jackh726bors-0/+1
Require lifetime bounds for opaque types in order to allow hidden types to capture said lifetimes fixes #96996 cc `@aliemjay`
2022-10-19Rollup merge of #103223 - compiler-errors:deref-sugg-slow, r=wesleywiserMatthias Krüger-5/+6
Use already checked RHS ty for LHS deref suggestions There's no reason to do the `check_lhs_assignable` and RHS `check_expr_with_hint` in that order, so invert them and use the typeck results to avoid exponential blowup on error. Fixes #103219
2022-10-19Rollup merge of #103034 - nathanwhit:let-chains-rhs-temporaries, r=wesleywiserDylan DPC-2/+6
Let expressions on RHS shouldn't be terminating scopes Fixes #100276. Before this PR, we were unconditionally marking the RHS of short-circuiting binary expressions as a terminating scope. In the case of a let chain where the `let` expression was on the RHS, this meant that temporaries within the `let` expr would only live until the end of the expression. Since this only affected the RHS, this led to surprising behavior ([example](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=d1b0a5d1f01882f9c89c2194a75eb19f)). After this PR, we only mark the RHS as a terminating scope if it is not a `let` expression.
2022-10-19Use already checked RHS ty for LHS deref suggestionsMichael Goulet-5/+6
2022-10-19instantiate -> constructMichael Goulet-4/+2
2022-10-19Generalize call suggestion for unsatisfied predicateMichael Goulet-7/+3
2022-10-19Standardize arg suggestions between typeck and trait selectionMichael Goulet-1/+1
2022-10-18change `ConstEvaluatable` to use `ty::Const`lcnr-9/+4
2022-10-17Rollup merge of #102454 - chenyukang:fix-102396-missing-parentheses, r=lcnrMatthias Krüger-2/+113
Suggest parentheses for possible range method calling Fixes #102396
2022-10-17trivial fix for comments feedbackyukang-9/+17
2022-10-16Don't consider `Let` exprs terminating scopesNathan Whitaker-2/+6
2022-10-16Auto merge of #102334 - compiler-errors:rpitit-substs-issue, r=cjgillotbors-19/+64
Fix subst issues with return-position `impl Trait` in trait 1. Fix an issue where we were rebase impl substs onto trait method substs, instead of trait substs 2. Fix an issue where early-bound regions aren't being mapped correctly for RPITIT hidden types Fixes #102301 Fixes #102310 Fixes #102334 Fixes #102918
2022-10-16Auto merge of #102931 - camsteffen:inline-overlapping-impls, r=cjgillotbors-6/+5
Make `overlapping_impls` not generic Trying to win back perf from #101632.
2022-10-15typosMichael Goulet-9/+9
2022-10-15Equate full fn signatures to infer all region variablesMichael Goulet-13/+33
2022-10-15Fix subst issues with RPITITMichael Goulet-6/+31
2022-10-15Auto merge of #101832 - compiler-errors:dyn-star-plus, r=eholkbors-83/+72
Make `dyn*` casts into a coercion, allow `dyn*` upcasting I know that `dyn*` is likely not going to be a feature exposed to surface Rust, but this makes it slightly more ergonomic to write tests for these types anyways. ... and this was just fun to implement anyways. 1. Make `dyn*` into a coercion instead of a cast 2. Enable `dyn*` upcasting since we basically get it for free 3. Simplify some of the cast checking code since we're using the coercion path now r? `@eholk` but feel free to reassign cc `@nikomatsakis` and `@tmandry` who might care about making `dyn*` casts into a coercion
2022-10-14Rollup merge of #103018 - Rageking8:more-dupe-word-typos, r=TaKO8KiDylan DPC-3/+3
More dupe word typos I only picked those changes (from the regex search) that I am pretty certain doesn't change meaning and is just a typo fix. Do correct me if any fix is undesirable and I can revert those. Thanks.
2022-10-14Rollup merge of #102856 - cjgillot:impl-single-check, r=petrochenkovDylan DPC-45/+36
Only test duplicate inherent impl items in a single place Based on https://github.com/rust-lang/rust/pull/100387 r? ``@petrochenkov``
2022-10-14Require lifetime bounds for opaque types in order to allow hidden types to ↵Oli Scherer-0/+1
capture said lifetimes
2022-10-14Address nits, add test for implicit dyn-star coercion without feature gateMichael Goulet-1/+3
2022-10-14Remove CastCheckResult since it's unusedMichael Goulet-26/+5
2022-10-14float and int vars are trivially copyMichael Goulet-0/+4
2022-10-14more dupe word typosRageking8-3/+3
2022-10-14Allow dyn* upcastingMichael Goulet-2/+10
2022-10-14Make dyn* cast into a coercionMichael Goulet-60/+60
2022-10-14Auto merge of #103026 - matthiaskrgr:rollup-gfmlfkt, r=matthiaskrgrbors-5/+15
Rollup of 7 pull requests Successful merges: - #103000 (Add suggestion to the "missing native library" error) - #103006 (rustdoc: don't ICE on `TyKind::Typeof`) - #103008 (replace ReErased with fresh region vars in opaque types) - #103011 (Improve rustdoc `unsafe-fn` GUI test) - #103013 (Add new bootstrap entrypoints to triagebot) - #103016 (Ensure enum cast moves) - #103021 (Add links to relevant pages to find constraint information) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-14Rollup merge of #103008 - aliemjay:opaque-parent-substs, r=oli-obkMatthias Krüger-5/+15
replace ReErased with fresh region vars in opaque types See inline comments. Prior art #102943. cc ``@compiler-errors`` ``@oli-obk`` Fixes #100267 Fixes #101940 Fixes #102649 Fixes #102510
2022-10-13Auto merge of #102700 - oli-obk:0xDEAD_TAIT, r=compiler-errorsbors-50/+68
Check hidden types in dead code fixes #99490 r? `@compiler-errors` best reviewed commit by commit
2022-10-13Make overlapping_impls non-genericCameron Steffen-6/+5
This improves perf
2022-10-13Report duplicate definition in impls with overlap check.Camille GILLOT-45/+36
2022-10-13replace ReErased with fresh region vars in opaque typesAli MJ Al-Nasrawy-5/+15
2022-10-13Rollup merge of #102765 - TaKO8Ki:follow-up-to-102708, r=compiler-errorsDylan DPC-0/+12
Suggest `==` to the first expr which has `ExprKind::Assign` kind follow-up to #102708 [playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=4241dc33ed8af02e1ef530d6b14903fd)
2022-10-12Auto merge of #101679 - compiler-errors:rpitit-default-body, r=nikomatsakisbors-26/+35
Support default-body trait functions with return-position `impl Trait` in traits Introduce a new `Trait` candidate kind for the `ImplTraitInTrait` projection candidate, which just projects an RPITIT down to its opaque type form. This is a hack until we lower RPITITs to regular associated types, after which we will need to rework how these default bodies are type-checked, so comments are left in a few places for us to clean up later. Fixes #101665
2022-10-12Auto merge of #102732 - RalfJung:assert_unsafe_precondition2, r=bjorn3bors-8/+1
nicer errors from assert_unsafe_precondition This makes the errors shown by cargo-careful nicer, and since `panic_no_unwind` is `nounwind noreturn` it hopefully doesn't have bad codegen impact. Thanks to `@bjorn3` for the hint! Would be nice if we could somehow supply our own (static) message to print, currently it always prints `panic in a function that cannot unwind`. But still, this is better than before.
2022-10-12Rollup merge of #102890 - camsteffen:adt-sized-representability, r=cjgillotDylan DPC-3/+2
Check representability in adt_sized_constraint Now that representability is a query, we can use it to preemptively avoid a cycle in `adt_sized_constraint`. I moved the representability check into `check_mod_type_wf` to avoid a scenario where rustc quits before checking all the types for representability. This also removes the check from rustdoc, which is alright AFAIK. r? ``@cjgillot``
2022-10-11add panic_fmt_nounwind for panicing without unwinding, and use it for ↵Ralf Jung-7/+0
panic_no_unwind
2022-10-11rename rustc_allocator_nounwind to rustc_nounwindRalf Jung-1/+1
2022-10-11Rollup merge of #100387 - cjgillot:hygiene-trait-impl, r=petrochenkovMatthias Krüger-0/+3
Check uniqueness of impl items by trait item when applicable. When checking uniqueness of item names in impl blocks, we currently use the same definition of hygiene as for toplevel items. This means that a plain item and one generated by a macro 2.0 do not collide. This hygiene rule does not match with how impl items resolve to associated trait items. As a consequence, we misdiagnose the trait impls. This PR proposes to consider that trait impl items are uses of the corresponding trait items during resolution, instead of checking for duplicates later. An error is emitted when a trait impl item is used twice. There should be no stable breakage, since macros 2.0 are still unstable. r? ``@petrochenkov`` cc ``@RalfJung`` Fixes https://github.com/rust-lang/rust/issues/71614.