This repository has been archived by the owner on Mar 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
163 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "traits" | ||
version = "0.1.0" | ||
authors = ["Martin Algesten <martin@algesten.se>"] | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"config":{"output_file":null,"full_docs":false,"pub_only":false,"reachable_only":false,"distro_crate":false,"signatures":false,"borrow_data":false},"prelude":{"crate_id":{"name":"traits","disambiguator":[9834285854511471743,11986377825196509713]},"crate_root":"src","external_crates":[{"file_name":"/Users/martin/dev/_dist/rls-analysis/test_data/traits/src/main.rs","num":1,"id":{"name":"std","disambiguator":[16908046677263206360,15608585996220974956]}},{"file_name":"/Users/martin/dev/_dist/rls-analysis/test_data/traits/src/main.rs","num":2,"id":{"name":"core","disambiguator":[265854671877483652,7509856743425468126]}},{"file_name":"/Users/martin/dev/_dist/rls-analysis/test_data/traits/src/main.rs","num":3,"id":{"name":"alloc","disambiguator":[7464960686499081871,14975191818600169300]}},{"file_name":"/Users/martin/dev/_dist/rls-analysis/test_data/traits/src/main.rs","num":4,"id":{"name":"std_unicode","disambiguator":[6545616104026717450,18290903305805074798]}},{"file_name":"/Users/martin/dev/_dist/rls-analysis/test_data/traits/src/main.rs","num":5,"id":{"name":"alloc_system","disambiguator":[933858897868640912,3181242634312403434]}},{"file_name":"/Users/martin/dev/_dist/rls-analysis/test_data/traits/src/main.rs","num":6,"id":{"name":"libc","disambiguator":[7923155387865240769,14589553178726802507]}},{"file_name":"/Users/martin/dev/_dist/rls-analysis/test_data/traits/src/main.rs","num":7,"id":{"name":"unwind","disambiguator":[15369053486114929769,10993836436858370164]}},{"file_name":"/Users/martin/dev/_dist/rls-analysis/test_data/traits/src/main.rs","num":8,"id":{"name":"compiler_builtins","disambiguator":[5420709578077943918,7267737470173610552]}},{"file_name":"/Users/martin/dev/_dist/rls-analysis/test_data/traits/src/main.rs","num":9,"id":{"name":"alloc_jemalloc","disambiguator":[3928795565666290148,2262383683626321904]}},{"file_name":"/Users/martin/dev/_dist/rls-analysis/test_data/traits/src/main.rs","num":10,"id":{"name":"panic_unwind","disambiguator":[12477021650613093167,18048873155028682792]}}],"span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":0,"byte_end":262,"line_start":1,"line_end":18,"column_start":1,"column_end":2}},"imports":[{"kind":"Use","ref_id":{"krate":0,"index":14},"span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":11,"byte_end":18,"line_start":1,"line_end":1,"column_start":12,"column_end":19},"name":"MyTrait","value":"","parent":{"krate":0,"index":0}}],"defs":[{"kind":"Mod","id":{"krate":0,"index":0},"span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":0,"byte_end":262,"line_start":1,"line_end":18,"column_start":1,"column_end":2},"name":"","qualname":"::","value":"src/main.rs","parent":null,"children":[{"krate":0,"index":2},{"krate":0,"index":4},{"krate":0,"index":6},{"krate":0,"index":8},{"krate":0,"index":10}],"decl_id":null,"docs":"","sig":null,"attributes":[]},{"kind":"Function","id":{"krate":0,"index":8},"span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":28,"byte_end":32,"line_start":3,"line_end":3,"column_start":8,"column_end":12},"name":"main","qualname":"::main","value":"fn () -> ()","parent":null,"children":[],"decl_id":null,"docs":"","sig":null,"attributes":[]},{"kind":"Local","id":{"krate":0,"index":4294967286},"span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":45,"byte_end":53,"line_start":4,"line_end":4,"column_start":9,"column_end":17},"name":"_ignored","qualname":"_ignored$9","value":"()","parent":null,"children":[],"decl_id":null,"docs":"","sig":null,"attributes":[]},{"kind":"Mod","id":{"krate":0,"index":10},"span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":91,"byte_end":96,"line_start":7,"line_end":7,"column_start":5,"column_end":10},"name":"mymod","qualname":"::mymod","value":"src/main.rs","parent":null,"children":[{"krate":0,"index":12},{"krate":0,"index":14},{"krate":0,"index":18}],"decl_id":null,"docs":"","sig":null,"attributes":[]},{"kind":"Struct","id":{"krate":0,"index":12},"span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":114,"byte_end":122,"line_start":8,"line_end":8,"column_start":16,"column_end":24},"name":"MyStruct","qualname":"::mymod::MyStruct","value":"","parent":null,"children":[],"decl_id":null,"docs":"","sig":null,"attributes":[]},{"kind":"Trait","id":{"krate":0,"index":14},"span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":139,"byte_end":146,"line_start":10,"line_end":10,"column_start":15,"column_end":22},"name":"MyTrait","qualname":"::mymod::MyTrait","value":"MyTrait","parent":null,"children":[{"krate":0,"index":16}],"decl_id":null,"docs":"","sig":null,"attributes":[]},{"kind":"Method","id":{"krate":0,"index":16},"span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":160,"byte_end":168,"line_start":11,"line_end":11,"column_start":12,"column_end":20},"name":"trait_fn","qualname":"::mymod::MyTrait::trait_fn","value":"fn (&self) -> ()","parent":{"krate":0,"index":14},"children":[],"decl_id":null,"docs":"","sig":null,"attributes":[]},{"kind":"Local","id":{"krate":0,"index":4294967264},"span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":237,"byte_end":241,"line_start":15,"line_end":15,"column_start":22,"column_end":26},"name":"self","qualname":"<MyStruct as mymod::MyTrait>::trait_fn::self","value":"&mymod::MyStruct","parent":null,"children":[],"decl_id":null,"docs":"","sig":null,"attributes":[]},{"kind":"Method","id":{"krate":0,"index":20},"span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":227,"byte_end":235,"line_start":15,"line_end":15,"column_start":12,"column_end":20},"name":"trait_fn","qualname":"<MyStruct as mymod::MyTrait>::trait_fn","value":"fn (&self) -> ()","parent":{"krate":0,"index":14},"children":[],"decl_id":{"krate":0,"index":16},"docs":"","sig":null,"attributes":[]}],"impls":[{"id":0,"kind":"Direct","span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":205,"byte_end":213,"line_start":14,"line_end":14,"column_start":22,"column_end":30},"value":"","parent":null,"children":[{"krate":0,"index":20}],"docs":"","sig":null,"attributes":[]}],"refs":[{"kind":"Mod","span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":0,"byte_end":0,"line_start":1,"line_end":1,"column_start":1,"column_end":1},"ref_id":{"krate":4294967295,"index":4294967295}},{"kind":"Mod","span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":0,"byte_end":0,"line_start":1,"line_end":1,"column_start":1,"column_end":1},"ref_id":{"krate":4294967295,"index":4294967295}},{"kind":"Mod","span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":0,"byte_end":0,"line_start":1,"line_end":1,"column_start":1,"column_end":1},"ref_id":{"krate":4294967295,"index":4294967295}},{"kind":"Type","span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":11,"byte_end":18,"line_start":1,"line_end":1,"column_start":12,"column_end":19},"ref_id":{"krate":0,"index":14}},{"kind":"Mod","span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":4,"byte_end":9,"line_start":1,"line_end":1,"column_start":5,"column_end":10},"ref_id":{"krate":4294967295,"index":4294967295}},{"kind":"Function","span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":72,"byte_end":80,"line_start":4,"line_end":4,"column_start":36,"column_end":44},"ref_id":{"krate":0,"index":16}},{"kind":"Type","span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":63,"byte_end":71,"line_start":4,"line_end":4,"column_start":27,"column_end":35},"ref_id":{"krate":0,"index":12}},{"kind":"Mod","span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":56,"byte_end":61,"line_start":4,"line_end":4,"column_start":20,"column_end":25},"ref_id":{"krate":4294967295,"index":4294967295}},{"kind":"Type","span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":205,"byte_end":213,"line_start":14,"line_end":14,"column_start":22,"column_end":30},"ref_id":{"krate":0,"index":12}},{"kind":"Type","span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":193,"byte_end":200,"line_start":14,"line_end":14,"column_start":10,"column_end":17},"ref_id":{"krate":0,"index":14}}],"macro_refs":[],"relations":[{"span":{"file_name":[115,114,99,47,109,97,105,110,46,114,115],"byte_start":205,"byte_end":213,"line_start":14,"line_end":14,"column_start":22,"column_end":30},"kind":{"variant":"Impl","fields":[0]},"from":{"krate":0,"index":12},"to":{"krate":0,"index":14}}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use mymod::MyTrait; | ||
|
||
pub fn main() { | ||
let _ignored = mymod::MyStruct.trait_fn(); | ||
} | ||
|
||
mod mymod { | ||
pub struct MyStruct; | ||
|
||
pub trait MyTrait { | ||
fn trait_fn(&self); | ||
} | ||
|
||
impl MyTrait for MyStruct { | ||
fn trait_fn(&self) { | ||
} | ||
} | ||
} |