]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoMerge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into find...
nmio [Tue, 25 Feb 2020 18:01:59 +0000 (18:01 +0000)]
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into find-cargo-toml-up-the-fs

4 years agoMerge #3305
bors[bot] [Tue, 25 Feb 2020 13:59:44 +0000 (13:59 +0000)]
Merge #3305

3305: Simplify r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoSimplify
Aleksey Kladov [Tue, 25 Feb 2020 13:59:13 +0000 (14:59 +0100)]
Simplify

4 years agoMerge #3304
bors[bot] [Tue, 25 Feb 2020 13:45:15 +0000 (13:45 +0000)]
Merge #3304

3304: :arrow_up: rowan r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years ago:arrow_up: rowan
Aleksey Kladov [Tue, 25 Feb 2020 13:44:51 +0000 (14:44 +0100)]
:arrow_up: rowan

4 years agoMerge #3303
bors[bot] [Tue, 25 Feb 2020 12:51:36 +0000 (12:51 +0000)]
Merge #3303

3303: Simplify r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoSimplify
Aleksey Kladov [Tue, 25 Feb 2020 12:49:34 +0000 (13:49 +0100)]
Simplify

4 years agoMerge #3298
bors[bot] [Tue, 25 Feb 2020 11:59:47 +0000 (11:59 +0000)]
Merge #3298

3298: Bump chalk and replace TypeFamily with Interner r=flodiebold a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
4 years agoMerge #3302
bors[bot] [Tue, 25 Feb 2020 11:44:00 +0000 (11:44 +0000)]
Merge #3302

3302: Replace generic with a concrete type r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoReplace generic with a concrete type
Aleksey Kladov [Tue, 25 Feb 2020 11:42:44 +0000 (12:42 +0100)]
Replace generic with a concrete type

4 years agoMerge #3295
bors[bot] [Tue, 25 Feb 2020 10:09:14 +0000 (10:09 +0000)]
Merge #3295

3295: Refactoring fetchArtifactReleaseInfo() r=matklad a=Veetaha

https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md

I fact this rule doesn't work when you put an unnecessary non-null assertion in an expression (as we had `(awat f())!`, but it is useful in other cases...

Closes #3295, i guess...

Co-authored-by: Veetaha <gerzoh1@gmail.com>
4 years agoMerge #3159
bors[bot] [Tue, 25 Feb 2020 10:02:21 +0000 (10:02 +0000)]
Merge #3159

3159: Server-side Semantic Tokens r=matklad a=kjeremy

Takes the output of `syntax_highlighting` and converts it to the proposed semantic tokens API (so far only `textDocument/semanticTokens`. There's a lot of cool stuff we could do with this and the "Inspect Editor Tokens and Scopes" vscode command (pic below) is a cool way to see what has tokens and what doesn't.

Incredibly hacky and could panic due to unwraps, `panic!` etc. To use: run with `code-insiders --enable-proposed-api matklad.rust-analyzer`. If you try to run this without `--enable-proposed-api` it will crash.

![image](https://user-images.githubusercontent.com/4325700/74595603-7c66cf00-5011-11ea-9593-312663f04fc1.png)

@matklad I'm mostly looking for design feedback.

Co-authored-by: kjeremy <kjeremy@gmail.com>
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4 years agoMerge #3299
bors[bot] [Tue, 25 Feb 2020 09:55:56 +0000 (09:55 +0000)]
Merge #3299

3299: vscode: migrate to request type api r=matklad a=Veetaha

More type-safety to the god of type-safety.

Co-authored-by: Veetaha <gerzoh1@gmail.com>
4 years agoAdd docs
Jeremy Kolb [Tue, 25 Feb 2020 02:17:20 +0000 (21:17 -0500)]
Add docs

4 years agoTeach the server about Semantic Tokens proposed LSP
kjeremy [Fri, 14 Feb 2020 22:56:28 +0000 (17:56 -0500)]
Teach the server about Semantic Tokens proposed LSP

4 years agovscode: wrap non-single-line if body with curlies as per matklad
Veetaha [Mon, 24 Feb 2020 23:58:43 +0000 (01:58 +0200)]
vscode: wrap non-single-line if body with curlies as per matklad

4 years agovscode: migrate rust-analyzer-api to import * as lc as per matklad and kjeremy
Veetaha [Mon, 24 Feb 2020 23:43:52 +0000 (01:43 +0200)]
vscode: migrate rust-analyzer-api to import * as lc as per matklad and kjeremy

4 years agoMerge #3296
bors[bot] [Mon, 24 Feb 2020 23:09:19 +0000 (23:09 +0000)]
Merge #3296

3296: vscode: bump TypeScript version r=matklad a=Veetaha

There is a new [`type-only` import and export feature](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#-type-only-imports-and-export), but let's keep our codebase as simple as it is now.
Also, top-level await :tada:, though with a caveat ))

![image](https://user-images.githubusercontent.com/36276403/75185341-93629b00-574e-11ea-8d5c-4a4293f140f7.png)

Co-authored-by: Veetaha <gerzoh1@gmail.com>
4 years agovscode: run fmt
Veetaha [Mon, 24 Feb 2020 23:00:00 +0000 (01:00 +0200)]
vscode: run fmt

4 years agovscode: migrate inlay_hints to rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:57:49 +0000 (00:57 +0200)]
vscode: migrate inlay_hints to rust-analyzer-api.ts

4 years agovscode: migrate syntax_tree to rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:57:14 +0000 (00:57 +0200)]
vscode: migrate syntax_tree to rust-analyzer-api.ts

4 years agovscode: migrate ssr to rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:56:57 +0000 (00:56 +0200)]
vscode: migrate ssr to rust-analyzer-api.ts

4 years agovscode: migrate runnables to rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:56:38 +0000 (00:56 +0200)]
vscode: migrate runnables to rust-analyzer-api.ts

4 years agovscode: migrate parent_module to rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:56:19 +0000 (00:56 +0200)]
vscode: migrate parent_module to rust-analyzer-api.ts

4 years agovscode: migrate on_enter to rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:55:48 +0000 (00:55 +0200)]
vscode: migrate on_enter to rust-analyzer-api.ts

4 years agovscode: migrate matching_brace to rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:55:13 +0000 (00:55 +0200)]
vscode: migrate matching_brace to rust-analyzer-api.ts

4 years agovscode: migrate join_lines to rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:54:50 +0000 (00:54 +0200)]
vscode: migrate join_lines to rust-analyzer-api.ts

4 years agovscode: migrate collectGarbage to rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:50:57 +0000 (00:50 +0200)]
vscode: migrate collectGarbage to rust-analyzer-api.ts

4 years agovscode: migrate expand_macro to rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:50:36 +0000 (00:50 +0200)]
vscode: migrate expand_macro to rust-analyzer-api.ts

4 years agovscode: migrate analyzer_status to rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:50:14 +0000 (00:50 +0200)]
vscode: migrate analyzer_status to rust-analyzer-api.ts

4 years agovscode: migrate highlighting to rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:49:54 +0000 (00:49 +0200)]
vscode: migrate highlighting to rust-analyzer-api.ts

4 years agovscode: migrate source_cnage.rs to rust-analyzer-api.rs
Veetaha [Mon, 24 Feb 2020 22:49:19 +0000 (00:49 +0200)]
vscode: migrate source_cnage.rs to rust-analyzer-api.rs

4 years agovscode: create rust-analyzer-api.ts
Veetaha [Mon, 24 Feb 2020 22:48:44 +0000 (00:48 +0200)]
vscode: create rust-analyzer-api.ts

4 years agoBump chalk and replace TypeFamily with Interner
Laurențiu Nicola [Mon, 24 Feb 2020 20:36:57 +0000 (22:36 +0200)]
Bump chalk and replace TypeFamily with Interner

4 years agovscode: bump TypeScript version
Veetaha [Mon, 24 Feb 2020 19:37:53 +0000 (21:37 +0200)]
vscode: bump TypeScript version

4 years agovscode: remove type assertion
Veetaha [Mon, 24 Feb 2020 19:23:48 +0000 (21:23 +0200)]
vscode: remove type assertion

4 years agoadd error handling to fetchArtifactReleaseInfo(), throw Error when no artifact found
Veetaha [Mon, 24 Feb 2020 19:13:10 +0000 (21:13 +0200)]
add error handling to fetchArtifactReleaseInfo(), throw Error when no artifact found

4 years agoInitial debugging code
nmio [Mon, 24 Feb 2020 16:38:59 +0000 (16:38 +0000)]
Initial debugging code

4 years agoMerge #3294
bors[bot] [Mon, 24 Feb 2020 16:18:12 +0000 (16:18 +0000)]
Merge #3294

3294: When joining lines, unwrap trivial diverging blocks r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoWhen joining lines, unwrap trivial diverging blocks
Aleksey Kladov [Mon, 24 Feb 2020 16:17:05 +0000 (17:17 +0100)]
When joining lines, unwrap trivial diverging blocks

4 years agoMerge #3293
bors[bot] [Mon, 24 Feb 2020 14:41:37 +0000 (14:41 +0000)]
Merge #3293

3293: Cleanp r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoCleanp
Aleksey Kladov [Mon, 24 Feb 2020 14:41:13 +0000 (15:41 +0100)]
Cleanp

4 years agoMerge #3291
bors[bot] [Mon, 24 Feb 2020 12:59:56 +0000 (12:59 +0000)]
Merge #3291

3291: Update deps r=kjeremy a=kjeremy

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4 years agoUpdate deps
Jeremy Kolb [Mon, 24 Feb 2020 12:58:54 +0000 (07:58 -0500)]
Update deps

4 years agoMerge #3290
bors[bot] [Mon, 24 Feb 2020 11:48:15 +0000 (11:48 +0000)]
Merge #3290

3290: Don't block onEnter if request fails r=matklad a=matklad

closes #3286

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDon't block onEnter if request fails
Aleksey Kladov [Mon, 24 Feb 2020 11:45:34 +0000 (12:45 +0100)]
Don't block onEnter if request fails

closes #3286

4 years agoMerge #3288
bors[bot] [Mon, 24 Feb 2020 11:40:06 +0000 (11:40 +0000)]
Merge #3288

3288: Quick fix circular json error when sanity-check fails r=matklad a=Veetaha

Related issue: #3280

Co-authored-by: Veetaha <gerzoh1@gmail.com>
4 years agoMerge #3289
bors[bot] [Mon, 24 Feb 2020 11:33:00 +0000 (11:33 +0000)]
Merge #3289

3289: Don't break onEnter if rust-analyzer fails to start r=matklad a=matklad

closes #3253

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDon't break onEnter if rust-analyzer fails to start
Aleksey Kladov [Mon, 24 Feb 2020 11:32:15 +0000 (12:32 +0100)]
Don't break onEnter if rust-analyzer fails to start

closes #3253

4 years agoQuick fix circular json error when sanity-check fails
Veetaha [Mon, 24 Feb 2020 09:56:52 +0000 (11:56 +0200)]
Quick fix circular json error when sanity-check fails

Related issue: #3280

4 years agoMerge #3287
bors[bot] [Mon, 24 Feb 2020 08:46:07 +0000 (08:46 +0000)]
Merge #3287

3287: Omit type hints for enum variant bind pats r=matklad a=SomeoneToIgnore

After using new hints for a while, I've started to think that hints for enum variants are an overkill.
Another user also shares the same toughts: https://github.com/rust-analyzer/rust-analyzer/issues/3273#issuecomment-590172297

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
4 years agoOmit type hints for enum variant bind pats
Kirill Bulatov [Mon, 24 Feb 2020 07:29:34 +0000 (10:29 +0300)]
Omit type hints for enum variant bind pats

4 years agoMerge #3277
bors[bot] [Sun, 23 Feb 2020 15:26:20 +0000 (15:26 +0000)]
Merge #3277

3277: vscode: gracefully handle cancellation errors r=matklad a=Veetaha

This PR fixes a fleet of errors that rapidly populate the Developer Tools console.
![image](https://user-images.githubusercontent.com/36276403/75097665-0c7aba80-55b6-11ea-8edd-ab5dc5f89e1e.png)

Co-authored-by: Veetaha <gerzoh1@gmail.com>
4 years agoMerge #3282
bors[bot] [Sun, 23 Feb 2020 15:17:08 +0000 (15:17 +0000)]
Merge #3282

3282: Add suggestion for failed path resolution r=matklad a=yoshuawuyts

This adds https://github.com/rust-analyzer/rust-analyzer/issues/3245 as an inline help text for when path resolution fails. I saw this error, but also `"Failed to read Cargo metadata from Cargo.toml file"` several times while trying to debug what was failing.

There's probably a more structured way of displaying help texts in VS Code popups. But this would've saved me 20 mins of debugging when installing `rust-analyzer` under WSL today. Thanks!

Co-authored-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
4 years agoAdd suggestion for failed path resolution
Yoshua Wuyts [Sun, 23 Feb 2020 14:51:32 +0000 (15:51 +0100)]
Add suggestion for failed path resolution

This adds https://github.com/rust-analyzer/rust-analyzer/issues/3245 as an inline help text for when path resolution fails.

4 years agovscode: gracefully handle cancellation errors
Veetaha [Sat, 22 Feb 2020 18:58:00 +0000 (20:58 +0200)]
vscode: gracefully handle cancellation errors

4 years agoMerge #3279
bors[bot] [Sun, 23 Feb 2020 10:09:35 +0000 (10:09 +0000)]
Merge #3279

3279: Add basic parameter name hints heuristics r=matklad a=SomeoneToIgnore

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
4 years agoMerge #3261
bors[bot] [Sun, 23 Feb 2020 10:02:08 +0000 (10:02 +0000)]
Merge #3261

3261: Extract client-side logging r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoStyle fixes
Kirill Bulatov [Sun, 23 Feb 2020 10:02:00 +0000 (13:02 +0300)]
Style fixes

4 years agoAdd basic parameter name hints heuristics
Kirill Bulatov [Sun, 23 Feb 2020 09:49:53 +0000 (12:49 +0300)]
Add basic parameter name hints heuristics

4 years agoMerge #3275
bors[bot] [Sun, 23 Feb 2020 09:49:26 +0000 (09:49 +0000)]
Merge #3275

3275: Add Structural Search and Replace doc r=matklad a=adamrk

Addresses the first point of https://github.com/rust-analyzer/rust-analyzer/issues/3186.

Co-authored-by: adamrk <ark.email@gmail.com>
Co-authored-by: Adam Bratschi-Kaye <ark.email@gmail.com>
4 years agoMerge #3278
bors[bot] [Sun, 23 Feb 2020 09:25:40 +0000 (09:25 +0000)]
Merge #3278

3278: Show more inlay hints r=matklad a=SomeoneToIgnore

Closes https://github.com/rust-analyzer/rust-analyzer/issues/3273

As suggested in https://github.com/rust-analyzer/rust-analyzer/pull/1606#discussion_r308146363 , there is a simpler way to handle inlay hints after https://github.com/rust-analyzer/rust-analyzer/issues/1618 is closed.

This PR uses the approach suggested (which results in more type hints for various bindings) and also adds more name hints for function parameters.

Examples can be found in the issue:
* https://github.com/rust-analyzer/rust-analyzer/issues/3273#issuecomment-589998051
* https://github.com/rust-analyzer/rust-analyzer/issues/3273#issuecomment-590002839

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
4 years agoFix the tests
Kirill Bulatov [Sat, 22 Feb 2020 22:23:33 +0000 (01:23 +0300)]
Fix the tests

4 years agoShow more parameter name hints
Kirill Bulatov [Sat, 22 Feb 2020 22:09:48 +0000 (01:09 +0300)]
Show more parameter name hints

4 years agoSimplify inlay hints processing
Kirill Bulatov [Sat, 22 Feb 2020 20:07:09 +0000 (23:07 +0300)]
Simplify inlay hints processing

4 years agoMerge #3276
bors[bot] [Sat, 22 Feb 2020 21:23:06 +0000 (21:23 +0000)]
Merge #3276

3276: Bump crossbeam crates r=kjeremy a=lnicola

This removes a duplicate `autocfg` dependency and was supposed to upgrade `rand`, but it got reverted in `crossbeam` to keep it compiling on pre-2018 edition compilers.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
4 years agorewording and typo fix
Adam Bratschi-Kaye [Sat, 22 Feb 2020 17:07:43 +0000 (18:07 +0100)]
rewording and typo fix

Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
4 years agoBump crossbeam crates
Laurențiu Nicola [Sat, 22 Feb 2020 16:22:09 +0000 (18:22 +0200)]
Bump crossbeam crates

4 years agoadd ssr doc
adamrk [Sat, 22 Feb 2020 15:45:04 +0000 (16:45 +0100)]
add ssr doc

4 years agoMerge #3274
bors[bot] [Sat, 22 Feb 2020 15:59:58 +0000 (15:59 +0000)]
Merge #3274

3274: Simplify r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoSimplify
Aleksey Kladov [Sat, 22 Feb 2020 15:57:29 +0000 (16:57 +0100)]
Simplify

4 years agoMerge #3272
bors[bot] [Sat, 22 Feb 2020 15:07:36 +0000 (15:07 +0000)]
Merge #3272

3272: ra_db: removed a couple of explicit lifetimes r=matklad a=Veetaha

Co-authored-by: Veetaha <gerzoh1@gmail.com>
4 years agoExtract client-side logging
Aleksey Kladov [Fri, 21 Feb 2020 14:59:46 +0000 (15:59 +0100)]
Extract client-side logging

4 years agora_db: removed a couple of explicit lifetimes
Veetaha [Sat, 22 Feb 2020 15:00:39 +0000 (17:00 +0200)]
ra_db: removed a couple of explicit lifetimes

4 years agoMerge #3263
bors[bot] [Sat, 22 Feb 2020 12:31:30 +0000 (12:31 +0000)]
Merge #3263

3263: Implement unsizing coercions using Chalk r=matklad a=flodiebold

These are coercions like `&[T; n] -> &[T]`, which are handled by the `Unsize` and `CoerceUnsized` traits. The impls for `Unsize` are all built in to the compiler and require special handling, so we need to provide them to Chalk.

This adds the following `Unsize` impls:
 - `Unsize<[T]> for [T; _]`
 - `Unsize<dyn Trait> for T where T: Trait`
 - `Unsize<dyn SuperTrait> for dyn SubTrait`

Hence we are still missing the 'unsizing the last field of a generic struct' case.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoMerge #3271
bors[bot] [Sat, 22 Feb 2020 12:24:58 +0000 (12:24 +0000)]
Merge #3271

3271: Fix dat comment r=matklad a=Veetaha

Co-authored-by: Veetaha <veetaha2@gmail.com>
4 years agoFix dat comment
Veetaha [Sat, 22 Feb 2020 12:16:13 +0000 (14:16 +0200)]
Fix dat comment

4 years agoShorten some code
Florian Diebold [Sat, 22 Feb 2020 12:15:54 +0000 (13:15 +0100)]
Shorten some code

4 years agoRework find_super_trait_path to protect against cycles
Florian Diebold [Sat, 22 Feb 2020 12:14:39 +0000 (13:14 +0100)]
Rework find_super_trait_path to protect against cycles

4 years agoMerge #3205
bors[bot] [Sat, 22 Feb 2020 12:01:27 +0000 (12:01 +0000)]
Merge #3205

3205: vscode: migrate to tripple equals r=matklad a=Veetaha

Co-authored-by: Veetaha <gerzoh1@gmail.com>
4 years agoMerge #3269
bors[bot] [Sat, 22 Feb 2020 11:50:36 +0000 (11:50 +0000)]
Merge #3269

3269: Add inlay hints documentation r=flodiebold a=SomeoneToIgnore

Closes https://github.com/rust-analyzer/rust-analyzer/issues/3267

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
4 years agovscode: migrate to tripple equals
Veetaha [Mon, 17 Feb 2020 20:35:37 +0000 (22:35 +0200)]
vscode: migrate to tripple equals

4 years agoFix a typo
Kirill Bulatov [Sat, 22 Feb 2020 11:35:48 +0000 (14:35 +0300)]
Fix a typo

4 years agoMerge #3260
bors[bot] [Sat, 22 Feb 2020 11:25:09 +0000 (11:25 +0000)]
Merge #3260

3260: Refactor how builtins are resolved r=matklad a=flodiebold

This fixes autocompletion suggesting e.g. `self::usize`. (I thought we had a bug for that, but I didn't find it.)

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
4 years agoMerge #3230
bors[bot] [Sat, 22 Feb 2020 11:17:23 +0000 (11:17 +0000)]
Merge #3230

3230: ra_mbe: convert_literal now works with malformed tokens r=edwin0cheng a=Veetaha

Fixes: #3226
Co-authored-by: Veetaha <gerzoh1@gmail.com>
Co-authored-by: Veetaha <veetaha2@gmail.com>
4 years agora_mbe: Remove explicit type annotation
Veetaha [Sat, 22 Feb 2020 11:14:46 +0000 (13:14 +0200)]
ra_mbe: Remove explicit type annotation

4 years agora_mbe: added test for malformed token in macro invokation
Veetaha [Thu, 20 Feb 2020 21:42:24 +0000 (23:42 +0200)]
ra_mbe: added test for malformed token in macro invokation

There was a panic where lexer returned None on malformed tokens.
But now we just ignore tokenization errors in mbe.

4 years agora_mbe: convert_literal now works with malformed tokens
Veetaha [Wed, 19 Feb 2020 07:49:26 +0000 (09:49 +0200)]
ra_mbe: convert_literal now works with malformed tokens

4 years agoOne more tiny doc fix
Kirill Bulatov [Sat, 22 Feb 2020 10:52:49 +0000 (13:52 +0300)]
One more tiny doc fix

4 years agoCode review fixes
Kirill Bulatov [Sat, 22 Feb 2020 10:51:08 +0000 (12:51 +0200)]
Code review fixes

Co-Authored-By: Florian Diebold <flodiebold@googlemail.com>
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
4 years agoFix shift_bound_vars
Florian Diebold [Fri, 21 Feb 2020 22:07:29 +0000 (23:07 +0100)]
Fix shift_bound_vars

It should only shift free vars (maybe the name isn't the best...)

4 years agoFix wrong handling of bare `dyn Trait` exposed by canonicalizer fix
Florian Diebold [Fri, 21 Feb 2020 22:06:18 +0000 (23:06 +0100)]
Fix wrong handling of bare `dyn Trait` exposed by canonicalizer fix

The self type in the `dyn Trait` trait ref should always be ^0, but we didn't
put that in there in the bare case.

4 years agoAdd &dyn Trait -> &dyn SuperTrait coercion, and fix &T -> &dyn Trait
Florian Diebold [Fri, 21 Feb 2020 20:49:02 +0000 (21:49 +0100)]
Add &dyn Trait -> &dyn SuperTrait coercion, and fix &T -> &dyn Trait

4 years agoFix handling of binders in canonicalization
Florian Diebold [Fri, 21 Feb 2020 20:46:21 +0000 (21:46 +0100)]
Fix handling of binders in canonicalization

I'm looking forward to getting rid of this in favor of Chalk's implementation.

4 years agoImplement dyn Trait unsizing as well
Florian Diebold [Fri, 21 Feb 2020 18:05:27 +0000 (19:05 +0100)]
Implement dyn Trait unsizing as well

4 years agoImplement unsize coercion using proper trait solving
Florian Diebold [Fri, 21 Feb 2020 17:24:18 +0000 (18:24 +0100)]
Implement unsize coercion using proper trait solving

4 years agoAdd inlay hints documentation
Kirill Bulatov [Sat, 22 Feb 2020 07:23:03 +0000 (10:23 +0300)]
Add inlay hints documentation

4 years agoMerge #3262
bors[bot] [Sat, 22 Feb 2020 00:27:09 +0000 (00:27 +0000)]
Merge #3262

3262: Fix handling of const patterns r=matklad a=flodiebold

E.g. in `match x { None => ... }`, `None` is a path pattern (resolving to the
option variant), not a binding. To determine this, we need to try to resolve the
name during lowering. This isn't too hard since we already need to resolve names
for macro expansion anyway (though maybe a bit hacky).

Fixes #1618.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
4 years agoMerge #3244
bors[bot] [Sat, 22 Feb 2020 00:19:28 +0000 (00:19 +0000)]
Merge #3244

3244: Rename module references r=matklad a=adamrk

Rename references to a module when the module is renamed. This fixes some missing renames in the existing implementation. For example, renaming the module `foo` to `foo2` in this case:
```rust
mod foo {
    pub fn bar() {}
}

fn main() {
    foo::bar()
}
```
previously would not change the call `foo::bar()` to `foo2::bar()`, but now it will.

Co-authored-by: adamrk <ark.email@gmail.com>
Co-authored-by: Adam Bratschi-Kaye <ark.email@gmail.com>
4 years agoremove unneeded `collect`
adamrk [Thu, 20 Feb 2020 09:34:22 +0000 (10:34 +0100)]
remove unneeded `collect`