Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
da11ff3
core::any: replace some unstable generic types with impl Trait
nrc Jun 13, 2022
dfd243e
add track_caller to some interpreter functions
RalfJung Jul 6, 2022
a73e255
fix ICE in ConstProp
RalfJung Jul 6, 2022
1e0f3cb
make a name less ambiguous
RalfJung Jul 7, 2022
51504db
Adding suggestion for E0530
obeis Jul 7, 2022
69ac8a6
Collapse some weirdly-wrapping derives
compiler-errors Jul 8, 2022
ea46e7a
Check if E0530 is `tuple variant` or `tuple struct` to emit suggestion
obeis Jul 8, 2022
c2436d5
Check if E0530 is `rustc_resolve::late::PatternSource::Match` to emit…
obeis Jul 8, 2022
cf9186e
interpret: only to track_caller in debug builds due to perf
RalfJung Jul 8, 2022
1b32eb3
Update ui test for the new E0530 suggestion
obeis Jul 8, 2022
1e0ad0c
Implement support for DWARF version 5.
pcwalton Jun 20, 2022
a491d45
Update integer_atomics tracking issue
tamird Jul 8, 2022
32c9ffb
Clarify args terminology.
nnethercote Jul 4, 2022
d3057b5
Rename `FieldInfo` fields.
nnethercote Jul 4, 2022
27571da
Remove `FieldInfo::attrs`.
nnethercote Jul 4, 2022
7f1dfca
Avoid transposes in deriving code.
nnethercote Jul 4, 2022
65d0bfb
Cut down large comment about zero-variant enums.
nnethercote Jul 4, 2022
559398f
Fix some inconsistencies.
nnethercote Jul 5, 2022
16a286b
Simplify `cs_fold`.
nnethercote Jul 5, 2022
0578697
Minor updates based on review comments.
nnethercote Jul 7, 2022
80913e4
Rollup merge of #98350 - pcwalton:dwarf5, r=michaelwoerister
Dylan-DPC Jul 9, 2022
1e8af6b
Rollup merge of #98912 - nrc:provider-it, r=yaahc
Dylan-DPC Jul 9, 2022
62f13cd
Rollup merge of #98915 - nnethercote:clarify-deriving-code, r=Mark-Si…
Dylan-DPC Jul 9, 2022
fa8f6b6
Rollup merge of #98980 - RalfJung:const-prop-ice, r=oli-obk
Dylan-DPC Jul 9, 2022
404534f
Rollup merge of #99008 - obeis:issue-98974, r=compiler-errors
Dylan-DPC Jul 9, 2022
50545d7
Rollup merge of #99043 - compiler-errors:derive-nit, r=cjgillot
Dylan-DPC Jul 9, 2022
6816a8d
Rollup merge of #99070 - tamird:update-tracking-issue, r=RalfJung
Dylan-DPC Jul 9, 2022
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
Check if E0530 is tuple variant or tuple struct to emit suggestion
  • Loading branch information
obeis committed Jul 8, 2022
commit ea46e7a47e67c5ca9c147380d288d0c76451b5c2
22 changes: 14 additions & 8 deletions compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,9 +900,10 @@ impl<'a> Resolver<'a> {
name,
participle,
article,
shadowed_binding_descr,
shadowed_binding,
shadowed_binding_span,
} => {
let shadowed_binding_descr = shadowed_binding.descr();
let mut err = struct_span_err!(
self.session,
span,
Expand All @@ -915,13 +916,18 @@ impl<'a> Resolver<'a> {
span,
format!("cannot be named the same as {} {}", article, shadowed_binding_descr),
);
err.span_suggestion(
span,
"try specify the pattern arguments",
format!("{}(..)", name),
Applicability::Unspecified,
)
.emit();
match shadowed_binding {
Res::Def(DefKind::Ctor(CtorOf::Variant | CtorOf::Struct, CtorKind::Fn), _) => {
err.span_suggestion(
span,
"try specify the pattern arguments",
format!("{}(..)", name),
Applicability::Unspecified,
)
.emit();
}
_ => (),
}
let msg =
format!("the {} `{}` is {} here", shadowed_binding_descr, name, participle);
err.span_label(shadowed_binding_span, msg);
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_resolve/src/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2849,7 +2849,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
name: ident.name,
participle: if binding.is_import() { "imported" } else { "defined" },
article: binding.res().article(),
shadowed_binding_descr: binding.res().descr(),
shadowed_binding: binding.res(),
shadowed_binding_span: binding.span,
},
);
Expand All @@ -2865,7 +2865,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
name: ident.name,
participle: "defined",
article: res.article(),
shadowed_binding_descr: res.descr(),
shadowed_binding: res,
shadowed_binding_span: self.r.opt_span(def_id).expect("const parameter defined outside of local crate"),
}
);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ enum ResolutionError<'a> {
name: Symbol,
participle: &'static str,
article: &'static str,
shadowed_binding_descr: &'static str,
shadowed_binding: Res,
shadowed_binding_span: Span,
},
/// Error E0128: generic parameters with a default cannot use forward-declared identifiers.
Expand Down