Skip to content

Commit 6eb9f2d

Browse files
committed
Auto merge of rust-lang#107788 - matthiaskrgr:rollup-mw10sli, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#107656 (Bump rust-installer) - rust-lang#107757 (Allow automatically creating vscode `settings.json` with `x setup`) - rust-lang#107769 (Rename `PointerSized` to `PointerLike`) - rust-lang#107770 (rustdoc: use a newline instead of `<br>` to format code headers) - rust-lang#107771 (Tweak ICE message) - rust-lang#107773 (Clearly signal purpose of the yaml template) - rust-lang#107776 (Docs: Fix format of headings in String::reserve) - rust-lang#107779 (Remove astconv usage in diagnostic) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 7ba4e95 + fe26182 commit 6eb9f2d

File tree

53 files changed

+375
-165
lines changed

Some content is hidden

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

53 files changed

+375
-165
lines changed

.github/ISSUE_TEMPLATE/ice.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Internal Compiler Error (Structured form)
1+
name: Internal Compiler Error (for use by automated tooling)
22
description: For now, you'll want to use the other ICE template, as GitHub forms have strict limits on the size of fields so backtraces cannot be pasted directly.
33
labels: ["C-bug", "I-ICE", "T-compiler"]
44
title: "[ICE]: "

compiler/rustc_const_eval/src/interpret/cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
126126
let vtable = self.get_vtable_ptr(src.layout.ty, data.principal())?;
127127
let vtable = Scalar::from_maybe_pointer(vtable, self);
128128
let data = self.read_immediate(src)?.to_scalar();
129-
let _assert_pointer_sized = data.to_pointer(self)?;
129+
let _assert_pointer_like = data.to_pointer(self)?;
130130
let val = Immediate::ScalarPair(data, vtable);
131131
self.write_immediate(val, dest)?;
132132
} else {

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,11 +1200,9 @@ pub fn report_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
12001200
if !info.payload().is::<rustc_errors::ExplicitBug>()
12011201
&& !info.payload().is::<rustc_errors::DelayedBugPanic>()
12021202
{
1203-
let mut d = rustc_errors::Diagnostic::new(rustc_errors::Level::Bug, "unexpected panic");
1204-
handler.emit_diagnostic(&mut d);
1203+
handler.emit_err(session_diagnostics::Ice);
12051204
}
12061205

1207-
handler.emit_note(session_diagnostics::Ice);
12081206
handler.emit_note(session_diagnostics::IceBugReport { bug_report_url });
12091207
handler.emit_note(session_diagnostics::IceVersion {
12101208
version: util::version_str!().unwrap_or("unknown_version"),

compiler/rustc_hir/src/lang_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ language_item_table! {
287287
TryTraitBranch, sym::branch, branch_fn, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::None;
288288
TryTraitFromYeet, sym::from_yeet, from_yeet_fn, Target::Fn, GenericRequirement::None;
289289

290-
PointerSized, sym::pointer_sized, pointer_sized, Target::Trait, GenericRequirement::Exact(0);
290+
PointerLike, sym::pointer_like, pointer_like, Target::Trait, GenericRequirement::Exact(0);
291291

292292
Poll, sym::Poll, poll, Target::Enum, GenericRequirement::None;
293293
PollReady, sym::Ready, poll_ready_variant, Target::Variant, GenericRequirement::None;

compiler/rustc_hir_typeck/src/coercion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
765765
self.cause.clone(),
766766
self.param_env,
767767
ty::Binder::dummy(
768-
self.tcx.at(self.cause.span).mk_trait_ref(hir::LangItem::PointerSized, [a]),
768+
self.tcx.at(self.cause.span).mk_trait_ref(hir::LangItem::PointerLike, [a]),
769769
),
770770
));
771771

compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,16 +1336,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
13361336
hir::Path { segments: [segment], .. },
13371337
))
13381338
| hir::ExprKind::Path(QPath::TypeRelative(ty, segment)) => {
1339-
let self_ty = self.astconv().ast_ty_to_ty(ty);
1340-
if let Ok(pick) = self.probe_for_name(
1341-
Mode::Path,
1342-
Ident::new(capitalized_name, segment.ident.span),
1343-
Some(expected_ty),
1344-
IsSuggestion(true),
1345-
self_ty,
1346-
expr.hir_id,
1347-
ProbeScope::TraitsInScope,
1348-
) {
1339+
if let Some(self_ty) = self.typeck_results.borrow().node_type_opt(ty.hir_id)
1340+
&& let Ok(pick) = self.probe_for_name(
1341+
Mode::Path,
1342+
Ident::new(capitalized_name, segment.ident.span),
1343+
Some(expected_ty),
1344+
IsSuggestion(true),
1345+
self_ty,
1346+
expr.hir_id,
1347+
ProbeScope::TraitsInScope,
1348+
)
1349+
{
13491350
(pick.item, segment)
13501351
} else {
13511352
return false;

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ symbols! {
10841084
plugins,
10851085
pointee_trait,
10861086
pointer,
1087-
pointer_sized,
1087+
pointer_like,
10881088
poll,
10891089
position,
10901090
post_dash_lto: "post-lto",

compiler/rustc_trait_selection/src/solve/assembly.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ pub(super) trait GoalKind<'tcx>: TypeFoldable<'tcx> + Copy + Eq {
128128
goal: Goal<'tcx, Self>,
129129
) -> QueryResult<'tcx>;
130130

131-
// A type is `PointerSized` if we can compute its layout, and that layout
131+
// A type is `PointerLike` if we can compute its layout, and that layout
132132
// matches the layout of `usize`.
133-
fn consider_builtin_pointer_sized_candidate(
133+
fn consider_builtin_pointer_like_candidate(
134134
ecx: &mut EvalCtxt<'_, 'tcx>,
135135
goal: Goal<'tcx, Self>,
136136
) -> QueryResult<'tcx>;
@@ -312,8 +312,8 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
312312
|| lang_items.clone_trait() == Some(trait_def_id)
313313
{
314314
G::consider_builtin_copy_clone_candidate(self, goal)
315-
} else if lang_items.pointer_sized() == Some(trait_def_id) {
316-
G::consider_builtin_pointer_sized_candidate(self, goal)
315+
} else if lang_items.pointer_like() == Some(trait_def_id) {
316+
G::consider_builtin_pointer_like_candidate(self, goal)
317317
} else if let Some(kind) = self.tcx().fn_trait_kind_from_def_id(trait_def_id) {
318318
G::consider_builtin_fn_trait_candidates(self, goal, kind)
319319
} else if lang_items.tuple_trait() == Some(trait_def_id) {

compiler/rustc_trait_selection/src/solve/project_goals.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,11 +370,11 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> {
370370
bug!("`Copy`/`Clone` does not have an associated type: {:?}", goal);
371371
}
372372

373-
fn consider_builtin_pointer_sized_candidate(
373+
fn consider_builtin_pointer_like_candidate(
374374
_ecx: &mut EvalCtxt<'_, 'tcx>,
375375
goal: Goal<'tcx, Self>,
376376
) -> QueryResult<'tcx> {
377-
bug!("`PointerSized` does not have an associated type: {:?}", goal);
377+
bug!("`PointerLike` does not have an associated type: {:?}", goal);
378378
}
379379

380380
fn consider_builtin_fn_trait_candidates(

compiler/rustc_trait_selection/src/solve/trait_goals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
131131
)
132132
}
133133

134-
fn consider_builtin_pointer_sized_candidate(
134+
fn consider_builtin_pointer_like_candidate(
135135
ecx: &mut EvalCtxt<'_, 'tcx>,
136136
goal: Goal<'tcx, Self>,
137137
) -> QueryResult<'tcx> {

0 commit comments

Comments
 (0)