Skip to content

Commit 69d25fc

Browse files
committed
Auto merge of #92915 - matthiaskrgr:rollup-pxxk8jp, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #92191 (Prefer projection candidates instead of param_env candidates for Sized predicates) - #92382 (Extend const_convert to rest of blanket core::convert impls) - #92625 (Add `#[track_caller]` to `mirbug`) - #92684 (Export `tcp::IntoIncoming`) - #92743 (Use pre-interned symbols in a couple of places) - #92838 (Clean up some links in RELEASES) - #92868 (librustdoc: Address some clippy lints) - #92875 (Make `opt_const_param_of` work in the presence of `GenericArg::Infer`) - #92891 (Add myself to .mailmap) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents de9b573 + ff6c175 commit 69d25fc

File tree

32 files changed

+378
-415
lines changed

32 files changed

+378
-415
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakub.bukaj@yahoo.com>
129129
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakub@jakub.cc>
130130
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakubw@jakubw.net>
131131
James Deng <cnjamesdeng@gmail.com> <cnJamesDeng@gmail.com>
132+
James Hinshelwood <jameshinshelwood1@gmail.com> <james.hinshelwood@bigpayme.com>
132133
James Miller <bladeon@gmail.com> <james@aatch.net>
133134
James Perry <james.austin.perry@gmail.com>
134135
Jason Fager <jfager@gmail.com>

RELEASES.md

Lines changed: 16 additions & 126 deletions
Large diffs are not rendered by default.

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_hir::def::Res;
1111
use rustc_hir::definitions::DefPathData;
1212
use rustc_span::hygiene::ExpnId;
1313
use rustc_span::source_map::{respan, DesugaringKind, Span, Spanned};
14-
use rustc_span::symbol::{sym, Ident, Symbol};
14+
use rustc_span::symbol::{sym, Ident};
1515
use rustc_span::DUMMY_SP;
1616

1717
impl<'hir> LoweringContext<'_, 'hir> {
@@ -1204,11 +1204,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
12041204
};
12051205

12061206
let fields = self.arena.alloc_from_iter(
1207-
e1.iter().map(|e| ("start", e)).chain(e2.iter().map(|e| ("end", e))).map(|(s, e)| {
1208-
let expr = self.lower_expr(&e);
1209-
let ident = Ident::new(Symbol::intern(s), self.lower_span(e.span));
1210-
self.expr_field(ident, expr, e.span)
1211-
}),
1207+
e1.iter().map(|e| (sym::start, e)).chain(e2.iter().map(|e| (sym::end, e))).map(
1208+
|(s, e)| {
1209+
let expr = self.lower_expr(&e);
1210+
let ident = Ident::new(s, self.lower_span(e.span));
1211+
self.expr_field(ident, expr, e.span)
1212+
},
1213+
),
12121214
);
12131215

12141216
hir::ExprKind::Struct(

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ fn translate_outlives_facts(typeck: &mut TypeChecker<'_, '_>) {
312312
}
313313
}
314314

315+
#[track_caller]
315316
fn mirbug(tcx: TyCtxt<'_>, span: Span, msg: &str) {
316317
// We sometimes see MIR failures (notably predicate failures) due to
317318
// the fact that we check rvalue sized predicates here. So use `delay_span_bug`

compiler/rustc_hir/src/hir.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,6 @@ impl GenericArg<'_> {
293293
}
294294
}
295295

296-
pub fn is_const(&self) -> bool {
297-
matches!(self, GenericArg::Const(_))
298-
}
299-
300296
pub fn is_synthetic(&self) -> bool {
301297
matches!(self, GenericArg::Lifetime(lifetime) if lifetime.name.ident() == Ident::empty())
302298
}
@@ -318,6 +314,13 @@ impl GenericArg<'_> {
318314
GenericArg::Infer(_) => ast::ParamKindOrd::Infer,
319315
}
320316
}
317+
318+
pub fn is_ty_or_const(&self) -> bool {
319+
match self {
320+
GenericArg::Lifetime(_) => false,
321+
GenericArg::Type(_) | GenericArg::Const(_) | GenericArg::Infer(_) => true,
322+
}
323+
}
321324
}
322325

323326
#[derive(Debug, HashStable_Generic)]

compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_middle::ty::print::Print;
1212
use rustc_middle::ty::subst::{GenericArg, GenericArgKind};
1313
use rustc_middle::ty::{self, Const, DefIdTree, InferConst, Ty, TyCtxt, TypeFoldable, TypeFolder};
1414
use rustc_span::symbol::kw;
15-
use rustc_span::Span;
15+
use rustc_span::{sym, Span};
1616
use std::borrow::Cow;
1717

1818
struct FindHirNodeVisitor<'a, 'tcx> {
@@ -1003,9 +1003,9 @@ impl<'tcx> TypeFolder<'tcx> for ResolvedTypeParamEraser<'tcx> {
10031003
| ty::Opaque(..)
10041004
| ty::Projection(_)
10051005
| ty::Never => t.super_fold_with(self),
1006-
ty::Array(ty, c) => self
1007-
.tcx()
1008-
.mk_ty(ty::Array(self.fold_ty(ty), self.replace_infers(c, 0, Symbol::intern("N")))),
1006+
ty::Array(ty, c) => {
1007+
self.tcx().mk_ty(ty::Array(self.fold_ty(ty), self.replace_infers(c, 0, sym::N)))
1008+
}
10091009
// We don't want to hide type params that haven't been resolved yet.
10101010
// This would be the type that will be written out with the type param
10111011
// name in the output.

compiler/rustc_infer/src/traits/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl<'tcx> Elaborator<'tcx> {
152152
obligation.cause.clone(),
153153
)
154154
});
155-
debug!("super_predicates: data={:?}", data);
155+
debug!(?data, ?obligations, "super_predicates");
156156

157157
// Only keep those bounds that we haven't already seen.
158158
// This is necessary to prevent infinite recursion in some

compiler/rustc_middle/src/ty/generics.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ impl GenericParamDefKind {
3131
GenericParamDefKind::Const { .. } => ast::ParamKindOrd::Const,
3232
}
3333
}
34+
35+
pub fn is_ty_or_const(&self) -> bool {
36+
match self {
37+
GenericParamDefKind::Lifetime => false,
38+
GenericParamDefKind::Type { .. } | GenericParamDefKind::Const { .. } => true,
39+
}
40+
}
3441
}
3542

3643
#[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable)]

compiler/rustc_middle/src/ty/print/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ pub trait Printer<'tcx>: Sized {
188188
own_params.start = 1;
189189
}
190190

191+
// If we're in verbose mode, then print default-equal args too
192+
if self.tcx().sess.verbose() {
193+
return &substs[own_params];
194+
}
195+
191196
// Don't print args that are the defaults of their respective parameters.
192197
own_params.end -= generics
193198
.params

compiler/rustc_middle/src/ty/print/pretty.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,10 +1784,11 @@ impl<'tcx, F: fmt::Write> Printer<'tcx> for FmtPrinter<'_, 'tcx, F> {
17841784
self = print_prefix(self)?;
17851785

17861786
// Don't print `'_` if there's no unerased regions.
1787-
let print_regions = args.iter().any(|arg| match arg.unpack() {
1788-
GenericArgKind::Lifetime(r) => *r != ty::ReErased,
1789-
_ => false,
1790-
});
1787+
let print_regions = self.tcx.sess.verbose()
1788+
|| args.iter().any(|arg| match arg.unpack() {
1789+
GenericArgKind::Lifetime(r) => *r != ty::ReErased,
1790+
_ => false,
1791+
});
17911792
let args = args.iter().cloned().filter(|arg| match arg.unpack() {
17921793
GenericArgKind::Lifetime(_) => print_regions,
17931794
_ => true,

0 commit comments

Comments
 (0)