]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoHandle errors when `cargo watch` fails
oxalica [Fri, 15 Nov 2019 18:49:44 +0000 (02:49 +0800)]
Handle errors when `cargo watch` fails

4 years agoMerge #2261
bors[bot] [Fri, 15 Nov 2019 16:04:33 +0000 (16:04 +0000)]
Merge #2261

2261: Reduce visibility r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoReduce visibility
Aleksey Kladov [Fri, 15 Nov 2019 16:04:00 +0000 (19:04 +0300)]
Reduce visibility

4 years agoMerge #2259
bors[bot] [Fri, 15 Nov 2019 13:03:46 +0000 (13:03 +0000)]
Merge #2259

2259: Update smallvec and fix rustc warning r=matklad a=memoryruins

- Update smallvec in ra_mbe to [1.0](https://github.com/servo/rust-smallvec/releases/tag/v1.0.0)
- Heed rustc's `array_into_iter` lint https://github.com/rust-lang/rust/issues/66145

Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
4 years agoHeed the advice of rustc's into_iter() warning
memoryruins [Fri, 15 Nov 2019 11:53:11 +0000 (06:53 -0500)]
Heed the advice of rustc's into_iter() warning

4 years agoUpdate smallvec dep to 1.0
memoryruins [Fri, 15 Nov 2019 11:45:58 +0000 (06:45 -0500)]
Update smallvec dep to 1.0

4 years agoMerge #2257
bors[bot] [Fri, 15 Nov 2019 11:53:55 +0000 (11:53 +0000)]
Merge #2257

2257: Flatten expr module r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoFlatten expr module
Aleksey Kladov [Fri, 15 Nov 2019 11:53:09 +0000 (14:53 +0300)]
Flatten expr module

4 years agoMove scope tests to hir_def
Aleksey Kladov [Fri, 15 Nov 2019 11:47:26 +0000 (14:47 +0300)]
Move scope tests to hir_def

4 years agoReduce visibility
Aleksey Kladov [Fri, 15 Nov 2019 11:15:04 +0000 (14:15 +0300)]
Reduce visibility

4 years agoMerge #2255
bors[bot] [Fri, 15 Nov 2019 10:18:45 +0000 (10:18 +0000)]
Merge #2255

2255: Add convenience method for testing r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoAdd convenience method for testing
Aleksey Kladov [Fri, 15 Nov 2019 10:16:16 +0000 (13:16 +0300)]
Add convenience method for testing

4 years agoMerge #2254
bors[bot] [Fri, 15 Nov 2019 09:57:00 +0000 (09:57 +0000)]
Merge #2254

2254: Auto-upgrade some insta snapshots r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoAuto-upgrade some insta snapshots
Aleksey Kladov [Fri, 15 Nov 2019 09:56:24 +0000 (12:56 +0300)]
Auto-upgrade some insta snapshots

4 years agoMerge #2253
bors[bot] [Fri, 15 Nov 2019 09:24:59 +0000 (09:24 +0000)]
Merge #2253

2253: Reduce visibility r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoReduce visibility
Aleksey Kladov [Fri, 15 Nov 2019 09:24:30 +0000 (12:24 +0300)]
Reduce visibility

4 years agoUse Local more
Aleksey Kladov [Fri, 15 Nov 2019 09:00:36 +0000 (12:00 +0300)]
Use Local more

4 years agoMerge #2251
bors[bot] [Fri, 15 Nov 2019 07:45:57 +0000 (07:45 +0000)]
Merge #2251

2251: Privatize modules r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoPrivatize modules
Aleksey Kladov [Fri, 15 Nov 2019 07:42:54 +0000 (10:42 +0300)]
Privatize modules

4 years agoRefactor Module::from_source to properly descend from root file
Aleksey Kladov [Fri, 15 Nov 2019 07:26:31 +0000 (10:26 +0300)]
Refactor Module::from_source to properly descend from root file

4 years agoMerge #2165
bors[bot] [Fri, 15 Nov 2019 07:01:19 +0000 (07:01 +0000)]
Merge #2165

2165: ra_assists: Add add_new assist r=matklad a=rep-nop

Adds a new assist to autogenerate a new fn based on the selected struct, excluding tuple structs and unions. The fn will inherit the same visibility as the struct and the assist will attempt to reuse any existing impl blocks that exist at the same level of struct.

Not marking this as closing #1644 since there's a part 2 of adding autocompletion for when someone starts typing `[pub ]fn new(...`

Co-authored-by: Wesley Norris <repnop@outlook.com>
4 years agoMerge #2249
bors[bot] [Fri, 15 Nov 2019 06:27:59 +0000 (06:27 +0000)]
Merge #2249

2249: Cleanup hover r=matklad a=kjeremy

Take advantage of classify_name to consolidate multiple hover paths. This isn't quite as clean as I want it to be (`no_fallback` bool is wonky). There's a relationship between `HoverResult` being empty and the range that is a little warty.

Also I noticed that HoverResults are always marked as exact and have been for quite a while... maybe that should be removed in another PR.

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4 years agoMerge #2246
bors[bot] [Fri, 15 Nov 2019 06:01:26 +0000 (06:01 +0000)]
Merge #2246

2246: Normalize Line Endings r=matklad a=kjeremy

Line endings with git always confuse me so let's be explicit.

In doing this I ran `git add --renormalize .` on my repo per https://help.github.com/en/github/using-git/configuring-git-to-handle-line-endings and it converted a bunch of files. I then backed it all out and ran it again and only this one `Cargo.toml` file changed so I suspect line endings are just weird.

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoCleanup hover
Jeremy Kolb [Fri, 15 Nov 2019 03:48:35 +0000 (22:48 -0500)]
Cleanup hover

Take advantage of classify_name

4 years agoRenormalize line endings
kjeremy [Thu, 14 Nov 2019 22:09:47 +0000 (17:09 -0500)]
Renormalize line endings

4 years agoSet text to autodetect and use LF
kjeremy [Thu, 14 Nov 2019 22:06:44 +0000 (17:06 -0500)]
Set text to autodetect and use LF

4 years agoRemove snapshots since we no long commit them
kjeremy [Thu, 14 Nov 2019 22:30:59 +0000 (17:30 -0500)]
Remove snapshots since we no long commit them

4 years agoMerge #2245
bors[bot] [Thu, 14 Nov 2019 16:48:58 +0000 (16:48 +0000)]
Merge #2245

2245: Even if jemalloc feature is used do not use it on msvc r=matklad a=kjeremy

Fixes #2233

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoEven if jemalloc feature is used do not use it on msvc
kjeremy [Thu, 14 Nov 2019 16:47:18 +0000 (11:47 -0500)]
Even if jemalloc feature is used do not use it on msvc

Fixes #2233

4 years agoMerge #2243
bors[bot] [Thu, 14 Nov 2019 14:38:01 +0000 (14:38 +0000)]
Merge #2243

2243: Move body queries to hir_def r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMove body queries to hir_def
Aleksey Kladov [Thu, 14 Nov 2019 14:37:22 +0000 (17:37 +0300)]
Move body queries to hir_def

4 years agoSimplify parsing
Aleksey Kladov [Thu, 14 Nov 2019 14:36:27 +0000 (17:36 +0300)]
Simplify parsing

4 years agoMerge #2240
bors[bot] [Thu, 14 Nov 2019 08:56:48 +0000 (08:56 +0000)]
Merge #2240

2240: Move scopes to hir_def r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMove scopes to hir_def
Aleksey Kladov [Thu, 14 Nov 2019 08:56:13 +0000 (11:56 +0300)]
Move scopes to hir_def

4 years agoMerge #2238
bors[bot] [Thu, 14 Nov 2019 08:34:26 +0000 (08:34 +0000)]
Merge #2238

2238: Slightly better naming r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoSlightly better naming
Aleksey Kladov [Thu, 14 Nov 2019 08:33:18 +0000 (11:33 +0300)]
Slightly better naming

4 years agoMerge #2237
bors[bot] [Thu, 14 Nov 2019 08:13:20 +0000 (08:13 +0000)]
Merge #2237

2237: Revert #2230 r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRevert #2230
Aleksey Kladov [Thu, 14 Nov 2019 08:11:32 +0000 (11:11 +0300)]
Revert #2230

Looks like autocfg tries to do slightly more than we need (see #2231),
so let's stick with minimal home-grown solution.

4 years agoMerge #2235
bors[bot] [Thu, 14 Nov 2019 07:36:47 +0000 (07:36 +0000)]
Merge #2235

2235: Handle macro-generated expressions slightly less wrong r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoHandle macro-generated expressions slightly less wrong
Aleksey Kladov [Thu, 14 Nov 2019 07:30:30 +0000 (10:30 +0300)]
Handle macro-generated expressions slightly less wrong

4 years agoMove expansion to Expander
Aleksey Kladov [Thu, 14 Nov 2019 07:04:39 +0000 (10:04 +0300)]
Move expansion to Expander

4 years agoMove parse_path to Expander
Aleksey Kladov [Thu, 14 Nov 2019 06:58:39 +0000 (09:58 +0300)]
Move parse_path to Expander

4 years agoExpansion stack scaffold
Aleksey Kladov [Thu, 14 Nov 2019 06:52:03 +0000 (09:52 +0300)]
Expansion stack scaffold

4 years agoAdd Expader::to_source
Aleksey Kladov [Thu, 14 Nov 2019 06:43:59 +0000 (09:43 +0300)]
Add Expader::to_source

4 years agoMove original_file to Expander
Aleksey Kladov [Thu, 14 Nov 2019 06:41:46 +0000 (09:41 +0300)]
Move original_file to Expander

4 years agoRename MacroResolver -> Expander
Aleksey Kladov [Thu, 14 Nov 2019 06:38:25 +0000 (09:38 +0300)]
Rename MacroResolver -> Expander

4 years agoMove current file to MacroResolver
Aleksey Kladov [Thu, 14 Nov 2019 06:37:33 +0000 (09:37 +0300)]
Move current file to MacroResolver

4 years agoReduce visibility
Aleksey Kladov [Thu, 14 Nov 2019 06:24:39 +0000 (09:24 +0300)]
Reduce visibility

4 years agoMerge #2234
bors[bot] [Thu, 14 Nov 2019 06:11:47 +0000 (06:11 +0000)]
Merge #2234

2234: Normalize data r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoNormalize data
Aleksey Kladov [Thu, 14 Nov 2019 06:09:42 +0000 (09:09 +0300)]
Normalize data

No need to store derivable info

4 years agoMerge #2232
bors[bot] [Wed, 13 Nov 2019 20:00:58 +0000 (20:00 +0000)]
Merge #2232

2232: Use anyhow::Result in xtask, add contexts r=matklad a=killercup

This builds on #2231 but was actually done before that. You see, the
cause for #2231 was that I got this error message:

    Error: Error { kind: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" }) }

Just switching to `anyhow::Result` got me stack traces (when setting
`RUST_LIB_BACKTRACE=1`) that at least showed

    stack backtrace:
      0: std::backtrace::Backtrace::create
      1: std::backtrace::Backtrace::capture
      2: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
      3: xtask::install_server
      4: xtask::install
      5: xtask::main
      6: std::rt::lang_start::{{closure}}
      7: std::panicking::try::do_call
      8: __rust_maybe_catch_panic
      9: std::rt::lang_start_internal
      10: std::rt::lang_start
      11: main

With the added contexts (not at all exhaustive), the error became

    Error: install server

    Caused by:
        0: build AutoCfg with target directory
        1: No such file or directory (os error 2)

Since anyhow is such a small thing (no new transitive dependencies!),
and in general gives you `Result<T, Box<dyn Error>>` on steroids, I
think this a nice small change. The only slightly annoying thing was to
replace all the `Err(format!(…))?` calls (haven't even looked at whether
we can make it support wrapping strings though), but the `bail!` macro
is shorter anyway :)

Co-authored-by: Pascal Hertleif <pascal@technocreatives.com>
4 years agoUse anyhow::Result in xtask, add contexts
Pascal Hertleif [Wed, 13 Nov 2019 19:51:57 +0000 (20:51 +0100)]
Use anyhow::Result in xtask, add contexts

This builds on #2231 but was actually done before that. You see, the
cause for #2231 was that I got this error message:

    Error: Error { kind: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" }) }

Just switching to `anyhow::Result` got me stack traces (when setting
`RUST_LIB_BACKTRACE=1`) that at least showed

    stack backtrace:
      0: std::backtrace::Backtrace::create
      1: std::backtrace::Backtrace::capture
      2: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
      3: xtask::install_server
      4: xtask::install
      5: xtask::main
      6: std::rt::lang_start::{{closure}}
      7: std::panicking::try::do_call
      8: __rust_maybe_catch_panic
      9: std::rt::lang_start_internal
      10: std::rt::lang_start
      11: main

With the added contexts (not at all exhaustive), the error became

    Error: install server

    Caused by:
        0: build AutoCfg with target directory
        1: No such file or directory (os error 2)

Since anyhow is such a small thing (no new transitive dependencies!),
and in general gives you `Result<T, Box<dyn Error>>` on steroids, I
think this a nice small change. The only slightly annoying thing was to
replace all the `Err(format!(…))?` calls (haven't even looked at whether
we can make it support wrapping strings though), but the `bail!` macro
is shorter anyway :)

4 years agoMerge #2231
bors[bot] [Wed, 13 Nov 2019 19:50:29 +0000 (19:50 +0000)]
Merge #2231

2231: Allow usage of CARGO_TARGET_DIR env var r=matklad a=killercup

Co-authored-by: Pascal Hertleif <pascal@technocreatives.com>
4 years agoAllow usage of CARGO_TARGET_DIR env var
Pascal Hertleif [Wed, 13 Nov 2019 19:44:39 +0000 (20:44 +0100)]
Allow usage of CARGO_TARGET_DIR env var

4 years agoMerge #2230
bors[bot] [Wed, 13 Nov 2019 16:42:50 +0000 (16:42 +0000)]
Merge #2230

2230: Use autocfg to determine rust version r=matklad a=kjeremy

Fixes #2229

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoUse autocfg to determine rust version
kjeremy [Wed, 13 Nov 2019 16:19:07 +0000 (11:19 -0500)]
Use autocfg to determine rust version

4 years agoMerge #2228
bors[bot] [Wed, 13 Nov 2019 13:30:50 +0000 (13:30 +0000)]
Merge #2228

2228: Update Crates r=matklad a=kjeremy

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4 years agoUpdate Crates
Jeremy Kolb [Wed, 13 Nov 2019 13:25:37 +0000 (08:25 -0500)]
Update Crates

4 years agoMerge #2226
bors[bot] [Wed, 13 Nov 2019 08:59:48 +0000 (08:59 +0000)]
Merge #2226

2226: Use strongly-typed ast building for early-return assist r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMake make:: builders slightly more convenient
Aleksey Kladov [Wed, 13 Nov 2019 08:55:43 +0000 (11:55 +0300)]
Make make:: builders slightly more convenient

4 years agoUse strongly-typed ast building for early-return assist
Aleksey Kladov [Wed, 13 Nov 2019 08:40:51 +0000 (11:40 +0300)]
Use strongly-typed ast building for early-return assist

4 years agoAdd a bit of types
Aleksey Kladov [Wed, 13 Nov 2019 07:54:50 +0000 (10:54 +0300)]
Add a bit of types

4 years agoMinor cleanup
Aleksey Kladov [Wed, 13 Nov 2019 07:27:21 +0000 (10:27 +0300)]
Minor cleanup

4 years agoMerge #2225
bors[bot] [Wed, 13 Nov 2019 06:57:13 +0000 (06:57 +0000)]
Merge #2225

2225: Reduce duplication between uncertain floats & ints r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoReduce duplication between uncertain floats & ints
Aleksey Kladov [Wed, 13 Nov 2019 06:56:33 +0000 (09:56 +0300)]
Reduce duplication between uncertain floats & ints

4 years agoMerge #2223
bors[bot] [Tue, 12 Nov 2019 15:53:55 +0000 (15:53 +0000)]
Merge #2223

2223: Move expression lowering to hir_def r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoAdd helpful pointer to module docs
Aleksey Kladov [Tue, 12 Nov 2019 15:53:26 +0000 (18:53 +0300)]
Add helpful pointer to module docs

4 years agoDrop obsolete comment
Aleksey Kladov [Tue, 12 Nov 2019 15:51:37 +0000 (18:51 +0300)]
Drop obsolete comment

4 years agoMove expression lowering to hir_def
Aleksey Kladov [Tue, 12 Nov 2019 15:46:57 +0000 (18:46 +0300)]
Move expression lowering to hir_def

4 years agoMerge #2217
bors[bot] [Tue, 12 Nov 2019 15:30:36 +0000 (15:30 +0000)]
Merge #2217

2217: Implement FromStr for enum Edition r=matklad a=clemarescx

Just did this as I came across the comment in the code asking for implementing `std::str::FromStr` for `input::Edition`.
Not sure what was meant by "proper error handling" though, `panic!` with a descriptive message might not be it :sweat_smile:

Co-authored-by: Metabaron <metabaron@tuta.io>
4 years agoMerge #2222
bors[bot] [Tue, 12 Nov 2019 13:52:30 +0000 (13:52 +0000)]
Merge #2222

2222: Remove owner from Body r=matklad a=matklad

cc @flodiebold

I do this so that it's easier to move lowering code to another crate (owner is the only thing that tethers Body to the rest of the code), but it's interesting that this is a net reduction of lines. I think this might be considered an evidence that it's a good idea to not add "parent pointers" / parent ids to data structures, and instead add them to `ctx` objects which are used when building data structures

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRemove owner from Body
Aleksey Kladov [Tue, 12 Nov 2019 13:46:27 +0000 (16:46 +0300)]
Remove owner from Body

4 years agoMerge #2221
bors[bot] [Tue, 12 Nov 2019 12:41:55 +0000 (12:41 +0000)]
Merge #2221

2221: Disallow regressing crate docs r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDisallow regressing crate docs
Aleksey Kladov [Tue, 12 Nov 2019 12:41:02 +0000 (15:41 +0300)]
Disallow regressing crate docs

4 years agoMove definition of exprs to hir_def
Aleksey Kladov [Tue, 12 Nov 2019 12:09:25 +0000 (15:09 +0300)]
Move definition of exprs to hir_def

4 years agoFix unused import
Metabaron [Tue, 12 Nov 2019 10:59:25 +0000 (11:59 +0100)]
Fix unused import

4 years agoreturn Error instead of panicking in from_cargo_metadata
Metabaron [Tue, 12 Nov 2019 10:53:31 +0000 (11:53 +0100)]
return Error instead of panicking in from_cargo_metadata

4 years agoImplement FromStr for enum Edition
Metabaron [Mon, 11 Nov 2019 22:16:59 +0000 (23:16 +0100)]
Implement FromStr for enum Edition

4 years agoMinor refactoring
Aleksey Kladov [Tue, 12 Nov 2019 09:07:47 +0000 (12:07 +0300)]
Minor refactoring

4 years agoMinor cleanup
Aleksey Kladov [Tue, 12 Nov 2019 08:48:34 +0000 (11:48 +0300)]
Minor cleanup

4 years agoMerge #2216
bors[bot] [Tue, 12 Nov 2019 05:37:15 +0000 (05:37 +0000)]
Merge #2216

2216: Implement postfix completions feature flag r=matklad a=chmln

Resolves #2186

Co-authored-by: Greg <gregory.mkv@gmail.com>
4 years agofix typo
Greg [Tue, 12 Nov 2019 03:56:39 +0000 (22:56 -0500)]
fix typo

4 years agoImplement postfix completions feature flag
Greg [Tue, 12 Nov 2019 03:55:10 +0000 (22:55 -0500)]
Implement postfix completions feature flag

4 years agoMerge #2214
bors[bot] [Mon, 11 Nov 2019 20:00:14 +0000 (20:00 +0000)]
Merge #2214

2214: Fix snap missing node path r=matklad a=mkucijan

#2045

Co-authored-by: mkucijan <mkucijan@gmail.com>
4 years agoAdd '--scripts-prepend-node-pat' to npm run package
mkucijan [Mon, 11 Nov 2019 19:51:07 +0000 (20:51 +0100)]
Add '--scripts-prepend-node-pat' to npm run package

4 years agoMerge #2213
bors[bot] [Mon, 11 Nov 2019 16:21:55 +0000 (16:21 +0000)]
Merge #2213

2213: Hir generic param r=flodiebold a=matklad

r? @flodiebold

This should make the life of IDE easier: before, it got `GenericParam(u32)` which was of questionable utility. Now, it's a proper code_model type, so it can gain `source`, `name`, `module` and all the other hir methods, should the IDE need them. Moreover, IDE now doesn't care about internal representation of generic param, which seems like a long-term win.

The problem is, of course, that we now have to types named `GenericParam` in hir: this code_model type, and an internal type with an index which doesn't know about the parent. I think it's fine for the time being, but, after we finish cratefication of hir, this local `GenericParam` should move to `hir_def` or `hir_ty`, and *maybe* restrucured as `ParamId / PramData` pair.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoIntroduce hir::GenericParam
Aleksey Kladov [Mon, 11 Nov 2019 14:36:27 +0000 (17:36 +0300)]
Introduce hir::GenericParam

Unlike existing hir::GenericParams, this is a global ID.

4 years agoDon't reexport generics from HIR
Aleksey Kladov [Mon, 11 Nov 2019 14:22:06 +0000 (17:22 +0300)]
Don't reexport generics from HIR

4 years agoMerge #2200
bors[bot] [Mon, 11 Nov 2019 11:48:02 +0000 (11:48 +0000)]
Merge #2200

2200: Add variables to HIR r=matklad a=matklad

Introduce a `hir::Variable`, which should cover locals, parameters and `self`. Unlike `PatId`, variable knows it's owner so it is self-contained, and should be more convenient to use from `ra_ide_api`.

The goal here is to hide more details about `Body` from hir, which should make it easier to move `Body` into `hir_def`. I don't think that `ra_ide_api` intrracts with bodies directly at the moment anyway, but the glue layer is based basically on `ast::BindPat`, which seems pretty brittle.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoAdd hir::Local
Aleksey Kladov [Sat, 9 Nov 2019 21:32:00 +0000 (00:32 +0300)]
Add hir::Local

4 years agoMerge #2205
bors[bot] [Mon, 11 Nov 2019 10:53:24 +0000 (10:53 +0000)]
Merge #2205

2205: Implement bulitin line! macro r=matklad a=edwin0cheng

This PR implements bulitin macro `line!` and add basic infra-structure for other bulitin macros:

1. Extend `MacroDefId` to support builtin macros
2. Add a `quote!` macro for simple quasi quoting.

Note that for support others builtin macros, eager macro expansion have to be supported first, this PR not try to handle it. :)

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoAdd MacroDefKind
Edwin Cheng [Mon, 11 Nov 2019 10:45:55 +0000 (18:45 +0800)]
Add MacroDefKind

4 years agoMerge #2211
bors[bot] [Mon, 11 Nov 2019 09:52:56 +0000 (09:52 +0000)]
Merge #2211

2211: Refactor highlighting to use classify_name r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRefactor highlighting to use classify_name
Aleksey Kladov [Mon, 11 Nov 2019 09:52:14 +0000 (12:52 +0300)]
Refactor highlighting to use classify_name

4 years agoMerge #2210
bors[bot] [Mon, 11 Nov 2019 09:20:20 +0000 (09:20 +0000)]
Merge #2210

2210: Introduce ToNav trait r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoIntroduce ToNav trait
Aleksey Kladov [Mon, 11 Nov 2019 08:15:19 +0000 (11:15 +0300)]
Introduce ToNav trait

4 years agoMerge #2209
bors[bot] [Mon, 11 Nov 2019 09:00:27 +0000 (09:00 +0000)]
Merge #2209

2209: impl fmt::Display for BuiltinType r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoimpl fmt::Display for BuiltinType
Aleksey Kladov [Mon, 11 Nov 2019 08:59:19 +0000 (11:59 +0300)]
impl fmt::Display for BuiltinType

4 years agoMerge #2203
bors[bot] [Mon, 11 Nov 2019 08:41:54 +0000 (08:41 +0000)]
Merge #2203

2203: Hover for builtins r=matklad a=kjeremy

Fixes #2192

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4 years agoMerge #2207
bors[bot] [Mon, 11 Nov 2019 08:27:38 +0000 (08:27 +0000)]
Merge #2207

2207: Forbid visibility qualifiers in traits r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>