]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMerge #11307
bors[bot] [Mon, 17 Jan 2022 15:53:43 +0000 (15:53 +0000)]
Merge #11307

11307: fix: Allow macros to expand to or-patterns r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11097

Also simplifies the diagnostic slightly.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoAllow macros to expand to or-patterns
Jonas Schievink [Mon, 17 Jan 2022 15:52:53 +0000 (16:52 +0100)]
Allow macros to expand to or-patterns

2 years agoMerge #11304
bors[bot] [Mon, 17 Jan 2022 07:31:19 +0000 (07:31 +0000)]
Merge #11304

11304: fix: Temporarily disable format string completions r=lnicola a=lnicola

CC #11303

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoTemporarily disable format string completions
Laurențiu Nicola [Mon, 17 Jan 2022 07:18:40 +0000 (09:18 +0200)]
Temporarily disable format string completions

2 years agoMerge #11287
bors[bot] [Sun, 16 Jan 2022 15:13:52 +0000 (15:13 +0000)]
Merge #11287

11287: fix: rust-analyzer spamming overly error message when workspace not being loaded r=lnicola a=Milo123459

Fixes #10120

Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
2 years agoMerge #11294
bors[bot] [Sat, 15 Jan 2022 12:18:46 +0000 (12:18 +0000)]
Merge #11294

11294: internal: Move format specifier lexing from syntax to ide_db r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMove format specifier lexing from syntax to ide_db
Lukas Wirth [Sat, 15 Jan 2022 12:14:59 +0000 (13:14 +0100)]
Move format specifier lexing from syntax to ide_db

2 years agoMerge #11293
bors[bot] [Sat, 15 Jan 2022 11:24:21 +0000 (11:24 +0000)]
Merge #11293

11293: feat: Add very simplistic ident completion for format_args! macro input r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofeat: Add very simplistic ident completion for format_args! macro input
Lukas Wirth [Sat, 15 Jan 2022 11:12:02 +0000 (12:12 +0100)]
feat: Add very simplistic ident completion for format_args! macro input

2 years agoMerge #11292
bors[bot] [Sat, 15 Jan 2022 10:17:01 +0000 (10:17 +0000)]
Merge #11292

11292: internal: Decrease PartialOrd and PartialEq trait methods completion relevance r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10245
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: Decrease PartialOrd and PartialEq trait methods completion relevance
Lukas Wirth [Sat, 15 Jan 2022 09:54:09 +0000 (10:54 +0100)]
internal: Decrease PartialOrd and PartialEq trait methods completion relevance

2 years agoformat
Milo [Fri, 14 Jan 2022 22:13:45 +0000 (22:13 +0000)]
format

2 years agofix overly
Milo [Fri, 14 Jan 2022 22:06:30 +0000 (22:06 +0000)]
fix overly

2 years agoMerge #11248
bors[bot] [Fri, 14 Jan 2022 19:03:55 +0000 (19:03 +0000)]
Merge #11248

11248: Merge match assist: take arm types into consideration  r=Vannevelj a=Vannevelj

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9337

Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
2 years agostyling fixes
Jeroen Vannevel [Fri, 14 Jan 2022 18:53:28 +0000 (18:53 +0000)]
styling fixes

2 years agoMerge #11286
bors[bot] [Fri, 14 Jan 2022 17:50:05 +0000 (17:50 +0000)]
Merge #11286

11286: internal: Clean up assoc item collection a bit r=jonas-schievink a=jonas-schievink

Introduce an `AssocItemCollector` instead of passing a lot of parameters around.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoClean up assoc item collection a bit
Jonas Schievink [Fri, 14 Jan 2022 17:45:23 +0000 (18:45 +0100)]
Clean up assoc item collection a bit

2 years agoMerge #11284
bors[bot] [Fri, 14 Jan 2022 16:53:26 +0000 (16:53 +0000)]
Merge #11284

11284: internal: Remove redundant recursion limit r=jonas-schievink a=jonas-schievink

`Expander` already does this, so we don't have to track the depth when collecting associated items.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoRemove redundant recursion limit
Jonas Schievink [Fri, 14 Jan 2022 16:45:57 +0000 (17:45 +0100)]
Remove redundant recursion limit

2 years agoMerge #11283
bors[bot] [Fri, 14 Jan 2022 11:16:18 +0000 (11:16 +0000)]
Merge #11283

11283: fix: Adjust `.` typing auto indentation r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/629
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Adjust `.` typing auto indentation
Lukas Wirth [Fri, 14 Jan 2022 11:15:43 +0000 (12:15 +0100)]
fix: Adjust `.` typing auto indentation

2 years agoMerge #11282
bors[bot] [Fri, 14 Jan 2022 10:08:27 +0000 (10:08 +0000)]
Merge #11282

11282: fix: Properly cache files in Semantics when ascending macros r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11280
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Properly cache files in Semantics when ascending macros
Lukas Wirth [Fri, 14 Jan 2022 10:07:53 +0000 (11:07 +0100)]
fix: Properly cache files in Semantics when ascending macros

2 years agoReplace HasSource usages with Semantics equivalent
Lukas Wirth [Fri, 14 Jan 2022 09:59:27 +0000 (10:59 +0100)]
Replace HasSource usages with Semantics equivalent

2 years agosimple return
Jeroen Vannevel [Fri, 14 Jan 2022 01:26:17 +0000 (01:26 +0000)]
simple return

2 years agoformatting
Jeroen Vannevel [Fri, 14 Jan 2022 01:22:48 +0000 (01:22 +0000)]
formatting

2 years agoremoved toy
Jeroen Vannevel [Fri, 14 Jan 2022 01:22:19 +0000 (01:22 +0000)]
removed toy

2 years agohappy slice
Jeroen Vannevel [Fri, 14 Jan 2022 01:20:40 +0000 (01:20 +0000)]
happy slice

2 years agorefpat & slicepat
Jeroen Vannevel [Fri, 14 Jan 2022 01:18:03 +0000 (01:18 +0000)]
refpat & slicepat

2 years agoParenPat
Jeroen Vannevel [Fri, 14 Jan 2022 00:39:44 +0000 (00:39 +0000)]
ParenPat

2 years agosupport TuplePat
Jeroen Vannevel [Fri, 14 Jan 2022 00:35:21 +0000 (00:35 +0000)]
support TuplePat

2 years agobattle of the Some
Jeroen Vannevel [Tue, 11 Jan 2022 21:53:39 +0000 (21:53 +0000)]
battle of the Some

2 years agocleaning up Some
Jeroen Vannevel [Tue, 11 Jan 2022 21:50:42 +0000 (21:50 +0000)]
cleaning up Some

2 years agoremoved unwrap
Jeroen Vannevel [Tue, 11 Jan 2022 21:44:30 +0000 (21:44 +0000)]
removed unwrap

2 years agoformatting
Jeroen Vannevel [Tue, 11 Jan 2022 21:40:57 +0000 (21:40 +0000)]
formatting

2 years agoremoved prints
Jeroen Vannevel [Tue, 11 Jan 2022 21:40:22 +0000 (21:40 +0000)]
removed prints

2 years agoall tests work
Jeroen Vannevel [Tue, 11 Jan 2022 21:39:50 +0000 (21:39 +0000)]
all tests work

2 years agomerge_match_arms_nested_with_conflicting_identifier
Jeroen Vannevel [Tue, 11 Jan 2022 20:17:47 +0000 (20:17 +0000)]
merge_match_arms_nested_with_conflicting_identifier

2 years agoAdded a few more test cases
Jeroen Vannevel [Tue, 11 Jan 2022 20:05:56 +0000 (20:05 +0000)]
Added a few more test cases

2 years agofixed test case
Jeroen Vannevel [Mon, 10 Jan 2022 23:10:09 +0000 (23:10 +0000)]
fixed test case

2 years agotest for different number of fields
Jeroen Vannevel [Mon, 10 Jan 2022 18:54:59 +0000 (18:54 +0000)]
test for different number of fields

2 years agotest cases with more branches
Jeroen Vannevel [Mon, 10 Jan 2022 18:46:47 +0000 (18:46 +0000)]
test cases with more branches

2 years agosimplified chain
Jeroen Vannevel [Mon, 10 Jan 2022 18:38:17 +0000 (18:38 +0000)]
simplified chain

2 years agodon't need the as_ref()
Jeroen Vannevel [Mon, 10 Jan 2022 18:33:28 +0000 (18:33 +0000)]
don't need the as_ref()

2 years agoextracted function
Jeroen Vannevel [Mon, 10 Jan 2022 18:30:27 +0000 (18:30 +0000)]
extracted function

2 years agoadded tests for multiple fields
Jeroen Vannevel [Mon, 10 Jan 2022 18:24:36 +0000 (18:24 +0000)]
added tests for multiple fields

2 years agousing classify()
Jeroen Vannevel [Mon, 10 Jan 2022 18:19:37 +0000 (18:19 +0000)]
using classify()

2 years agoremoved some unused stuff
Jeroen Vannevel [Mon, 10 Jan 2022 18:14:29 +0000 (18:14 +0000)]
removed some unused stuff

2 years agominicore
Jeroen Vannevel [Mon, 10 Jan 2022 12:44:45 +0000 (12:44 +0000)]
minicore

2 years agocompiles, but doesn't work yet
Jeroen Vannevel [Fri, 7 Jan 2022 23:44:14 +0000 (23:44 +0000)]
compiles, but doesn't work yet

2 years agoMerge #11276
bors[bot] [Thu, 13 Jan 2022 19:18:47 +0000 (19:18 +0000)]
Merge #11276

11276: internal: Slightly cleanup HasFormatSpecifier::lex_format_specifier r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMerge #11277
bors[bot] [Thu, 13 Jan 2022 19:08:38 +0000 (19:08 +0000)]
Merge #11277

11277: minor: reformat and fix warning r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoRemove duplicate test attribute
Laurențiu Nicola [Thu, 13 Jan 2022 19:08:04 +0000 (21:08 +0200)]
Remove duplicate test attribute

2 years agoReformat code
Laurențiu Nicola [Thu, 13 Jan 2022 19:07:17 +0000 (21:07 +0200)]
Reformat code

2 years agoSlightly cleanup HasFormatSpecifier::lex_format_specifier
Lukas Wirth [Thu, 13 Jan 2022 18:12:39 +0000 (19:12 +0100)]
Slightly cleanup HasFormatSpecifier::lex_format_specifier

2 years agoMerge #11274
bors[bot] [Thu, 13 Jan 2022 15:19:03 +0000 (15:19 +0000)]
Merge #11274

11274: internal: Unexport `MacroDefId` from `hir` r=jonas-schievink a=jonas-schievink

It's not used outside of it

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoUnexport `MacroDefId` from `hir`
Jonas Schievink [Thu, 13 Jan 2022 15:18:05 +0000 (16:18 +0100)]
Unexport `MacroDefId` from `hir`

2 years agoMerge #11267
bors[bot] [Wed, 12 Jan 2022 19:22:15 +0000 (19:22 +0000)]
Merge #11267

11267: internal: Remove `ModuleId` from `hir` reexports r=jonas-schievink a=jonas-schievink

followup to https://github.com/rust-analyzer/rust-analyzer/pull/11266

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoRemove `ModuleId` from `hir` reexports
Jonas Schievink [Wed, 12 Jan 2022 19:19:10 +0000 (20:19 +0100)]
Remove `ModuleId` from `hir` reexports

2 years agoMerge #11266
bors[bot] [Wed, 12 Jan 2022 18:58:24 +0000 (18:58 +0000)]
Merge #11266

11266: internal: Mostly restore `hir` API boundary r=jonas-schievink a=jonas-schievink

The boundary was broken in https://github.com/rust-analyzer/rust-analyzer/pull/10872 by reexporting a bunch of `hir_def`-internal types.

This PR moves symbol collection to `hir` and removes those reexports again.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoMostly restore `hir` API boundary
Jonas Schievink [Wed, 12 Jan 2022 18:56:47 +0000 (19:56 +0100)]
Mostly restore `hir` API boundary

2 years agoMerge #11265
bors[bot] [Wed, 12 Jan 2022 12:30:41 +0000 (12:30 +0000)]
Merge #11265

11265: fix: Fix postfix completion panic r=lnicola a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11233
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix postfix completion panic
Lukas Wirth [Wed, 12 Jan 2022 12:07:16 +0000 (13:07 +0100)]
fix: Fix postfix completion panic

2 years agoMerge #11263
bors[bot] [Wed, 12 Jan 2022 11:37:18 +0000 (11:37 +0000)]
Merge #11263

11263: fix: Fix don't drop param completions when fully typing out a pattern r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix don't drop param completions when fully typing out a pattern
Lukas Wirth [Wed, 12 Jan 2022 11:36:46 +0000 (12:36 +0100)]
fix: Fix don't drop param completions when fully typing out a pattern

2 years agoMerge #11261
bors[bot] [Tue, 11 Jan 2022 18:04:09 +0000 (18:04 +0000)]
Merge #11261

11261: fix: Don't complete attributes with existing expressions r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11254 due to the comment being lowered to an attribute
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDon't complete attributes with existing expressions
Lukas Wirth [Tue, 11 Jan 2022 18:03:21 +0000 (19:03 +0100)]
Don't complete attributes with existing expressions

2 years agoMerge #11259
bors[bot] [Tue, 11 Jan 2022 14:43:44 +0000 (14:43 +0000)]
Merge #11259

11259: fix: fix `use super::{super::...};` r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11249

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoFix concatenation of `super` mod paths
Jonas Schievink [Tue, 11 Jan 2022 14:30:39 +0000 (15:30 +0100)]
Fix concatenation of `super` mod paths

2 years agoMerge #11258
bors[bot] [Tue, 11 Jan 2022 14:17:18 +0000 (14:17 +0000)]
Merge #11258

11258: Kate uses rust-analyzer by default now r=jonas-schievink a=milliams

Since Kate 21.12 rust-analyzer is the default. See this Kate MR: https://invent.kde.org/utilities/kate/-/merge_requests/495

Co-authored-by: Matt Williams <matt@milliams.com>
2 years agoMerge #11257
bors[bot] [Tue, 11 Jan 2022 13:36:53 +0000 (13:36 +0000)]
Merge #11257

11257: feat: Report `DefDiagnostic`s from inside item bodies r=jonas-schievink a=jonas-schievink

Reports diagnostics from all block-level `DefMap`s, and adds some code to avoid adding duplicate diagnostics to the body's `SourceMap`.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoKate uses rust-analyzer by default
Matt Williams [Tue, 11 Jan 2022 13:36:06 +0000 (13:36 +0000)]
Kate uses rust-analyzer by default

2 years agoReport `DefDiagnostic`s from inside item bodies
Jonas Schievink [Tue, 11 Jan 2022 13:34:25 +0000 (14:34 +0100)]
Report `DefDiagnostic`s from inside item bodies

2 years agoMerge #11210
bors[bot] [Tue, 11 Jan 2022 09:39:12 +0000 (09:39 +0000)]
Merge #11210

11210: feat: Deprioritize ops methods in completion r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10593

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoLookup lang attribute on assoc item trait directly
Lukas Wirth [Tue, 11 Jan 2022 09:07:16 +0000 (10:07 +0100)]
Lookup lang attribute on assoc item trait directly

2 years agoUpdate tests
Lukas Wirth [Thu, 6 Jan 2022 12:36:43 +0000 (13:36 +0100)]
Update tests

2 years agofeat: Deprioritize ops methods in completion
Lukas Wirth [Thu, 6 Jan 2022 12:31:36 +0000 (13:31 +0100)]
feat: Deprioritize ops methods in completion

2 years agoMerge #11252
bors[bot] [Tue, 11 Jan 2022 08:11:55 +0000 (08:11 +0000)]
Merge #11252

11252: Fix documentation of snippet r=Veykril a=weirane

Closes #11234

Co-authored-by: Wang Ruochen <wrc@ruo-chen.wang>
2 years agoFix documentation of snippet
Wang Ruochen [Tue, 11 Jan 2022 04:47:54 +0000 (20:47 -0800)]
Fix documentation of snippet

2 years agoMerge #11247
bors[bot] [Mon, 10 Jan 2022 15:56:54 +0000 (15:56 +0000)]
Merge #11247

11247: Print a single ellipsis for any number of omitted types r=jonas-schievink a=jonas-schievink

Helps a little bit with https://github.com/rust-analyzer/rust-analyzer/issues/11240

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoPrint a single ellipsis for any number of omitted types
Jonas Schievink [Mon, 10 Jan 2022 15:55:53 +0000 (16:55 +0100)]
Print a single ellipsis for any number of omitted types

2 years agoMerge #11238
bors[bot] [Sat, 8 Jan 2022 14:46:01 +0000 (14:46 +0000)]
Merge #11238

11238: fix: shrink the span of errors from attribute macros and derives r=jonas-schievink a=jonas-schievink

Some procedural macros tend to get very large invocations, for example RTIC's, leading to issues like https://github.com/rtic-rs/cortex-m-rtic/issues/582, where almost the entire screen is underlined while editing incomplete code in the macro.

This PR shrinks the spans of errors from attribute macros and derives to point only at the attribute, which also matches rustc more closely.

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2 years agoShrink diagnostic spans for errors inside macros
Jonas Schievink [Sat, 8 Jan 2022 14:38:50 +0000 (15:38 +0100)]
Shrink diagnostic spans for errors inside macros

2 years agoAllow doc comments on all `Item`s
Jonas Schievink [Sat, 8 Jan 2022 14:01:26 +0000 (15:01 +0100)]
Allow doc comments on all `Item`s

2 years agoMerge #11237
bors[bot] [Sat, 8 Jan 2022 13:55:18 +0000 (13:55 +0000)]
Merge #11237

11237: fix: Fix outline modules spilling inner doc injections into their parent r=Veykril a=Veykril

Fixes another regression caused by https://github.com/rust-analyzer/rust-analyzer/pull/11225
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix outline modules spilling inner doc injections into their parent
Lukas Wirth [Sat, 8 Jan 2022 13:54:31 +0000 (14:54 +0100)]
fix: Fix outline modules spilling inner doc injections into their parent

2 years agoMerge #11236
bors[bot] [Sat, 8 Jan 2022 11:17:56 +0000 (11:17 +0000)]
Merge #11236

11236: internal: Remove `InFile` wrapping from `DynMap` keys r=Veykril a=Veykril

We already store a `DynMap` per `(Container, HirFileId)` pair, so the `InFile` keys are already guruanteed to always be of the same file id
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRemove `InFile` wrapping from DynMap keys
Lukas Wirth [Sat, 8 Jan 2022 11:13:45 +0000 (12:13 +0100)]
Remove `InFile` wrapping from DynMap keys

2 years agoOnly add generics with the correct file id to DynMap
Lukas Wirth [Sat, 8 Jan 2022 10:34:58 +0000 (11:34 +0100)]
Only add generics with the correct file id to DynMap

2 years agoMerge #11235
bors[bot] [Sat, 8 Jan 2022 10:11:37 +0000 (10:11 +0000)]
Merge #11235

11235: internal: Record attribute calls on assoc items in TraitData and ImplData r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11228

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDo less allocs in `trait_data` and `impl_data` queries
Lukas Wirth [Sat, 8 Jan 2022 10:04:16 +0000 (11:04 +0100)]
Do less allocs in `trait_data` and `impl_data` queries

2 years agoRecord attribute calls on assoc items in TraitData and ImplData
Lukas Wirth [Sat, 8 Jan 2022 09:45:12 +0000 (10:45 +0100)]
Record attribute calls on assoc items in TraitData and ImplData

2 years agoMerge #11107
bors[bot] [Sat, 8 Jan 2022 09:05:09 +0000 (09:05 +0000)]
Merge #11107

11107: Fix generic type substitution in impl trait with assoc type r=pnevyk a=pnevyk

Fixes #11045

The path transform now detects if a type parameter that is being substituted has an associated type. In that case it is necessary (or safe in general case) to fully qualify the substitution with a trait which the associated type belongs to.

This PR also fixes the previous wrong behavior of the substitution that could create an invalid tree `PATH_TYPE -> PATH_TYPE -> ...`.

Co-authored-by: Petr Nevyhoštěný <petr.nevyhosteny@gmail.com>
2 years agoMerge #11232
bors[bot] [Fri, 7 Jan 2022 20:52:57 +0000 (20:52 +0000)]
Merge #11232

11232: Filter out macro calls by file id in when building DynMap r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Fri, 7 Jan 2022 20:51:59 +0000 (21:51 +0100)]
Simplify

2 years agoFilter out macro calls by file id in when building DynMap
Lukas Wirth [Fri, 7 Jan 2022 20:31:08 +0000 (21:31 +0100)]
Filter out macro calls by file id in when building DynMap

2 years agoMerge #11230
bors[bot] [Fri, 7 Jan 2022 18:06:33 +0000 (18:06 +0000)]
Merge #11230

11230: fix: Fix attribute stripping ignoring doc comments r=Veykril a=Veykril

Follow up to https://github.com/rust-analyzer/rust-analyzer/pull/11225#pullrequestreview-846779237

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix attribute stripping ignoring doc comments
Lukas Wirth [Fri, 7 Jan 2022 17:51:10 +0000 (18:51 +0100)]
fix: Fix attribute stripping ignoring doc comments

2 years agoFix generic type substitution in impl trait with assoc const
Petr Nevyhoštěný [Fri, 7 Jan 2022 15:41:39 +0000 (16:41 +0100)]
Fix generic type substitution in impl trait with assoc const

2 years agoMerge #11145
bors[bot] [Fri, 7 Jan 2022 14:10:11 +0000 (14:10 +0000)]
Merge #11145

11145: feat: add config to use reasonable default expression instead of todo! when filling missing fields r=Veykril a=bnjjj

Use `Default::default()` in struct fields when we ask to fill it instead of putting `todo!()` for every fields

before:

```rust
pub enum Other {
    One,
    Two,
}

pub struct Test {
    text: String,
    num: usize,
    other: Other,
}

fn t_test() {
    let test = Test {<|>};
}
```

after:

```rust
pub enum Other {
    One,
    Two,
}

pub struct Test {
    text: String,
    num: usize,
    other: Other,
}

fn t_test() {
    let test = Test {
        text: String::new(),
        num: 0,
        other: todo!(),
    };
}
```

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>