Skip to content

Commit 04a41f8

Browse files
committed
Auto merge of #107105 - matthiaskrgr:rollup-rkz9t7r, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #106783 (Recover labels written as identifiers) - #106973 (Don't treat closures from other crates as local) - #106979 (Document how to get the type of a default associated type) - #107053 (signal update string representation for haiku.) - #107058 (Recognise double-equals homoglyph) - #107067 (Custom MIR: Support storage statements) - #107076 (Added const-generic ui test case for issue #106419) - #107091 (Fix broken format strings in `infer.ftl`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 56ee852 + c42fad8 commit 04a41f8

File tree

20 files changed

+532
-365
lines changed

20 files changed

+532
-365
lines changed

compiler/rustc_error_messages/locales/en-US/infer.ftl

+8-8
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ infer_actual_impl_expl_expected_signature_any = {$leading_ellipsis ->
193193
infer_actual_impl_expl_expected_signature_some = {$leading_ellipsis ->
194194
[true] ...
195195
*[false] {""}
196-
}closure with signature `{$ty_or_sig}` must implement `{$trait_path}`, for some specific lifetime `'{lifetime_1}`...
196+
}closure with signature `{$ty_or_sig}` must implement `{$trait_path}`, for some specific lifetime `'{$lifetime_1}`...
197197
infer_actual_impl_expl_expected_signature_nothing = {$leading_ellipsis ->
198198
[true] ...
199199
*[false] {""}
@@ -209,7 +209,7 @@ infer_actual_impl_expl_expected_passive_any = {$leading_ellipsis ->
209209
infer_actual_impl_expl_expected_passive_some = {$leading_ellipsis ->
210210
[true] ...
211211
*[false] {""}
212-
}`{$trait_path}` would have to be implemented for the type `{$ty_or_sig}`, for some specific lifetime `'{lifetime_1}`...
212+
}`{$trait_path}` would have to be implemented for the type `{$ty_or_sig}`, for some specific lifetime `'{$lifetime_1}`...
213213
infer_actual_impl_expl_expected_passive_nothing = {$leading_ellipsis ->
214214
[true] ...
215215
*[false] {""}
@@ -225,7 +225,7 @@ infer_actual_impl_expl_expected_other_any = {$leading_ellipsis ->
225225
infer_actual_impl_expl_expected_other_some = {$leading_ellipsis ->
226226
[true] ...
227227
*[false] {""}
228-
}`{$ty_or_sig}` must implement `{$trait_path}`, for some specific lifetime `'{lifetime_1}`...
228+
}`{$ty_or_sig}` must implement `{$trait_path}`, for some specific lifetime `'{$lifetime_1}`...
229229
infer_actual_impl_expl_expected_other_nothing = {$leading_ellipsis ->
230230
[true] ...
231231
*[false] {""}
@@ -268,11 +268,11 @@ infer_but_calling_introduces = {$has_param_name ->
268268
[true] `{$param_name}`
269269
*[false] `fn` parameter
270270
} has {$lifetime_kind ->
271-
[named] lifetime `{lifetime}`
271+
[named] lifetime `{$lifetime}`
272272
*[anon] an anonymous lifetime `'_`
273273
} but calling `{assoc_item}` introduces an implicit `'static` lifetime requirement
274274
.label1 = {$has_lifetime ->
275-
[named] lifetime `{lifetime}`
275+
[named] lifetime `{$lifetime}`
276276
*[anon] an anonymous lifetime `'_`
277277
}
278278
.label2 = ...is used and required to live as long as `'static` here because of an implicit lifetime bound on the {$has_impl_path ->
@@ -284,11 +284,11 @@ infer_but_needs_to_satisfy = {$has_param_name ->
284284
[true] `{$param_name}`
285285
*[false] `fn` parameter
286286
} has {$has_lifetime ->
287-
[named] lifetime `{lifetime}`
287+
[named] lifetime `{$lifetime}`
288288
*[anon] an anonymous lifetime `'_`
289289
} but it needs to satisfy a `'static` lifetime requirement
290290
.influencer = this data with {$has_lifetime ->
291-
[named] lifetime `{lifetime}`
291+
[named] lifetime `{$lifetime}`
292292
*[anon] an anonymous lifetime `'_`
293293
}...
294294
.require = {$spans_empty ->
@@ -302,7 +302,7 @@ infer_more_targeted = {$has_param_name ->
302302
[true] `{$param_name}`
303303
*[false] `fn` parameter
304304
} has {$has_lifetime ->
305-
[named] lifetime `{lifetime}`
305+
[named] lifetime `{$lifetime}`
306306
*[anon] an anonymous lifetime `'_`
307307
} but calling `{$ident}` introduces an implicit `'static` lifetime requirement
308308

compiler/rustc_middle/src/ty/assoc.rs

+5
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ impl AssocItem {
3737
Ident::new(self.name, tcx.def_ident_span(self.def_id).unwrap())
3838
}
3939

40+
/// Gets the defaultness of the associated item.
41+
/// To get the default associated type, use the [`type_of`] query on the
42+
/// [`DefId`] of the type.
43+
///
44+
/// [`type_of`]: crate::ty::TyCtxt::type_of
4045
pub fn defaultness(&self, tcx: TyCtxt<'_>) -> hir::Defaultness {
4146
tcx.impl_defaultness(self.def_id)
4247
}

compiler/rustc_mir_build/src/build/custom/parse/instruction.rs

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ use super::{parse_by_kind, PResult, ParseCtxt};
1212
impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
1313
pub fn parse_statement(&self, expr_id: ExprId) -> PResult<StatementKind<'tcx>> {
1414
parse_by_kind!(self, expr_id, _, "statement",
15+
@call("mir_storage_live", args) => {
16+
Ok(StatementKind::StorageLive(self.parse_local(args[0])?))
17+
},
18+
@call("mir_storage_dead", args) => {
19+
Ok(StatementKind::StorageDead(self.parse_local(args[0])?))
20+
},
1521
@call("mir_retag", args) => {
1622
Ok(StatementKind::Retag(RetagKind::Default, Box::new(self.parse_place(args[0])?)))
1723
},

0 commit comments

Comments
 (0)