Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

processing attribute #[path] of module #1499

Merged
merged 3 commits into from Jul 7, 2019

Conversation

ava57r
Copy link
Contributor

@ava57r ava57r commented Jul 6, 2019

support two cases

  • simple name file foo.rs
  • declaration in mod.rs

#1211

@ava57r ava57r changed the title Feature/resolve path attr mod processing attribute #[path] of module Jul 6, 2019
@marcogroppo
Copy link
Contributor

Awesome! In theory this should enable completions for f32 and f64

@@ -364,6 +364,101 @@ fn module_resolution_works_for_raw_modules() {
"###);
}

#[test]
fn module_resolution_decl_path() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets move these and other tests that target specifically how mods are resoved into a new nameres/tests/mods.rs submodule?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, of course

@matklad
Copy link
Member

matklad commented Jul 7, 2019

bors r+

Thanks!

bors bot added a commit that referenced this pull request Jul 7, 2019
1499: processing attribute #[path] of module  r=matklad a=andreevlex

support two cases
- simple name file `foo.rs`
- declaration in mod.rs

#1211 

Co-authored-by: Alexander Andreev <andreevlex.as@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 7, 2019

Build succeeded

@bors bors bot merged commit 1c582be into rust-lang:master Jul 7, 2019
@ava57r ava57r deleted the feature/resolve-path-attr-mod branch July 7, 2019 14:11
@kjeremy
Copy link
Contributor

kjeremy commented Jul 7, 2019

On rust-analyzer we went from:

Expressions of unknown type: 9603 (14%)
Expressions of partially unknown type: 3788 (5%)

to

Expressions of unknown type: 9599 (14%)
Expressions of partially unknown type: 3802 (5%)

@marcogroppo
Copy link
Contributor

I can confirm that RA can now display completions for f32 and f64 🎉 Unfortunately they are incomplete, because we don't look for the fXX_runtime lang items in libstd.

@ava57r
Copy link
Contributor Author

ava57r commented Jul 8, 2019

@marcogroppo new issue?

@marcogroppo
Copy link
Contributor

@marcogroppo new issue?

I'll submit a PR!

bors bot added a commit that referenced this pull request Jul 8, 2019
1514: Better completions for floating point primitive types r=flodiebold a=marcogroppo

After #1499 completions for (some of) the inherent methods of `f32` and `f64` are now working.
Unfortunately during method resolution we were only looking for the `f32` and `f64` language items defined in `libcore` and we were ignoring the methods defined in `libstd`.

This PR fixes this issue.

Co-authored-by: Marco Groppo <marco.groppo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants