Skip to content

Rollup of 8 pull requests #107105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
741c653
Remove an `unwrap()` from parser that can be written as if-let-chain
WaffleLapkin Jan 12, 2023
b060988
Add a test for recovery of unticked labels
WaffleLapkin Jan 12, 2023
57d822a
Recover labels written as identifiers
WaffleLapkin Jan 12, 2023
b7cb77f
Document how to get the type of a default associated type
Noratrieb Jan 17, 2023
ae9e66b
signal update string representation for haiku.
devnexen Jan 18, 2023
3520bba
Use strings for homoglyph replacements
clubby789 Jan 19, 2023
1487aa9
Add double-equals homoglyph
clubby789 Jan 19, 2023
ca3d55e
Custom MIR: Support storage statements
tmiasko Jan 19, 2023
42f1f54
Don't treat closures from other crates as local
oli-obk Jan 17, 2023
8657cb8
Added UI test case for issue #106419
megakorre Jan 19, 2023
f3cde8e
Fix broken format strings in `infer.ftl`
clubby789 Jan 19, 2023
df88f7e
Rollup merge of #106783 - WaffleLapkin:break-my-ident, r=wesleywiser
matthiaskrgr Jan 20, 2023
240cc81
Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=…
matthiaskrgr Jan 20, 2023
a2712cb
Rollup merge of #106979 - Nilstrieb:type-of-default-assoc-type, r=pet…
matthiaskrgr Jan 20, 2023
35d488f
Rollup merge of #107053 - devnexen:sigstringrepr_haiku, r=thomcc
matthiaskrgr Jan 20, 2023
3693399
Rollup merge of #107058 - clubby789:eqeq-homoglyph, r=wesleywiser
matthiaskrgr Jan 20, 2023
66a9006
Rollup merge of #107067 - tmiasko:custom-mir-storage-statements, r=ol…
matthiaskrgr Jan 20, 2023
75655a9
Rollup merge of #107076 - megakorre:106419_add_test_case, r=compiler-…
matthiaskrgr Jan 20, 2023
c42fad8
Rollup merge of #107091 - clubby789:infer-ftl-missing-dollar, r=compi…
matthiaskrgr Jan 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions compiler/rustc_error_messages/locales/en-US/infer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ infer_actual_impl_expl_expected_signature_any = {$leading_ellipsis ->
infer_actual_impl_expl_expected_signature_some = {$leading_ellipsis ->
[true] ...
*[false] {""}
}closure with signature `{$ty_or_sig}` must implement `{$trait_path}`, for some specific lifetime `'{lifetime_1}`...
}closure with signature `{$ty_or_sig}` must implement `{$trait_path}`, for some specific lifetime `'{$lifetime_1}`...
infer_actual_impl_expl_expected_signature_nothing = {$leading_ellipsis ->
[true] ...
*[false] {""}
Expand All @@ -209,7 +209,7 @@ infer_actual_impl_expl_expected_passive_any = {$leading_ellipsis ->
infer_actual_impl_expl_expected_passive_some = {$leading_ellipsis ->
[true] ...
*[false] {""}
}`{$trait_path}` would have to be implemented for the type `{$ty_or_sig}`, for some specific lifetime `'{lifetime_1}`...
}`{$trait_path}` would have to be implemented for the type `{$ty_or_sig}`, for some specific lifetime `'{$lifetime_1}`...
infer_actual_impl_expl_expected_passive_nothing = {$leading_ellipsis ->
[true] ...
*[false] {""}
Expand All @@ -225,7 +225,7 @@ infer_actual_impl_expl_expected_other_any = {$leading_ellipsis ->
infer_actual_impl_expl_expected_other_some = {$leading_ellipsis ->
[true] ...
*[false] {""}
}`{$ty_or_sig}` must implement `{$trait_path}`, for some specific lifetime `'{lifetime_1}`...
}`{$ty_or_sig}` must implement `{$trait_path}`, for some specific lifetime `'{$lifetime_1}`...
infer_actual_impl_expl_expected_other_nothing = {$leading_ellipsis ->
[true] ...
*[false] {""}
Expand Down Expand Up @@ -268,11 +268,11 @@ infer_but_calling_introduces = {$has_param_name ->
[true] `{$param_name}`
*[false] `fn` parameter
} has {$lifetime_kind ->
[named] lifetime `{lifetime}`
[named] lifetime `{$lifetime}`
*[anon] an anonymous lifetime `'_`
} but calling `{assoc_item}` introduces an implicit `'static` lifetime requirement
.label1 = {$has_lifetime ->
[named] lifetime `{lifetime}`
[named] lifetime `{$lifetime}`
*[anon] an anonymous lifetime `'_`
}
.label2 = ...is used and required to live as long as `'static` here because of an implicit lifetime bound on the {$has_impl_path ->
Expand All @@ -284,11 +284,11 @@ infer_but_needs_to_satisfy = {$has_param_name ->
[true] `{$param_name}`
*[false] `fn` parameter
} has {$has_lifetime ->
[named] lifetime `{lifetime}`
[named] lifetime `{$lifetime}`
*[anon] an anonymous lifetime `'_`
} but it needs to satisfy a `'static` lifetime requirement
.influencer = this data with {$has_lifetime ->
[named] lifetime `{lifetime}`
[named] lifetime `{$lifetime}`
*[anon] an anonymous lifetime `'_`
}...
.require = {$spans_empty ->
Expand All @@ -302,7 +302,7 @@ infer_more_targeted = {$has_param_name ->
[true] `{$param_name}`
*[false] `fn` parameter
} has {$has_lifetime ->
[named] lifetime `{lifetime}`
[named] lifetime `{$lifetime}`
*[anon] an anonymous lifetime `'_`
} but calling `{$ident}` introduces an implicit `'static` lifetime requirement

Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_middle/src/ty/assoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ impl AssocItem {
Ident::new(self.name, tcx.def_ident_span(self.def_id).unwrap())
}

/// Gets the defaultness of the associated item.
/// To get the default associated type, use the [`type_of`] query on the
/// [`DefId`] of the type.
///
/// [`type_of`]: crate::ty::TyCtxt::type_of
pub fn defaultness(&self, tcx: TyCtxt<'_>) -> hir::Defaultness {
tcx.impl_defaultness(self.def_id)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ use super::{parse_by_kind, PResult, ParseCtxt};
impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
pub fn parse_statement(&self, expr_id: ExprId) -> PResult<StatementKind<'tcx>> {
parse_by_kind!(self, expr_id, _, "statement",
@call("mir_storage_live", args) => {
Ok(StatementKind::StorageLive(self.parse_local(args[0])?))
},
@call("mir_storage_dead", args) => {
Ok(StatementKind::StorageDead(self.parse_local(args[0])?))
},
@call("mir_retag", args) => {
Ok(StatementKind::Retag(RetagKind::Default, Box::new(self.parse_place(args[0])?)))
},
Expand Down
Loading