Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 52f3c71

Browse files
committedJul 18, 2024
Auto merge of rust-lang#127898 - matthiaskrgr:rollup-lkkpoui, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#127077 (Make language around `ToOwned` for `BorrowedFd` more precise) - rust-lang#127783 (Put the dots back in RTN pretty printing) - rust-lang#127787 (Migrate `atomic-lock-free` to `rmake`) - rust-lang#127810 (Rename `tcx` to `cx` in `rustc_type_ir`) - rust-lang#127878 (Fix associated item removal suggestion) - rust-lang#127886 (Accurate `use` rename suggestion span) - rust-lang#127888 (More accurate span for type parameter suggestion) - rust-lang#127889 (More accurate span for anonymous argument suggestion) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 4bb2f27 + 77e5bbf commit 52f3c71

File tree

80 files changed

+550
-383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+550
-383
lines changed
 

‎compiler/rustc_middle/src/ty/structural_impls.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ TrivialTypeTraversalAndLiftImpls! {
283283

284284
impl<'tcx, T: Lift<TyCtxt<'tcx>>> Lift<TyCtxt<'tcx>> for Option<T> {
285285
type Lifted = Option<T::Lifted>;
286-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
286+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
287287
Some(match self {
288288
Some(x) => Some(tcx.lift(x)?),
289289
None => None,
@@ -293,7 +293,7 @@ impl<'tcx, T: Lift<TyCtxt<'tcx>>> Lift<TyCtxt<'tcx>> for Option<T> {
293293

294294
impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for Term<'a> {
295295
type Lifted = ty::Term<'tcx>;
296-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
296+
fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> {
297297
match self.unpack() {
298298
TermKind::Ty(ty) => tcx.lift(ty).map(Into::into),
299299
TermKind::Const(c) => tcx.lift(c).map(Into::into),

‎compiler/rustc_parse/src/parser/diagnostics.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2240,11 +2240,11 @@ impl<'a> Parser<'a> {
22402240
}
22412241
_ => {
22422242
// Otherwise, try to get a type and emit a suggestion.
2243-
if let Some(ty) = pat.to_ty() {
2243+
if let Some(_) = pat.to_ty() {
22442244
err.span_suggestion_verbose(
2245-
pat.span,
2245+
pat.span.shrink_to_lo(),
22462246
"explicitly ignore the parameter name",
2247-
format!("_: {}", pprust::ty_to_string(&ty)),
2247+
"_: ".to_string(),
22482248
Applicability::MachineApplicable,
22492249
);
22502250
err.note(rfc_note);
@@ -2256,7 +2256,7 @@ impl<'a> Parser<'a> {
22562256

22572257
// `fn foo(a, b) {}`, `fn foo(a<x>, b<y>) {}` or `fn foo(usize, usize) {}`
22582258
if first_param {
2259-
err.span_suggestion(
2259+
err.span_suggestion_verbose(
22602260
self_span,
22612261
"if this is a `self` type, give it a parameter name",
22622262
self_sugg,
@@ -2266,14 +2266,14 @@ impl<'a> Parser<'a> {
22662266
// Avoid suggesting that `fn foo(HashMap<u32>)` is fixed with a change to
22672267
// `fn foo(HashMap: TypeName<u32>)`.
22682268
if self.token != token::Lt {
2269-
err.span_suggestion(
2269+
err.span_suggestion_verbose(
22702270
param_span,
22712271
"if this is a parameter name, give it a type",
22722272
param_sugg,
22732273
Applicability::HasPlaceholders,
22742274
);
22752275
}
2276-
err.span_suggestion(
2276+
err.span_suggestion_verbose(
22772277
type_span,
22782278
"if this is a type, explicitly ignore the parameter name",
22792279
type_sugg,
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.