Skip to content

Rollup of 6 pull requests #115909

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 20 commits into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a38ea96
Remove Drop impl of mpsc Receiver and (Sync)Sender
benschulz Aug 18, 2023
9c0e5eb
fix `Debug` impl for `AsciiChar`
soqb Sep 1, 2023
0eb4133
Unimpl Shl, ShlAssign, Shr and ShrAssign for Saturating
kellerkindt Jul 26, 2023
ad54426
Stabilize the Saturating type (saturating_int_impl, gh-87920)
kellerkindt Jul 26, 2023
d990eee
add diagnostic for raw identifiers in format string
Sep 6, 2023
7740476
explain PassMode::Cast
RalfJung Sep 7, 2023
89139d4
clarify PassMode::Indirect as well
RalfJung Sep 8, 2023
29a4b7b
fix gcc, cranelift build
RalfJung Sep 9, 2023
3ee65c2
cannot have Direct for unsized types
RalfJung Sep 15, 2023
6e2adbf
Migrate 'explicit destructor call' diagnostic
clubby789 Sep 15, 2023
9edeb19
Allow internal untranslatable diagnostic
clubby789 Sep 15, 2023
b40f11c
Migrate 'rust-call incorrect arguments' diagnostic
clubby789 Sep 15, 2023
cb9f666
Migrate 'invalid callee' diagnostic
clubby789 Sep 15, 2023
8696ee8
Migrate 'missing fn lang items' diagnostic
clubby789 Sep 15, 2023
7cbe7fa
Rollup merge of #114965 - benschulz:mpsc-drop, r=dtolnay
Dylan-DPC Sep 17, 2023
584eb69
Rollup merge of #115434 - soqb:ascii-char-manual-debug, r=dtolnay
Dylan-DPC Sep 17, 2023
6011fd4
Rollup merge of #115477 - kellerkindt:stabilized_int_impl, r=dtolnay
Dylan-DPC Sep 17, 2023
0900712
Rollup merge of #115611 - lukas-code:format!("{r#ident}"), r=compiler…
Dylan-DPC Sep 17, 2023
0c5f5b6
Rollup merge of #115654 - RalfJung:pass-mode-cast, r=compiler-errors
Dylan-DPC Sep 17, 2023
f082f1d
Rollup merge of #115862 - clubby789:migrate-callee-translatable, r=co…
Dylan-DPC Sep 17, 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
Prev Previous commit
Next Next commit
Migrate 'missing fn lang items' diagnostic
  • Loading branch information
clubby789 committed Sep 15, 2023
commit 8696ee8b0991888c8adc256eb85e5fc1da02b648
3 changes: 3 additions & 0 deletions compiler/rustc_hir_typeck/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ hir_typeck_lang_start_incorrect_ret_ty = the return type of the `start` lang ite
hir_typeck_method_call_on_unknown_raw_pointee =
cannot call a method on a raw pointer with an unknown pointee type

hir_typeck_missing_fn_lang_items = failed to find an overloaded call trait for closure call
.help = make sure the `fn`/`fn_mut`/`fn_once` lang items are defined and have correctly defined `call`/`call_mut`/`call_once` methods

hir_typeck_missing_parentheses_in_range = can't call method `{$method_name}` on type `{$ty_str}`

hir_typeck_no_associated_item = no {$item_kind} named `{$item_name}` found for {$ty_prefix} `{$ty_str}`{$trait_missing_method ->
Expand Down
12 changes: 2 additions & 10 deletions compiler/rustc_hir_typeck/src/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
ty: match &unit_variant {
Some((_, kind, path)) => format!("{kind} `{path}`"),
None => format!("`{callee_ty}`"),
}
},
});
if callee_ty.references_error() {
err.downgrade_to_delayed_bug();
Expand Down Expand Up @@ -882,15 +882,7 @@ impl<'a, 'tcx> DeferredCallResolution<'tcx> {
None => {
// This can happen if `#![no_core]` is used and the `fn/fn_mut/fn_once`
// lang items are not defined (issue #86238).
let mut err = fcx.inh.tcx.sess.struct_span_err(
self.call_expr.span,
"failed to find an overloaded call trait for closure call",
);
err.help(
"make sure the `fn`/`fn_mut`/`fn_once` lang items are defined \
and have correctly defined `call`/`call_mut`/`call_once` methods",
);
err.emit();
fcx.inh.tcx.sess.emit_err(errors::MissingFnLangItems { span: self.call_expr.span });
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_hir_typeck/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ pub struct MethodCallOnUnknownRawPointee {
pub span: Span,
}

#[derive(Diagnostic)]
#[diag(hir_typeck_missing_fn_lang_items)]
#[help]
pub struct MissingFnLangItems {
#[primary_span]
pub span: Span,
}

#[derive(Diagnostic)]
#[diag(hir_typeck_functional_record_update_on_non_struct, code = "E0436")]
pub struct FunctionalRecordUpdateOnNonStruct {
Expand Down