rust/crates
bors[bot] 520b8a5a4d
Merge #7115
7115: Migrate HasSource::source to return Option r=matklad a=nick96

I've made a start on fixing #6913 based on the provided work plan, migrating `HasSource::source` to return an `Option`. The simple cases are migrated but there are a few that I'm unsure exactly how they should be handled:

- Logging the processing of functions in `AnalysisStatsCmd::run`: In verbose mode it includes the path to the module containing the function and the syntax range. I've handled this with an if-let but would it be better to blow up here with `expect`? I'm not 100% on the code paths but if we're processing a function definition then the source should exist.

I've handled `source()` in all code paths as `None` being a valid return value but are there some cases where we should just blow up? Also, all I've done is bubble up the returned `None`s, there may be some places where we can recover and still provide something.

Co-authored-by: Nick Spain <nicholas.spain@stileeducation.com>
Co-authored-by: Nick Spain <nicholas.spain96@gmail.com>
2021-01-03 08:56:17 +00:00
..
arena
assists Merge #7115 2021-01-03 08:56:17 +00:00
base_db Add support for Rust 2021. 2021-01-01 17:22:23 +01:00
cfg Remove some redundant allocations 2020-12-12 12:27:09 -05:00
completion Handle case where detail doesn't exist without giving up on completion 2021-01-02 21:53:52 +11:00
flycheck Pin cargo_metadata 2020-11-25 10:11:53 -05:00
hir Merge #7115 2021-01-03 08:56:17 +00:00
hir_def Merge #7128 2021-01-03 08:49:59 +00:00
hir_expand Merge #7133 2021-01-02 17:42:45 +00:00
hir_ty Merge #7133 2021-01-02 17:42:45 +00:00
ide Fix ConstParam HasSource impl and implement TryToNav not Nav 2021-01-02 22:11:25 +11:00
ide_db Fix type error with .and_then 2021-01-02 21:53:52 +11:00
mbe Introduce HygieneFrames for proper token hyginee 2021-01-02 20:39:57 +08:00
parser Fix mbe fail to pass expr with attr 2020-12-28 19:53:00 +08:00
paths
proc_macro_api Remove serde_stacker which depends on cc 2021-01-01 15:26:55 +08:00
proc_macro_srv Fix spacing in proc-macro tokens to_string 2020-12-31 13:36:19 +08:00
proc_macro_test
profile Deny unreachable-pub 2020-11-02 14:07:08 +01:00
project_model Add support for Rust 2021. 2021-01-01 17:22:23 +01:00
rust-analyzer Merge #7115 2021-01-03 08:56:17 +00:00
ssr Remove some unneeded string allocations 2020-12-31 10:13:14 +01:00
stdx add open Cargo.toml action 2020-11-12 17:48:07 -08:00
syntax Fix warnings on rust-nightly 2021-01-02 20:48:39 +01:00
test_utils Make config.rs a single source of truth for configuration. 2020-12-08 19:25:41 +03:00
text_edit Avoid turning completion objects into builders 2020-11-16 23:16:41 +02:00
toolchain
tt Move TokenExpander to base_db and rename it 2020-12-27 15:29:47 +01:00
vfs Merge #6785 2020-12-09 16:32:03 +00:00
vfs-notify Follow symlinks when walking project trees 2020-10-15 14:22:36 -04:00