Skip to content

Rollup of 6 pull requests #110148

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

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
42f2be8
Add suggestion to remove derive() if invoked macro is non-derive
NotStirred Mar 26, 2023
2e21b54
rustc_middle: Document which exactly `DefId`s don't have `DefKind`s
petrochenkov Mar 30, 2023
10c3644
Update non-derive macro error message to match suggestion
NotStirred Mar 30, 2023
ed84d1d
Fix typo
NotStirred Mar 30, 2023
86230dc
Bless
NotStirred Apr 1, 2023
48be303
Add riscv relax target feature
zyedidia Apr 2, 2023
56207b8
Skip help messages if macro span is from macro
NotStirred Apr 2, 2023
37f5569
Ported FunctionPointerSuggestion
IntQuant Feb 23, 2023
b36abea
Migrate SuggestAsRefWhereAppropriate
IntQuant Mar 3, 2023
d56b304
Migrate SuggestAccessingField
IntQuant Mar 3, 2023
23b8567
Migrate SuggestBoxingForReturnImplTrait, Fix typo in infer_fn_conside…
IntQuant Mar 3, 2023
d18adb7
Migrate SuggestTuplePattern
IntQuant Mar 3, 2023
b610ce7
Migrate TupleTrailingCommaSuggestion
IntQuant Mar 3, 2023
ab11b43
FailureCode::Error0038 is unreachable, so can be removed
IntQuant Mar 3, 2023
1f09bc7
Migrate (most of) report_and_explain_type_error
IntQuant Mar 4, 2023
e813b6d
Update compiler/rustc_infer/src/infer/error_reporting/suggest.rs
IntQuant Mar 9, 2023
aa33a6f
Move and document escape_literal function
IntQuant Mar 9, 2023
fd18d9a
Renamed TypeErrorAdditionalDiags (was Error0308Subdiags) and Obligati…
IntQuant Mar 9, 2023
6a05cd8
A more general implementation of `IntoDiagnosticArg` for `Binder` (Al…
IntQuant Mar 9, 2023
21d5bed
Extract suggest_specify_actual_length into a separate function
IntQuant Mar 10, 2023
467d367
Rename tuple_wrap_err_subdiag to suggest_wrap_to_build_a_tuple, makin…
IntQuant Mar 11, 2023
3fb6d6b
Now passes tests
IntQuant Apr 4, 2023
be44169
Collapse if statements, change message to lowercase
NotStirred Apr 6, 2023
5c5c3c9
Add more complex test cases for new suggestion
NotStirred Apr 7, 2023
18388c9
Rewrite added diagnostics as translatable
NotStirred Apr 7, 2023
668a629
Change type and field name to be clearer
NotStirred Apr 7, 2023
a047064
Revert "Don't recover lifetimes/labels containing emojis as character…
compiler-errors Apr 10, 2023
271ac7b
Add regression test for #104916
JohnTitor Apr 10, 2023
d07b1cd
Call `into_diagnostic_arg` on Binder's contained value directly.
IntQuant Apr 10, 2023
f2c7257
Rollup merge of #108698 - IntQuant:issue-100717-infer-6, r=davidtwco
Dylan-DPC Apr 10, 2023
f0f5777
Rollup merge of #109638 - NotStirred:suggest/non-derive, r=davidtwco
Dylan-DPC Apr 10, 2023
401429f
Rollup merge of #109778 - petrochenkov:allkind, r=cjgillot
Dylan-DPC Apr 10, 2023
083d5a8
Rollup merge of #109860 - zyedidia:riscv-relax, r=petrochenkov
Dylan-DPC Apr 10, 2023
0aea6c0
Rollup merge of #110135 - compiler-errors:revert-108031, r=davidtwco
Dylan-DPC Apr 10, 2023
ab8b0ad
Rollup merge of #110147 - JohnTitor:issue-104916, r=compiler-errors
Dylan-DPC Apr 10, 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
1 change: 1 addition & 0 deletions compiler/rustc_codegen_ssa/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ const RISCV_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
("e", Some(sym::riscv_target_feature)),
("f", Some(sym::riscv_target_feature)),
("m", Some(sym::riscv_target_feature)),
("relax", Some(sym::riscv_target_feature)),
("v", Some(sym::riscv_target_feature)),
("zba", Some(sym::riscv_target_feature)),
("zbb", Some(sym::riscv_target_feature)),
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,6 @@ pub enum StashKey {
/// When an invalid lifetime e.g. `'2` should be reinterpreted
/// as a char literal in the parser
LifetimeIsChar,
/// When an invalid lifetime e.g. `'🐱` contains emoji.
LifetimeContainsEmoji,
/// Maybe there was a typo where a comma was forgotten before
/// FRU syntax
MaybeFruTypo,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let (provided_ty, provided_span) = provided_arg_tys[*provided_idx];
let trace =
mk_trace(provided_span, formal_and_expected_inputs[*expected_idx], provided_ty);
if !matches!(trace.cause.as_failure_code(*e), FailureCode::Error0308(_)) {
if !matches!(trace.cause.as_failure_code(*e), FailureCode::Error0308) {
self.err_ctxt().report_and_explain_type_error(trace, *e).emit();
return true;
}
Expand Down
44 changes: 44 additions & 0 deletions compiler/rustc_infer/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,47 @@ infer_prlf_known_limitation = this is a known limitation that will be removed in

infer_opaque_captures_lifetime = hidden type for `{$opaque_ty}` captures lifetime that does not appear in bounds
.label = opaque type defined here

infer_fps_use_ref = consider using a reference
infer_fps_remove_ref = consider removing the reference
infer_fps_cast = consider casting to a fn pointer
infer_fps_items_are_distinct = fn items are distinct from fn pointers
infer_fps_cast_both = consider casting both fn items to fn pointers using `as {$expected_sig}`

infer_fn_uniq_types = different fn items have unique types, even if their signatures are the same
infer_fn_consider_casting = consider casting the fn item to a fn pointer: `{$casting}`

infer_sarwa_option = you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`
infer_sarwa_result = you can convert from `&Result<T, E>` to `Result<&T, &E>` using `.as_ref()`

infer_suggest_accessing_field = you might have meant to use field `{$name}` whose type is `{$ty}`

infer_sbfrit_change_return_type = you could change the return type to be a boxed trait object
infer_sbfrit_box_return_expr = if you change the return type to expect trait objects, box the returned expressions

infer_stp_wrap_one = try wrapping the pattern in `{$variant}`
infer_stp_wrap_many = try wrapping the pattern in a variant of `{$path}`

infer_tuple_trailing_comma = use a trailing comma to create a tuple with one element

infer_oc_method_compat = method not compatible with trait
infer_oc_type_compat = type not compatible with trait
infer_oc_const_compat = const not compatible with trait
infer_oc_try_compat = `?` operator has incompatible types
infer_oc_match_compat = `match` arms have incompatible types
infer_oc_if_else_different = `if` and `else` have incompatible types
infer_oc_no_else = `if` may be missing an `else` clause
infer_oc_no_diverge = `else` clause of `let...else` does not diverge
infer_oc_fn_main_correct_type = `main` function has wrong type
infer_oc_fn_start_correct_type = `#[start]` function has wrong type
infer_oc_intristic_correct_type = intrinsic has wrong type
infer_oc_method_correct_type = mismatched `self` parameter type
infer_oc_closure_selfref = closure/generator type that references itself
infer_oc_cant_coerce = cannot coerce intrinsics to function pointers
infer_oc_generic = mismatched types

infer_meant_byte_literal = if you meant to write a byte literal, prefix with `b`
infer_meant_char_literal = if you meant to write a `char` literal, use single quotes
infer_meant_str_literal = if you meant to write a `str` literal, use double quotes
infer_consider_specifying_length = consider specifying the actual array length
infer_try_cannot_convert = `?` operator cannot convert from `{$found}` to `{$expected}`
Loading