]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAllow including `Self` kw references to `FindUsages`
unexge [Sat, 3 Apr 2021 21:01:49 +0000 (00:01 +0300)]
Allow including `Self` kw references to `FindUsages`

3 years agoMerge #8325
bors[bot] [Sun, 4 Apr 2021 15:42:19 +0000 (15:42 +0000)]
Merge #8325

8325: Check if bitflags deps pulls its weight r=jonas-schievink a=matklad

Bitflags is generally a good dependency -- it's lightweight, well
maintained and embraced by the ecosystem.

I wonder, however, do we really need it? Doesn't feel like it adds much
to be honest.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMerge #8295
bors[bot] [Sun, 4 Apr 2021 11:38:20 +0000 (11:38 +0000)]
Merge #8295

8295: Add `convert_into_to_from` assist r=Veykril a=obmarg

This adds a "Convert Into to From" assist, useful since clippy has
recently started adding lints on every `Into`.

It covers converting the signature, and converting any `self`/`Self`
references within the body.

It does assume that every instance of `Into` can be converted to a
`From`, which I _think_ is the case now.  Let me know if there's
something I'm not thinking of and I can try and make it smarter.

Closes #8196

![CleanShot 2021-04-02 at 13 39 54](https://user-images.githubusercontent.com/556490/113420108-9ce21c00-93c0-11eb-8c49-80b5fb189284.gif)

I'm extremely new to this codebase so please let me know if anything needs
changed.

Co-authored-by: Graeme Coupar <grambo@grambo.me.uk>
3 years agoMerge #8327
bors[bot] [Sun, 4 Apr 2021 11:30:07 +0000 (11:30 +0000)]
Merge #8327

8327: Move `Ty` creation methods out of `Ty` (Chalk move preparation) r=flodiebold a=flodiebold

When we'll move to using `chalk_ir::Ty` (#8313), we won't be able to have our own inherent methods on `Ty` anymore, so we need to move the helpers elsewhere.
This adds a `TyBuilder` that allows easily constructing `Ty` and related types (`TraitRef`, `ProjectionTy`, `Substitution`). It also replaces `SubstsBuilder`. `TyBuilder` can construct different things based on its type parameter; e.g. if it has an `AdtId`, we're constructing an ADT type, but if it has a `TraitId`, we're constructing a `TraitRef`. The common thing for all of them is that we need to build a `Substitution`, so the API stays the same for all of them except at the beginning and end.

We also use `TyBuilder` to house various one-shot methods for constructing types, e.g. `TyBuilder::unit()`.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoAdd comment
Florian Diebold [Sun, 4 Apr 2021 11:23:22 +0000 (13:23 +0200)]
Add comment

3 years agoReplace Substitution::type_params
Florian Diebold [Sun, 4 Apr 2021 11:16:16 +0000 (13:16 +0200)]
Replace Substitution::type_params

3 years agoReplace Substitution::bound_vars and ::type_params_for_generics
Florian Diebold [Sun, 4 Apr 2021 11:07:06 +0000 (13:07 +0200)]
Replace Substitution::bound_vars and ::type_params_for_generics

3 years agoMove TyBuilder to its own module
Florian Diebold [Sun, 4 Apr 2021 10:55:47 +0000 (12:55 +0200)]
Move TyBuilder to its own module

3 years agoReplace last uses of SubstsBuilder by TyBuilder
Florian Diebold [Sun, 4 Apr 2021 10:48:10 +0000 (12:48 +0200)]
Replace last uses of SubstsBuilder by TyBuilder

3 years agoRemove CallableSig::from_substs
Florian Diebold [Sat, 3 Apr 2021 20:47:29 +0000 (22:47 +0200)]
Remove CallableSig::from_substs

3 years agoUse TyBuilder in another place
Florian Diebold [Sat, 3 Apr 2021 20:45:31 +0000 (22:45 +0200)]
Use TyBuilder in another place

3 years agoSome more TyBuilder use
Florian Diebold [Sat, 3 Apr 2021 20:28:10 +0000 (22:28 +0200)]
Some more TyBuilder use

3 years agoReplace remaining uses of Substitution::build_for_def
Florian Diebold [Sat, 3 Apr 2021 20:18:02 +0000 (22:18 +0200)]
Replace remaining uses of Substitution::build_for_def

3 years agoMore TyBuilder use
Florian Diebold [Sat, 3 Apr 2021 19:59:13 +0000 (21:59 +0200)]
More TyBuilder use

3 years agoMore TyBuilder use
Florian Diebold [Sat, 3 Apr 2021 19:56:18 +0000 (21:56 +0200)]
More TyBuilder use

3 years agoAdd and start using TraitRef and ProjectionTy builders
Florian Diebold [Sat, 3 Apr 2021 19:50:52 +0000 (21:50 +0200)]
Add and start using TraitRef and ProjectionTy builders

3 years agoMove Ty::builtin to TyBuilder
Florian Diebold [Sat, 3 Apr 2021 19:32:22 +0000 (21:32 +0200)]
Move Ty::builtin to TyBuilder

3 years agoAdd TyBuilder::adt
Florian Diebold [Sat, 3 Apr 2021 19:29:49 +0000 (21:29 +0200)]
Add TyBuilder::adt

3 years agoMove Ty::fn_ptr to TyBuilder
Florian Diebold [Sat, 3 Apr 2021 18:27:57 +0000 (20:27 +0200)]
Move Ty::fn_ptr to TyBuilder

3 years agoAdd TyBuilder::unit() and TyExt::is_unit()
Florian Diebold [Sat, 3 Apr 2021 18:22:59 +0000 (20:22 +0200)]
Add TyBuilder::unit() and TyExt::is_unit()

3 years agoAdd TyBuilder
Florian Diebold [Sat, 3 Apr 2021 18:14:21 +0000 (20:14 +0200)]
Add TyBuilder

3 years agoCheck if bitflags deps pulls its weight
Aleksey Kladov [Sun, 4 Apr 2021 09:06:01 +0000 (12:06 +0300)]
Check if bitflags deps pulls its weight

Bitflags is generally a good dependency -- it's lightweight, well
maintained and embraced by the ecosystem.

I wonder, however, do we really need it? Doesn't feel like it adds much
to be honest.

3 years agoMerge #8324
bors[bot] [Sun, 4 Apr 2021 01:27:14 +0000 (01:27 +0000)]
Merge #8324

8324: Add `Body::shrink_to_fit` r=jonas-schievink a=jonas-schievink

Saves ~15 MB

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAdd `Body::shrink_to_fit`
Jonas Schievink [Sun, 4 Apr 2021 01:26:16 +0000 (03:26 +0200)]
Add `Body::shrink_to_fit`

3 years agoMerge #8323
bors[bot] [Sun, 4 Apr 2021 01:18:13 +0000 (01:18 +0000)]
Merge #8323

8323: Only remember blocks that have a DefMap r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoOnly remember blocks that have a DefMap
Jonas Schievink [Sun, 4 Apr 2021 01:16:26 +0000 (03:16 +0200)]
Only remember blocks that have a DefMap

3 years agoMerge #8322
bors[bot] [Sun, 4 Apr 2021 01:04:44 +0000 (01:04 +0000)]
Merge #8322

8322: Access a body's block def maps via a method r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAccess a body's block def maps via a method
Jonas Schievink [Sun, 4 Apr 2021 01:03:18 +0000 (03:03 +0200)]
Access a body's block def maps via a method

3 years agoMerge #8321
bors[bot] [Sun, 4 Apr 2021 00:56:46 +0000 (00:56 +0000)]
Merge #8321

8321: Use exhaustive matches in shrink_to_fit impls r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoUse exhaustive matches in shrink_to_fit impls
Jonas Schievink [Sun, 4 Apr 2021 00:56:11 +0000 (02:56 +0200)]
Use exhaustive matches in shrink_to_fit impls

3 years agoMerge #8320
bors[bot] [Sat, 3 Apr 2021 23:47:10 +0000 (23:47 +0000)]
Merge #8320

8320: Make `ast_to_token_tree` infallible r=jonas-schievink a=jonas-schievink

It could never return `None`, so reflect that in the return type

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoMake `ast_to_token_tree` infallible
Jonas Schievink [Sat, 3 Apr 2021 23:46:45 +0000 (01:46 +0200)]
Make `ast_to_token_tree` infallible

It could never return `None`, so reflect that in the return type

3 years agoMerge #8319
bors[bot] [Sat, 3 Apr 2021 23:30:41 +0000 (23:30 +0000)]
Merge #8319

8319: Glob-reexport hir_def database types r=jonas-schievink a=jonas-schievink

Avoids having to constantly adjust this list

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoGlob-reexport hir_def database types
Jonas Schievink [Sat, 3 Apr 2021 23:29:59 +0000 (01:29 +0200)]
Glob-reexport hir_def database types

3 years agoMerge #8318
bors[bot] [Sat, 3 Apr 2021 21:47:39 +0000 (21:47 +0000)]
Merge #8318

8318: Use shrink_to_fit to reduce DefMap sizes r=jonas-schievink a=jonas-schievink

Especially `block_def_map` can overallocate when there's not a lot of items in the `DefMap`. This saves around 10 MB during analysis-stats. Not too much, but a cheap win.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoUse shrink_to_fit to reduce DefMap sizes
Jonas Schievink [Sat, 3 Apr 2021 21:45:27 +0000 (23:45 +0200)]
Use shrink_to_fit to reduce DefMap sizes

3 years agoMerge #8315
bors[bot] [Sat, 3 Apr 2021 19:01:03 +0000 (19:01 +0000)]
Merge #8315

8315: Try to reduce ItemTree size further r=jonas-schievink a=jonas-schievink

This was mostly a failed experiment, but still seems like the right thing to do. Memory reduction is mostly negligible.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoUse bitflags to compress function properties
Jonas Schievink [Sat, 3 Apr 2021 18:58:42 +0000 (20:58 +0200)]
Use bitflags to compress function properties

Very minor savings, only 1 MB or so

3 years agoIntern `ModPath` in `Import`
Jonas Schievink [Sat, 3 Apr 2021 18:56:53 +0000 (20:56 +0200)]
Intern `ModPath` in `Import`

Minor savings only

3 years agoMerge #8312
bors[bot] [Sat, 3 Apr 2021 16:18:44 +0000 (16:18 +0000)]
Merge #8312

8312: cargo update r=kjeremy a=kjeremy

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
3 years agocargo update
Jeremy Kolb [Sat, 3 Apr 2021 16:18:00 +0000 (12:18 -0400)]
cargo update

3 years agoConvert Into to From assist
Graeme Coupar [Fri, 2 Apr 2021 13:00:56 +0000 (14:00 +0100)]
Convert Into to From assist

This adds a "Convert Into to From" assist, useful since clippy has
recently started adding lints on every `Into`.

It covers converting the signature, and converting any `self`/`Self`
references within the body to the correct types.

It does assume that every instance of `Into` can be converted to a
`From`, which I _think_ is the case now.  Let me know if there's
something I'm not thinking of and I can try and make it smarter.

3 years agoMerge #8310
bors[bot] [Sat, 3 Apr 2021 11:09:43 +0000 (11:09 +0000)]
Merge #8310

8310: Rename Ty::interned to Ty::kind r=flodiebold a=flodiebold

... since that's the actual method on Chalk side that matches the signature.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoRename Ty::interned to Ty::kind
Florian Diebold [Sat, 3 Apr 2021 11:08:29 +0000 (13:08 +0200)]
Rename Ty::interned to Ty::kind

... since that's the actual method on Chalk side that matches the signature.

3 years agoMerge #8309
bors[bot] [Sat, 3 Apr 2021 09:19:55 +0000 (09:19 +0000)]
Merge #8309

8309: Introduce `GenericArg` like in Chalk r=flodiebold a=flodiebold

Plus some more adaptations to Substitution.

Lots of `assert_ty_ref` that we should revisit when introducing lifetime/const parameters.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoIntroduce `GenericArg` like in Chalk
Florian Diebold [Thu, 1 Apr 2021 19:04:02 +0000 (21:04 +0200)]
Introduce `GenericArg` like in Chalk

Plus some more adaptations to Substitution.

Lots of `assert_ty_ref` that we should revisit when introducing
lifetime/const parameters.

3 years agoMerge #8307
bors[bot] [Sat, 3 Apr 2021 04:55:39 +0000 (04:55 +0000)]
Merge #8307

8307: Allow include! an empty content file r=edwin0cheng a=edwin0cheng

fixes #8306

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoAllow include! an empty content file
Edwin Cheng [Sat, 3 Apr 2021 04:50:55 +0000 (12:50 +0800)]
Allow include! an empty content file

3 years agoMerge #8305
bors[bot] [Sat, 3 Apr 2021 03:21:45 +0000 (03:21 +0000)]
Merge #8305

8305: Fix joinLines panic if run on the empty last line r=edwin0cheng a=edwin0cheng

fixes #8299

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoFix joinLines panic if run on the empty last line
Edwin Cheng [Sat, 3 Apr 2021 03:20:16 +0000 (11:20 +0800)]
Fix joinLines panic if run on the empty last line

3 years agoMerge #8304
bors[bot] [Sat, 3 Apr 2021 01:14:56 +0000 (01:14 +0000)]
Merge #8304

8304: Support the new `panic!()` macro r=jonas-schievink a=jonas-schievink

Includes a minor fixup to macro 2.0 parsing.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoSupport `#[rustc_builtin_macro = "builtin_name"]`
Jonas Schievink [Sat, 3 Apr 2021 01:13:04 +0000 (03:13 +0200)]
Support `#[rustc_builtin_macro = "builtin_name"]`

3 years agoImplement edition-dependent builtin `panic!` macro
Jonas Schievink [Sat, 3 Apr 2021 01:12:55 +0000 (03:12 +0200)]
Implement edition-dependent builtin `panic!` macro

3 years agoAllow `,` to delimit macro 2.0 rules
Jonas Schievink [Sat, 3 Apr 2021 01:08:31 +0000 (03:08 +0200)]
Allow `,` to delimit macro 2.0 rules

3 years agoMerge #8303
bors[bot] [Sat, 3 Apr 2021 00:09:41 +0000 (00:09 +0000)]
Merge #8303

8303: Allow interning strings r=jonas-schievink a=jonas-schievink

We don't use it yet, that's a bit more complicated.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAllow interning strings
Jonas Schievink [Fri, 2 Apr 2021 23:00:45 +0000 (01:00 +0200)]
Allow interning strings

3 years agoMerge #8298
bors[bot] [Fri, 2 Apr 2021 18:47:25 +0000 (18:47 +0000)]
Merge #8298

8298: Stop using an upgradeable read lock in interning r=jonas-schievink a=jonas-schievink

Only one upgradeable read lock can be handed out at the same time, and
we never acquire a non-upgradeable read lock, so this has no benefit
over just using a write lock in the first place.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoStop using an upgradeable read lock in interning
Jonas Schievink [Fri, 2 Apr 2021 18:46:37 +0000 (20:46 +0200)]
Stop using an upgradeable read lock in interning

Only one upgradeable read lock can be handed out at the same time, and
we never acquire a non-upgradeable read lock, so this has no benefit
over just using a write lock in the first place.

3 years agoMerge #8297
bors[bot] [Fri, 2 Apr 2021 17:00:57 +0000 (17:00 +0000)]
Merge #8297

8297: Only populate prelude for crate-level DefMaps r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoOnly populate prelude for crate-level DefMaps
Jonas Schievink [Fri, 2 Apr 2021 17:00:26 +0000 (19:00 +0200)]
Only populate prelude for crate-level DefMaps

3 years agoMerge #8284
bors[bot] [Fri, 2 Apr 2021 16:43:16 +0000 (16:43 +0000)]
Merge #8284

8284: Reduce memory usage by using global `Arc`-based interning r=jonas-schievink a=jonas-schievink

This saves around 50 mb when running `analysis-stats` on r-a itself. Not a lot, but this infra can be easily reused to intern more stuff.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoMerge #8291
bors[bot] [Fri, 2 Apr 2021 16:35:22 +0000 (16:35 +0000)]
Merge #8291

8291: Put the revision in the startup message r=jonas-schievink a=lf-

Co-authored-by: Jade <software@lfcode.ca>
3 years agoRemove `?Sized` on `PartialEq`/`Eq` impls
Jonas Schievink [Fri, 2 Apr 2021 16:26:34 +0000 (18:26 +0200)]
Remove `?Sized` on `PartialEq`/`Eq` impls

3 years agoSplit `Intern::drop` into hot and cold path
Jonas Schievink [Fri, 2 Apr 2021 16:11:08 +0000 (18:11 +0200)]
Split `Intern::drop` into hot and cold path

3 years agoMerge #8287
bors[bot] [Fri, 2 Apr 2021 14:41:24 +0000 (14:41 +0000)]
Merge #8287

8287: Don't allocate in `associated_type_shorthand_candidates` r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't allocate in `associated_type_shorthand_candidates`
Lukas Wirth [Fri, 2 Apr 2021 00:09:12 +0000 (02:09 +0200)]
Don't allocate in `associated_type_shorthand_candidates`

3 years agoMerge #8294
bors[bot] [Fri, 2 Apr 2021 12:30:02 +0000 (12:30 +0000)]
Merge #8294

8294: minor: add profile call for resolve_obligations r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agominor: add profile call for resolve_obligations
Aleksey Kladov [Fri, 2 Apr 2021 12:28:51 +0000 (15:28 +0300)]
minor: add profile call for resolve_obligations

3 years agoMerge #8293
bors[bot] [Fri, 2 Apr 2021 12:00:30 +0000 (12:00 +0000)]
Merge #8293

8293: internal: document style for helper functions and variables r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: document style for helper functions and variables
Aleksey Kladov [Fri, 2 Apr 2021 11:52:00 +0000 (14:52 +0300)]
internal: document style for helper functions and variables

3 years agoMerge #8285
bors[bot] [Fri, 2 Apr 2021 11:25:40 +0000 (11:25 +0000)]
Merge #8285

8285: Don't recheck obligations if we have learned nothing new r=matklad a=flodiebold

This is just the most trivial check: If no inference variables have been updated, and there are no new obligations, we can just skip trying to solve them again. We could be smarter about it, but this already helps quite a bit, and I don't want to touch this too much before we replace the inference table by Chalk's.

Fixes #8263 (well, improves it quite a bit).

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoMerge #8292
bors[bot] [Fri, 2 Apr 2021 11:00:39 +0000 (11:00 +0000)]
Merge #8292

8292: internal: document Cargo.lock maintenance process r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: document Cargo.lock maintenance process
Aleksey Kladov [Fri, 2 Apr 2021 10:59:36 +0000 (13:59 +0300)]
internal: document Cargo.lock maintenance process

3 years agoPut the revision in the logged startup message
Jade [Fri, 2 Apr 2021 09:51:44 +0000 (02:51 -0700)]
Put the revision in the logged startup message

3 years agoMerge #8265
bors[bot] [Thu, 1 Apr 2021 21:22:11 +0000 (21:22 +0000)]
Merge #8265

8265: Improve rustc diagnostic mapping r=jonas-schievink a=jonas-schievink

Try to mirror rustc diagnostics more closely by:

* Emitting hint-level diagnostics at *all* macro invocation sites that caused the diagnostic
  * Previously we emitted a copy of the diagnostic (not at hint level) at the last macro invocation site only
* Emitting the original diagnostic inside the macro, if it was caused by a macro
* Always including related information pointing to the invocation site or the macro, respectively (the old code contained a bug that would sometimes omit it)

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

![screenshot-2021-03-30-19:34:56](https://user-images.githubusercontent.com/1786438/113031484-1266a600-918f-11eb-9164-fed01c8ba37e.png)
![screenshot-2021-03-30-19:35:10](https://user-images.githubusercontent.com/1786438/113031486-12ff3c80-918f-11eb-8f15-9d7f23b69653.png)

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
3 years agoMerge #8283
bors[bot] [Thu, 1 Apr 2021 21:11:06 +0000 (21:11 +0000)]
Merge #8283

8283: Resolve associated types r=flodiebold a=Veykril

Prior we were only resolving paths until the first type was found, then discarding the result if the path wasn't fully consumed. That of course causes associated types to not resolve. Fixes #5003

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #8286
bors[bot] [Thu, 1 Apr 2021 21:01:39 +0000 (21:01 +0000)]
Merge #8286

8286: Include remaining memory in memory usage stats r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoInclude remaining memory in memory usage stats
Jonas Schievink [Thu, 1 Apr 2021 21:01:07 +0000 (23:01 +0200)]
Include remaining memory in memory usage stats

3 years agoRemove unnecessary region, relax `Sized` bounds
Jonas Schievink [Thu, 1 Apr 2021 20:24:40 +0000 (22:24 +0200)]
Remove unnecessary region, relax `Sized` bounds

3 years agoResolve associated types with type anchors
Lukas Wirth [Thu, 1 Apr 2021 19:52:07 +0000 (21:52 +0200)]
Resolve associated types with type anchors

3 years agoDon't recheck obligations if we have learned nothing new
Florian Diebold [Thu, 1 Apr 2021 19:45:44 +0000 (21:45 +0200)]
Don't recheck obligations if we have learned nothing new

This is just the most trivial check: If no inference variables have been
updated, and there are no new obligations, we can just skip trying to
solve them again. We could be smarter about it, but this already helps
quite a bit, and I don't want to touch this too much before we replace
the inference table by Chalk's.

Fixes #8263 (well, improves it quite a bit).

3 years agoResolve associated types
Lukas Wirth [Thu, 1 Apr 2021 16:01:18 +0000 (18:01 +0200)]
Resolve associated types

3 years agoIntern Attr, MacroCall and Path components
Jonas Schievink [Thu, 1 Apr 2021 18:35:21 +0000 (20:35 +0200)]
Intern Attr, MacroCall and Path components

3 years agoGlobal TypeRef/TraitRef interning
Jonas Schievink [Thu, 1 Apr 2021 17:46:43 +0000 (19:46 +0200)]
Global TypeRef/TraitRef interning

3 years agoCheck for and skip dummy macro files
Jonas Schievink [Thu, 1 Apr 2021 13:51:02 +0000 (15:51 +0200)]
Check for and skip dummy macro files

3 years agoAdjust message when pointing at location in macro
Jonas Schievink [Thu, 1 Apr 2021 12:44:20 +0000 (14:44 +0200)]
Adjust message when pointing at location in macro

3 years agoMerge #8274
bors[bot] [Thu, 1 Apr 2021 00:01:40 +0000 (00:01 +0000)]
Merge #8274

8274: Adding a few more gifs and screenshots for features in manual r=Veykril a=MozarellaMan

Related  #8267,#6539. Gifs are [here](https://github.com/rust-analyzer/rust-analyzer/issues/6539#issuecomment-809574840)

Finishing up the last PR,  for the last two features that didn't have a visual example.

For syntax highlighting, I wasn't able to find a theme that displayed the difference between an enum and struct, but I only tried a few apart from the default so there could be one out there!

e.g., with the default light theme, `Ord` and `Ordering` in `use std::cmp::{Ord, Ordering}` had the same highlight colour. So I just went with displaying `mut` items being underlined.

Co-authored-by: Ayomide Bamidele <48062697+MozarellaMan@users.noreply.github.com>
3 years agoMerge #8276
bors[bot] [Wed, 31 Mar 2021 19:56:01 +0000 (19:56 +0000)]
Merge #8276

8276: Fix block inner item defined in macro r=jonas-schievink a=edwin0cheng

Fixes  #8229

r? @jonas-schievink

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoFix block inner item defined in macro
Edwin Cheng [Wed, 31 Mar 2021 19:45:21 +0000 (03:45 +0800)]
Fix block inner item defined in macro

3 years agoAdditional syntax highlighting screenshot in manual
Ayomide Bamidele [Wed, 31 Mar 2021 17:45:15 +0000 (18:45 +0100)]
Additional syntax highlighting screenshot in manual

3 years agoSearch for a suitable primary location
Jonas Schievink [Wed, 31 Mar 2021 15:50:19 +0000 (17:50 +0200)]
Search for a suitable primary location

3 years agoGif of "let = " typing assist
Ayomide Bamidele [Wed, 31 Mar 2021 15:39:04 +0000 (16:39 +0100)]
Gif of "let = " typing assist

3 years agoGifs and screenshots for features in manual (syntax highlighting and typing)
Ayomide Bamidele [Wed, 31 Mar 2021 15:20:54 +0000 (16:20 +0100)]
Gifs and screenshots for features in manual (syntax highlighting and typing)

3 years agoRename `convert_location` -> `location`
Jonas Schievink [Wed, 31 Mar 2021 15:18:21 +0000 (17:18 +0200)]
Rename `convert_location` -> `location`

3 years agoMerge #8210
bors[bot] [Wed, 31 Mar 2021 12:26:57 +0000 (12:26 +0000)]
Merge #8210

8210: Implement "Extract type alias" assist r=jonas-schievink a=jonas-schievink

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoMerge #8271
bors[bot] [Wed, 31 Mar 2021 12:08:12 +0000 (12:08 +0000)]
Merge #8271

8271: Fix fail to parse u128  in proc-macro r=edwin0cheng a=edwin0cheng

fixes #8270

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoFix parse u128 bug in proc-macro
Edwin Cheng [Wed, 31 Mar 2021 11:50:36 +0000 (19:50 +0800)]
Fix parse u128  bug in proc-macro

3 years agoMerge #8269
bors[bot] [Wed, 31 Mar 2021 10:30:45 +0000 (10:30 +0000)]
Merge #8269

8269: internal: document semantics for missing names r=flodiebold a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: document semantics for missing names
Aleksey Kladov [Wed, 31 Mar 2021 10:24:08 +0000 (13:24 +0300)]
internal: document semantics for missing names

3 years agoMerge #8267
bors[bot] [Wed, 31 Mar 2021 10:01:56 +0000 (10:01 +0000)]
Merge #8267

8267: Adding gifs and screenshots for features in manual r=matklad a=MozarellaMan

For #6539

This includes most of gif or screenshot examples of most items in the "Features" header. With the exceptions of:

- **On Typing Assists** - couldn't get it to work for a demo, I'm probably missing something?
- **Structural search and replace** - looked to be already a visual example of the feature
- **Workspace symbol** - wasn't sure how best to show this, all of the examples maybe? Also wasn't sure of the best code example to show it off
- **Semantic Syntax Highlighting** - seemed obvious enough to not need a screenshot, but I could easily add this

All the gifs/pngs are hosted in this [comment](https://github.com/rust-analyzer/rust-analyzer/issues/6539#issuecomment-809574840). Please let me know if any of them aren't suitable (and why) and I'll improve it! Or if you don't like the theme/font

Co-authored-by: Ayomide Bamidele <48062697+MozarellaMan@users.noreply.github.com>