Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
ae760e6
Address unused tuple struct fields in rustfmt
shepmaster Nov 29, 2023
4a1b418
Rename `unused_tuple_struct_fields` in rustfmt
shepmaster Nov 30, 2023
840824f
Rename `EmitterWriter` as `HumanEmitter`.
nnethercote Jan 4, 2024
250d7e7
Rollup merge of #119601 - nnethercote:Emitter-cleanups, r=oli-obk
compiler-errors Jan 5, 2024
141b31a
Make `DiagnosticBuilder::emit` consuming.
nnethercote Jan 3, 2024
192c4a0
Change how `force-warn` lint diagnostics are recorded.
nnethercote Jan 9, 2024
381ef81
Stop using `DiagnosticBuilder::buffer` in the parser.
nnethercote Jan 11, 2024
6078b96
Delegation implementation: step 1
Bryanskiy Nov 26, 2023
255d2cf
Add `PatKind::Err`
ShE3py Jan 17, 2024
b92320c
Check that a token can begin a nonterminal kind before parsing it as …
compiler-errors Jan 22, 2024
f8847ff
Do not eagerly recover malformed AST in rustfmt
compiler-errors Jan 22, 2024
a095808
Actually, just use nonterminal_may_begin_with
compiler-errors Jan 22, 2024
18f51f7
Make `Emitter::emit_diagnostic` consuming.
nnethercote Feb 2, 2024
88c5838
Lower anonymous structs or unions to HIR
frank-king Jan 4, 2024
16250ea
Add rustfmt test from #117942
frank-king Jan 6, 2024
bed3883
Format async bounds in rustfmt
compiler-errors Feb 13, 2024
e504c64
Rollup merge of #121035 - compiler-errors:rustfmt-asyncness, r=calebc…
GuillaumeGomez Feb 14, 2024
6674be9
Add an `ErrorGuaranteed` to `ast::TyKind::Err`.
nnethercote Feb 14, 2024
aba5f54
errors: only eagerly translate subdiagnostics
davidtwco Feb 14, 2024
2639101
Allow newly added non_local_definitions in rustfmt
Urgau Jan 27, 2024
163c3eb
Rollup merge of #121085 - davidtwco:always-eager-diagnostics, r=nneth…
matthiaskrgr Feb 17, 2024
ce71137
Explicitly call `emit_stashed_diagnostics`.
nnethercote Feb 23, 2024
8c33745
Auto merge of #120393 - Urgau:rfc3373-non-local-defs, r=WaffleLapkin
bors Feb 25, 2024
7d82dd0
Add `ast::ExprKind::Dummy`
ShE3py Feb 25, 2024
1bbfb76
Add `ErrorGuaranteed` to `ast::ExprKind::Err`
ShE3py Feb 25, 2024
90af751
Move `emit_stashed_diagnostic` call in rustfmt.
nnethercote Feb 25, 2024
50987bb
Auto merge of #120586 - ShE3py:exprkind-err, r=fmease
bors Feb 26, 2024
c18226d
Rollup merge of #121615 - nnethercote:fix-121517, r=oli-obk
matthiaskrgr Feb 26, 2024
f9dba39
Auto merge of #121636 - matthiaskrgr:rollup-1tt2o5n, r=matthiaskrgr
bors Feb 26, 2024
d84567c
Rename `Diagnostic` as `DiagInner`.
nnethercote Feb 22, 2024
4026fd7
Rename `DiagnosticBuilder` as `Diag`.
nnethercote Feb 22, 2024
45aad17
Reinstate `emit_stashed_diagnostics` in `DiagCtxtInner::drop`.
nnethercote Feb 28, 2024
0811e8f
Rename `DiagCtxt::with_emitter` as `DiagCtxt::new`.
nnethercote Feb 29, 2024
9c85ae8
Inline and remove `HumanEmitter::stderr`.
nnethercote Feb 29, 2024
6f2722b
Rollup merge of #121783 - nnethercote:emitter-cleanups, r=oli-obk
GuillaumeGomez Feb 29, 2024
fc64cbd
AST: Refactor type alias where clauses
fmease Feb 19, 2024
050610e
Rollup merge of #121326 - fmease:detect-empty-leading-where-clauses-o…
matthiaskrgr Feb 29, 2024
0b56261
Tweak `parse_asm_args`.
nnethercote Dec 20, 2023
78c99eb
Rename all `ParseSess` variables/fields/lifetimes as `psess`.
nnethercote Mar 4, 2024
fe9ceab
Rename `DiagnosticMessage` as `DiagMessage`.
nnethercote Feb 29, 2024
124808b
errors: share `SilentEmitter` between rustc and rustfmt
davidtwco Feb 19, 2024
677c1d8
Rewrite the `untranslatable_diagnostic` lint.
nnethercote Feb 20, 2024
f3892a0
Add MatchKind member to the Match expr for pretty printing & fmt
Feb 17, 2024
1709dd5
Add basic rustfmt implementation & test
Feb 17, 2024
5f8d353
Rollup merge of #121382 - nnethercote:rework-untranslatable_diagnosti…
matthiaskrgr Mar 6, 2024
fe0415e
Rename `ast::StmtKind::Local` into `ast::StmtKind::Let`
GuillaumeGomez Mar 14, 2024
911f6a4
conditionally ignore fatal diagnostic in the SilentEmitter
ytmimi Mar 19, 2024
8f62a2d
step cfgs
Mark-Simulacrum Mar 19, 2024
f670f3b
Implement macro-based deref!() syntax for deref patterns
compiler-errors Mar 20, 2024
0aa66d1
Rollup merge of #121619 - RossSmyth:pfix_match, r=petrochenkov
matthiaskrgr Mar 22, 2024
5e141e0
Rollup merge of #122737 - ytmimi:conditionally_ignore_fatal_diagnosti…
matthiaskrgr Mar 24, 2024
645b94c
Implement `mut ref`/`mut ref mut`
Jules-Bertholet Mar 24, 2024
31a4eae
Add rustfmt test for mut ref mut
Jules-Bertholet Mar 27, 2024
fd20426
Rename ModSep to PathSep
fmease Apr 4, 2024
7af33b3
Add pattern types to ast
oli-obk Jan 30, 2023
afa482e
store the span of the nested part of the use tree in the ast
emilyalbini Apr 1, 2024
9400b99
Rustfmt, clippy
compiler-errors Apr 5, 2024
dac1a22
Rollup merge of #123462 - fmease:rn-mod-sep-to-path-sep, r=nnethercote
fmease Apr 15, 2024
a568985
Auto merge of #123468 - compiler-errors:precise-capturing, r=oli-obk
bors Apr 16, 2024
932f3ab
Rename `BindingAnnotation` to `BindingMode`
Jules-Bertholet Apr 16, 2024
966dd60
Disallow ambiguous attributes on expressions
voidc Apr 17, 2024
9c0e5f2
Rollup merge of #124099 - voidc:disallow-ambiguous-expr-attrs, r=davi…
matthiaskrgr Apr 23, 2024
20e40d5
Error on using `yield` without also using `#[coroutine]` on the closure
oli-obk Apr 11, 2024
e606bb6
Remove direct dependencies on lazy_static, once_cell and byteorder
GKFX Apr 28, 2024
997d5f2
Move rustfmt changes out
GKFX Apr 28, 2024
fafa690
Add StaticForeignItem and use it on ForeignItemKind
spastorino Apr 29, 2024
27d320d
Rollup merge of #124524 - spastorino:make-foreign-static-use-struct, …
matthiaskrgr Apr 30, 2024
2c70167
Rollup merge of #123344 - pietroalbini:pa-unused-imports, r=Nilstrieb
matthiaskrgr May 8, 2024
05a2db7
delegation: Implement list delegation
petrochenkov Mar 15, 2024
97bdbd9
Rename Unsafe to Safety
spastorino May 17, 2024
a2c6f80
Rename HIR `TypeBinding` to `AssocItemConstraint` and related cleanup
fmease May 27, 2024
6478d9e
Handle safety keyword for extern block inner items
spastorino May 23, 2024
eeefcd6
Remove `stream_to_parser`.
nnethercote May 31, 2024
5962aa9
Make top-level `rustc_parse` functions fallible.
nnethercote May 31, 2024
ecb2dd1
rustfmt: Remove an unnecessary `catch_unwind` use.
nnethercote Jun 3, 2024
c1ea878
Auto merge of #124482 - spastorino:unsafe-extern-blocks, r=oli-obk
bors Jun 6, 2024
6f43681
Merge remote-tracking branch 'upstream/master' into subtree-push-nigh…
ytmimi Jun 7, 2024
514a492
bump toolchain to nightly-2024-06-07
ytmimi Jun 7, 2024
1d10f02
make minor tweaks to matching on anon_const based on AST changes
ytmimi Jun 7, 2024
fd3a5cb
allow dead code for `StyleEditionDefault`
ytmimi Jun 7, 2024
b0771aa
Bumped bytecount 0.6.4 -> 0.6.8
ytmimi Jun 7, 2024
fba50ab
remove archived `error-chain` crate from integration tests
ytmimi Apr 20, 2024
e5f5cad
don't apply formatting to builtin type ascription syntax
ytmimi May 6, 2024
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
Add PatKind::Err
  • Loading branch information
ShE3py committed Jan 17, 2024
commit 255d2cf8f18e710375ff75f27562b500477c0201
9 changes: 6 additions & 3 deletions src/patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ pub(crate) fn is_short_pattern(pat: &ast::Pat, pat_str: &str) -> bool {

fn is_short_pattern_inner(pat: &ast::Pat) -> bool {
match pat.kind {
ast::PatKind::Rest | ast::PatKind::Never | ast::PatKind::Wild | ast::PatKind::Lit(_) => {
true
}
ast::PatKind::Rest
| ast::PatKind::Never
| ast::PatKind::Wild
| ast::PatKind::Err(_)
| ast::PatKind::Lit(_) => true,
ast::PatKind::Ident(_, _, ref pat) => pat.is_none(),
ast::PatKind::Struct(..)
| ast::PatKind::MacCall(..)
Expand Down Expand Up @@ -274,6 +276,7 @@ impl Rewrite for Pat {
PatKind::Paren(ref pat) => pat
.rewrite(context, shape.offset_left(1)?.sub_width(1)?)
.map(|inner_pat| format!("({})", inner_pat)),
PatKind::Err(_) => None,
}
}
}
Expand Down