├── .gitignore ├── Cargo.toml ├── README.md ├── build_tests.py ├── notes └── Rust.pptx ├── papers └── ACSC2017 │ ├── acmcopyright.sty │ ├── acsc2-camera.zip │ ├── acsc2-camera │ ├── acmcopyright.sty │ ├── acsc2-camera.bbl │ ├── acsc2-camera.blg │ ├── acsc2-camera.log │ ├── acsc2-camera.pdf │ ├── acsc2-camera.tex │ ├── background.tex │ ├── conclusion.tex │ ├── discussion.tex │ ├── evaluation.tex │ ├── future.tex │ ├── garming.bib │ ├── implementation.tex │ ├── introduction.tex │ ├── refactorings.png │ ├── scaling.png │ ├── sig-alternate-05-2015.cls │ └── workdone.tex │ ├── alex.bib │ ├── background.tex │ ├── conclusion.tex │ ├── discussion.tex │ ├── evaluation.tex │ ├── future.tex │ ├── garming.bib │ ├── implementation.tex │ ├── introduction.log │ ├── introduction.tex │ ├── main-submitted-to-acsc2017.pdf │ ├── main.bbl │ ├── main.tex │ ├── refactorings.png │ ├── scaling.png │ ├── sig-alternate-05-2015.cls │ └── workdone.tex ├── src ├── analysis.rs ├── compiler │ ├── folder.rs │ ├── lifetime_walker.rs │ ├── loader.rs │ ├── mod.rs │ ├── refactor_calls.rs │ └── util.rs ├── lib.rs ├── main.rs ├── rebuilder.rs ├── refactor │ ├── error.rs │ ├── inline_local.rs │ ├── lifetimes.rs │ ├── mod.rs │ ├── rename.rs │ ├── rename_function.rs │ ├── rename_type.rs │ └── rename_variable.rs └── util.rs └── tests ├── field ├── simple_field.csv ├── simple_field.rs └── simple_field_out.rs ├── function ├── alex_override_method.csv ├── alex_override_method.rs ├── alex_override_method_out.rs ├── alex_override_method_out2.rs ├── basic_default_method.csv ├── basic_default_method.rs ├── basic_function.csv ├── basic_function.rs ├── basic_function_out.rs ├── basic_generic_function.csv ├── basic_generic_function.rs ├── basic_generic_function_out.rs ├── basic_module_function.csv ├── basic_module_function.rs ├── basic_module_function_out.rs ├── basic_trait_function.csv ├── basic_trait_function.rs ├── basic_trait_function_out.rs ├── basic_use_function.csv ├── basic_use_function.rs ├── basic_use_function_out.rs ├── conflict_fn_with_var.csv ├── conflict_fn_with_var.rs ├── conflict_module_function.csv ├── conflict_module_function.rs ├── extern_function.csv ├── extern_function.rs ├── extern_function_out.rs ├── extern_stdcall_function.csv ├── extern_stdcall_function.rs ├── extern_stdcall_function_out.rs ├── fn_local_mod.csv ├── fn_local_mod.rs ├── fn_local_mod_after.csv ├── fn_local_mod_after.rs ├── fn_local_mod_after_out.rs ├── fn_local_mod_out.rs ├── impl_override_method.csv ├── impl_override_method.rs ├── working_method_1_out.rs └── working_method_2_out.rs ├── inline ├── inline.rs ├── inline3.csv ├── inline3.rs ├── inline3_out.rs ├── inline4.csv ├── inline4.rs ├── inline4_out.rs ├── inline5.csv ├── inline5.rs ├── inline5_out.rs ├── inline6.csv ├── inline6.rs ├── inline6_out.rs ├── inline7.csv ├── inline7.rs ├── inline7_out.rs ├── inline8.csv ├── inline8.rs ├── inline8_out.rs ├── inline_single.csv ├── inline_single.rs └── inline_single_out.rs ├── lib.rs ├── lifetime ├── elide_multi_anon_self_ret.csv ├── elide_multi_anon_self_ret.rs ├── elide_multi_anon_self_ret_out.rs ├── elide_multi_in.csv ├── elide_multi_in.rs ├── elide_multi_in_out.rs ├── elide_multi_named_self_ret.csv ├── elide_multi_named_self_ret.rs ├── elide_multi_named_self_ret_out.rs ├── elide_multi_static_self_ret.csv ├── elide_multi_static_self_ret.rs ├── elide_multi_static_self_ret_out.rs ├── elide_single_anon_static_ret.csv ├── elide_single_anon_static_ret.rs ├── elide_single_in.csv ├── elide_single_in.rs ├── elide_single_in_anon_ret.csv ├── elide_single_in_anon_ret.rs ├── elide_single_in_anon_ret_out.rs ├── elide_single_in_out.rs ├── elide_single_in_ret.csv ├── elide_single_in_ret.rs ├── elide_single_in_ret_out.rs ├── elide_single_static_ret.csv ├── elide_single_static_ret.rs ├── elide_single_static_ret_out.rs ├── reify_multi_in.csv ├── reify_multi_in.rs ├── reify_multi_in_out.rs ├── reify_multi_named_in.csv ├── reify_multi_named_in.rs ├── reify_multi_named_in_out.rs ├── reify_multi_named_self_ret.csv ├── reify_multi_named_self_ret.rs ├── reify_multi_named_self_ret_out.rs ├── reify_multi_self_ret.csv ├── reify_multi_self_ret.rs ├── reify_multi_self_ret_out.rs ├── reify_single_in.csv ├── reify_single_in.rs ├── reify_single_in_anon_ret.csv ├── reify_single_in_anon_ret.rs ├── reify_single_in_anon_ret_out.rs ├── reify_single_in_out.rs ├── reify_single_in_ret.csv ├── reify_single_in_ret.rs └── reify_single_in_ret_out.rs ├── multi-file ├── simple_function_1 │ ├── foo.rs │ ├── foo_out.rs │ ├── main.csv │ ├── main.rs │ └── main_out.rs ├── simple_function_2 │ ├── foo │ │ ├── mod.rs │ │ └── mod_out.rs │ ├── main.csv │ ├── main.rs │ └── main_out.rs └── simple_inline_1 │ ├── foo.rs │ ├── foo_out.rs │ ├── main.csv │ ├── main.rs │ └── main_out.rs ├── type ├── basic_enum.csv ├── basic_enum.rs ├── basic_struct.csv ├── basic_struct.rs ├── conflict_local_struct.csv ├── conflict_local_struct.rs ├── conflict_mod_struct.csv ├── conflict_mod_struct.rs ├── conflict_struct.csv ├── conflict_struct.rs ├── conflict_use_mod_struct.csv ├── conflict_use_mod_struct.rs ├── conflict_use_mod_struct2.rs ├── modref_enum.csv ├── modref_enum.rs ├── scoped_struct.csv ├── scoped_struct.rs ├── tuple_struct.csv ├── tuple_struct.rs ├── tuple_struct_out.rs ├── working_enum_1_out.rs ├── working_enum_2_out.rs ├── working_struct_1_out.rs └── working_struct_2_out.rs └── variable ├── alex_var_test.csv ├── alex_var_test.rs ├── alex_var_test_out.rs ├── alex_var_test_out2.rs ├── basic_rename.csv ├── basic_rename.rs ├── conflict_var_use_mod.csv ├── conflict_var_use_mod.rs ├── conflict_var_use_mod_out.rs ├── const_rename.csv ├── const_rename.rs ├── const_rename_out.rs ├── destructure_conflict.csv ├── destructure_conflict.rs ├── fn_args_1.csv ├── fn_args_1.rs ├── fn_args_1_out.rs ├── fn_args_2.csv ├── fn_args_2.rs ├── fn_args_2_1_out.rs ├── fn_args_2_2_out.rs ├── name_conflict_global.csv ├── name_conflict_global.rs ├── name_conflict_method.csv ├── name_conflict_method.rs ├── name_conflict_method_global.csv ├── name_conflict_method_global.rs ├── name_conflict_method_local.csv ├── name_conflict_method_local.rs ├── name_conflict_method_local2.csv ├── name_conflict_method_local2.rs ├── name_conflict_type.csv ├── name_conflict_type.rs ├── name_conflict_type_global.csv ├── name_conflict_type_global.rs ├── name_conflict_type_local.csv ├── name_conflict_type_local.rs ├── name_conflict_type_local2.csv ├── name_conflict_type_local2.rs ├── override.csv ├── override.rs ├── working_fn_local.csv ├── working_fn_local.rs ├── working_fn_local_out.rs ├── working_mut_tuple_let.csv ├── working_mut_tuple_let.rs ├── working_mut_tuple_let2.csv ├── working_mut_tuple_let2.rs ├── working_mut_tuple_let2_out.rs ├── working_mut_tuple_let3.csv ├── working_mut_tuple_let3.rs ├── working_mut_tuple_let3_out.rs ├── working_mut_tuple_let_out.rs ├── working_nested.csv ├── working_nested.rs ├── working_nested_out.rs ├── working_rename_1_out.rs ├── working_rename_2_out.rs ├── working_tuple_let.csv ├── working_tuple_let.rs └── working_tuple_let_out.rs /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | Cargo.lock 3 | *.swp 4 | *.swo 5 | *~ 6 | .vscode 7 | 8 | *.aux 9 | 10 | papers/ASEJournalSubmission/main.bbl 11 | papers/ASEJournalSubmission/main.blg 12 | papers/ASEJournalSubmission/main.log 13 | papers/ASEJournalSubmission/main.synctex.gz 14 | 15 | papers/ACSC2017/main.synctex.gz 16 | 17 | papers/ACSC2017/main.log 18 | 19 | papers/ACSC2017/main.pdf 20 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | 3 | name = "refactor" 4 | version = "0.0.1" 5 | authors = ["Garming "] 6 | 7 | [dependencies] 8 | csv = "0.14.2" 9 | 10 | [dependencies.strings] 11 | strings = "0.0.1" 12 | git = "https://github.com/nrc/strings.rs.git" 13 | rev = "b7f37c4545b7dba24fb28161cd9c405fae978be4" 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rust-refactor 2 | Rust refactoring project 3 | 4 | A tool to help refactor rust programs. 5 | 6 | Currently supports: 7 | Simple variable renames, function renaming, struct renaming. 8 | 9 | ``` 10 | % refactor var "tests/variable/basic_rename.csv" "tests/variable/basic_rename.rs" x:-1:-1 new_name 11 | ``` 12 | 13 | Requires a modified compiler at: 14 | https://github.com/GSam/rust 15 | 16 | Before running the tool, an additional environment variable is required for the internal compilation using stdlibs, RUST_FOLDER needs to be set to either the stage2 lib folder or the stage2/rustlib/XXX/lib folder currently. 17 | 18 | ###Known issues: 19 | There appears to be issues with running the tool on Windows. The cause appears to be the inability to locate the stdlib, but neither setting the linker flag or the sysroot appears to be of any use. 20 | 21 | ###TODO: 22 | Renaming enum, variants + struct variants 23 | 24 | Renaming traits 25 | -------------------------------------------------------------------------------- /build_tests.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import glob 3 | from os.path import splitext, exists 4 | import sys 5 | 6 | for f in glob.glob("tests/*/*.rs"): 7 | if exists(splitext(f)[0] + '.csv') and len(sys.argv) > 1: 8 | continue 9 | subprocess.Popen('LD_LIBRARY_PATH=/vol/elvis/samgarm/rust/x86_64-unknown-linux-gnu/stage2/lib RUST_FOLDER=/vol/elvis/samgarm/rust/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib rustc -o out -Zsave-analysis ' + f, shell=True).communicate()[0] 10 | subprocess.Popen('mv dxr-temp/unknown_crate.csv ' + splitext(f)[0] + '.csv', shell=True).communicate()[0] 11 | -------------------------------------------------------------------------------- /notes/Rust.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GSam/rust-refactor/9618a1d235e34c0ef56a6f25de948ad71b2bad96/notes/Rust.pptx -------------------------------------------------------------------------------- /papers/ACSC2017/acsc2-camera.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GSam/rust-refactor/9618a1d235e34c0ef56a6f25de948ad71b2bad96/papers/ACSC2017/acsc2-camera.zip -------------------------------------------------------------------------------- /papers/ACSC2017/acsc2-camera/acsc2-camera.bbl: -------------------------------------------------------------------------------- 1 | \begin{thebibliography}{10} 2 | 3 | \bibitem{brown2008tool} 4 | Christopher~Mark Brown. 5 | \newblock {\em Tool Support for Refactoring Haskell Programs}. 6 | \newblock PhD thesis, University of Kent, 2008. 7 | 8 | \bibitem{gofix11} 9 | Russ Cox. 10 | \newblock {Introducing Gofix}. 11 | \newblock \url{http://blog.golang.org/introducing-gofix}, 2011. 12 | 13 | \bibitem{cratesio15} 14 | Crates.io. 15 | \newblock {Cargo: The Rust Community's crate host}. 16 | \newblock \url{https://crates.io/}, 2015. 17 | 18 | \bibitem{fowler99} 19 | Martin Fowler and Kent Beck. 20 | \newblock {\em Refactoring: Improving the Design of Existing Code}. 21 | \newblock AW, 1999. 22 | 23 | \bibitem{graph} 24 | Tom Mens, Serge Demeyer, and Dirk Janssens. 25 | \newblock {Formalising behaviour preserving program transformations}. 26 | \newblock In {\em {ICGT}}, pages 286--301. SV, 2002. 27 | 28 | \bibitem{opdyke1992refactoring} 29 | William~F Opdyke. 30 | \newblock {\em Refactoring object-oriented frameworks}. 31 | \newblock PhD thesis, University of Illinois at Urbana-Champaign, 1992. 32 | 33 | \bibitem{effects} 34 | Lukas Rytz, Martin Odersky, and Philipp Haller. 35 | \newblock {Lightweight polymorphic effects}. 36 | \newblock In {\em {ECOOP}}, pages 258--282. SV, 2012. 37 | 38 | \bibitem{rrproject} 39 | Garming Sam. 40 | \newblock {rust-refactor: Rust refactoring project}. 41 | \newblock \url{https://github.com/GSam/rust-refactor}, 2015. 42 | 43 | \bibitem{schafer2010specification} 44 | Max Schafer. 45 | \newblock {\em Specification, Implementation and Verification of Refactorings}. 46 | \newblock PhD thesis, Oxford, 2010. 47 | 48 | \bibitem{sculthorpe} 49 | N.~Sculthorpe, A.~Farmer, and K.~Beck. 50 | \newblock {The HERMIT in the Tree}. 51 | \newblock In {\em {IAFL}}, pages 86--103. SV, 2013. 52 | 53 | \bibitem{aop} 54 | Friedrich Steimann. 55 | \newblock The paradoxical success of aspect-oriented programming. 56 | \newblock {\em ACM Sigplan Notices}, 41:481--497, 2006. 57 | 58 | \bibitem{gorename15} 59 | {The Go Authors}. 60 | \newblock {Rename: check.go}. 61 | \newblock 62 | \url{https://github.com/golang/tools/blob/master/refactor/rename/check.go}, 63 | 2015. 64 | 65 | \bibitem{elisionrules} 66 | {The Rust Community}. 67 | \newblock {RFC - Lifetime elision}. 68 | \newblock 69 | \url{https://github.com/rust-lang/rfcs/blob/master/text/0141-lifetime-elision.md}, 70 | 2014. 71 | 72 | \bibitem{doc15} 73 | {The Rust Community}. 74 | \newblock {Rust Documentation}. 75 | \newblock \url{https://doc.rust-lang.org/}, 2015. 76 | 77 | \bibitem{pwalton} 78 | {Walton, P. (Mozilla)}. 79 | \newblock {Why in the Rust language functions are not pure by default? -- 80 | Email}. 81 | \newblock 82 | \url{https://mail.mozilla.org/pipermail/rust-dev/2013-January/002903.html}, 83 | 2013. 84 | 85 | \end{thebibliography} 86 | -------------------------------------------------------------------------------- /papers/ACSC2017/acsc2-camera/acsc2-camera.blg: -------------------------------------------------------------------------------- 1 | This is BibTeX, Version 0.99d (TeX Live 2015) 2 | Capacity: max_strings=35307, hash_size=35307, hash_prime=30011 3 | The top-level auxiliary file: acsc2-camera.aux 4 | The style file: plain.bst 5 | Database file #1: garming.bib 6 | You've used 15 entries, 7 | 2118 wiz_defined-function locations, 8 | 573 strings with 5637 characters, 9 | and the built_in function-call counts, 4073 in all, are: 10 | = -- 415 11 | > -- 144 12 | < -- 3 13 | + -- 60 14 | - -- 44 15 | * -- 191 16 | := -- 677 17 | add.period$ -- 48 18 | call.type$ -- 15 19 | change.case$ -- 63 20 | chr.to.int$ -- 0 21 | cite$ -- 15 22 | duplicate$ -- 166 23 | empty$ -- 366 24 | format.name$ -- 44 25 | if$ -- 890 26 | int.to.chr$ -- 0 27 | int.to.str$ -- 15 28 | missing$ -- 6 29 | newline$ -- 78 30 | num.names$ -- 30 31 | pop$ -- 103 32 | preamble$ -- 1 33 | purify$ -- 52 34 | quote$ -- 0 35 | skip$ -- 131 36 | stack$ -- 0 37 | substring$ -- 192 38 | swap$ -- 43 39 | text.length$ -- 3 40 | text.prefix$ -- 0 41 | top$ -- 0 42 | type$ -- 58 43 | warning$ -- 0 44 | while$ -- 41 45 | width$ -- 17 46 | write$ -- 162 47 | -------------------------------------------------------------------------------- /papers/ACSC2017/acsc2-camera/acsc2-camera.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GSam/rust-refactor/9618a1d235e34c0ef56a6f25de948ad71b2bad96/papers/ACSC2017/acsc2-camera/acsc2-camera.pdf -------------------------------------------------------------------------------- /papers/ACSC2017/acsc2-camera/acsc2-camera.tex: -------------------------------------------------------------------------------- 1 | \documentclass{sig-alternate-05-2015} 2 | 3 | \usepackage{graphicx} 4 | \usepackage{color} 5 | \usepackage{url} 6 | \usepackage{multicol} 7 | \usepackage{microtype} 8 | 9 | \begin{document} 10 | 11 | \title{Automated Refactoring of Rust Programs} 12 | 13 | \author{Garming Sam\\ Catalyst IT, NZ\\ \url{garming@catalyst.net.nz} \and Nick Cameron\\ Mozilla Research, NZ\\ \url{ncameron@mozilla.com} \and Alex Potanin\\ VUW, NZ\\ \url{alex@ecs.vuw.ac.nz}} 14 | 15 | \CopyrightYear{2017} 16 | \setcopyright{acmlicensed} 17 | \conferenceinfo{ACSW '17,}{January 31-February 03, 2017, Geelong, Australia} 18 | \isbn{978-1-4503-4768-6/17/01}\acmPrice{\$15.00} 19 | \doi{http://dx.doi.org/10.1145/3014812.3014826} 20 | 21 | \maketitle 22 | 23 | \begin{abstract} 24 | Rust is a modern systems programming language developed by Mozilla Research and the Rust community. Rust supports modern constructs such as ownership, lifetimes, traits, and macros, whilst supporting systems programming idioms with low-cost abstractions and memory safety without garbage collection. 25 | 26 | We describe a new refactoring tool for Rust developers, including discussing the issues and unusual decisions encountered due to the complexities of modern systems languages. We outline lessons learned and hope our paper will help inform design of future programming languages and refactoring tools. The resulting refactoring tool is written in Rust and available from Github under an MIT license~\cite{rrproject}. 27 | \end{abstract} 28 | 29 | \input{introduction} 30 | \input{background} 31 | \input{workdone} 32 | \input{implementation} 33 | \input{evaluation} 34 | \input{discussion} 35 | \input{future} 36 | \input{conclusion} 37 | 38 | \newpage 39 | 40 | \bibliographystyle{plain} 41 | \bibliography{garming} 42 | 43 | \end{document} -------------------------------------------------------------------------------- /papers/ACSC2017/acsc2-camera/conclusion.tex: -------------------------------------------------------------------------------- 1 | \section{Conclusion}\label{C:con} 2 | 3 | This work has explored refactoring and providing tool-support for the Rust programming language. Utilizing existing infrastructure provided by the compiler, this work identifies extensions which help facilitate common automated refactorings. In a more general sense, this work attempts to build upon existing work done on refactoring by documenting specific decisions made in building a refactoring tool (which might normally only be encoded in the source code of an actual tool), and attempting to analyze the decisions made by others. 4 | 5 | Currently, the provided tool supports renaming of local and global variables, fields, function arguments, structs, enums, and functions. Beyond renaming, it also allows reification and elision of lifetime parameters and has preliminary support for inlining of local variables. These refactorings in particular highlight the idiosyncrasies of Rust, ensuring that the analyses performed here are some of the first of its kind. The complete limitations of these refactorings are not yet fully known, but there exists a current suite of tests to ensure that there are no obvious flaws in the approach. 6 | -------------------------------------------------------------------------------- /papers/ACSC2017/acsc2-camera/discussion.tex: -------------------------------------------------------------------------------- 1 | \section{Discussion} 2 | 3 | % TODO - cite here? There is for sure *some* work on formalising refactoring, I'm pretty sure I've read at least one paper on this. 4 | 5 | %As raised throughout this report, lack of formalism is an ongoing problem in the area of refactoring. 6 | 7 | General progress in the field of refactoring appears quite slow, with many opting to simply produce implementations rather than tackling the problem at large. In terms of missing formalisms, refactoring is not the only one at blame it appears. Much in the same way, compilers encode otherwise undescribed aspects of programming languages. Rust is no different, and the case with the relatively informal elision RFC (which was descriptive but definitely not complete) was a reminder of this. Being well-defined likely would have allowed reversal of the elision rules with much more ease. 8 | 9 | Compiling Rust programs is slow relative to other languages. Work is underway to implement incremental compilation and other compiler performance improvements. However, based on the current design of the tool and the need for multiple runs with modified source, the issue of performance would be better addressed by improvements to name resolution in the compiler and our tool's interaction with it. If name resolution could be re-designed to allow an `interactive' mode, renaming could require a single compiler run, rather than one for every use of the variable being renamed. 10 | 11 | Our tool cannot handle macro uses in the source text. Since Rust's macros operate on the AST rather than plain text, and the compiler is aware of them to a great extent, a tool should be able to work around macros to an extent impossible in C/C++. Whilst it is unlikely that code with macros can be refactored as easily as code without, we should at least be able to give a good estimate of whether the refactoring is safe or not. 12 | 13 | The relationship between macro hygiene and refactoring is interesting, but from initial analysis, does not appear to provide any particular benefits. Further research into the relationship might provide some unique insights and a system which is able to incorporate both would be of significant interest. 14 | -------------------------------------------------------------------------------- /papers/ACSC2017/acsc2-camera/introduction.tex: -------------------------------------------------------------------------------- 1 | \section{Introduction}\label{C:intro} 2 | 3 | Rust is developed by Mozilla Research and a very active, open source community; it reached the 1.0 milestone in May 2015. As a modern, memory-safe systems programming language, the aim for the language is to provide reliable and efficient systems by combining the performance of low level control, with the convenience and guarantees of higher level constructs. All of this is achieved without a garbage collector or runtime and allows very low-overhead interoperability with C programs. Rust enforces an ownership system to restrict the duplication of references through borrowing and lifetimes. Using these techniques, Rust prevents dangling pointers, iterator invalidation problems, concurrent data races, and other memory safety issues. 4 | 5 | Refactoring is the act of performing functionality preserving code transformation. Traditionally, these transformations needed to be performed manually, but in recent years, a number of tools to aid and automate refactorings have arisen in many programming languages such as Java and C++ \cite{brown2008tool}. Manual transformations, including editor search-and-replace are potentially prone to error, and so performing tool-assisted refactoring (which guarantee some measure of correctness) can provide much greater confidence in changes. 6 | 7 | The main purpose of this work is to produce a proof-of-concept refactoring tool which utilises existing infrastructure made available by the Rust compiler. 8 | 9 | Our refactoring contributions are as follows: (1) Renaming local and global variables, function arguments, fields, functions and methods, structs, and enumerations; (2) inlining local variables; (3) lifetime parameter reification and elision. In particular, the third item was not implemented in any other language until this point. Finally, we outline the challenges involved and evaluate our tool. -------------------------------------------------------------------------------- /papers/ACSC2017/acsc2-camera/refactorings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GSam/rust-refactor/9618a1d235e34c0ef56a6f25de948ad71b2bad96/papers/ACSC2017/acsc2-camera/refactorings.png -------------------------------------------------------------------------------- /papers/ACSC2017/acsc2-camera/scaling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GSam/rust-refactor/9618a1d235e34c0ef56a6f25de948ad71b2bad96/papers/ACSC2017/acsc2-camera/scaling.png -------------------------------------------------------------------------------- /papers/ACSC2017/conclusion.tex: -------------------------------------------------------------------------------- 1 | \section{Conclusion}\label{C:con} 2 | 3 | This work has explored refactoring and providing tool-support for the Rust programming language. Utilizing existing infrastructure provided by the compiler, this work identifies extensions which help facilitate common automated refactorings. In a more general sense, this work attempts to build upon existing work done on refactoring by documenting specific decisions made in building a refactoring tool (which might normally only be encoded in the source code of an actual tool), and attempting to analyze the decisions made by others. 4 | 5 | Currently, the provided tool supports renaming of local and global variables, fields, function arguments, structs, enums, and functions. Beyond renaming, it also allows reification and elision of lifetime parameters and has preliminary support for inlining of local variables. These refactorings in particular highlight the idiosyncrasies of Rust, ensuring that the analyses performed here are some of the first of its kind. The complete limitations of these refactorings are not yet fully known, but there exists a current suite of tests to ensure that there are no obvious flaws in the approach. 6 | -------------------------------------------------------------------------------- /papers/ACSC2017/discussion.tex: -------------------------------------------------------------------------------- 1 | \section{Discussion} 2 | 3 | % TODO - cite here? There is for sure *some* work on formalising refactoring, I'm pretty sure I've read at least one paper on this. 4 | 5 | %As raised throughout this report, lack of formalism is an ongoing problem in the area of refactoring. 6 | 7 | General progress in the field of refactoring appears quite slow, with many opting to simply produce implementations rather than tackling the problem at large. In terms of missing formalisms, refactoring is not the only one at blame it appears. Much in the same way, compilers encode otherwise undescribed aspects of programming languages. Rust is no different, and the case with the relatively informal elision RFC (which was descriptive but definitely not complete) was a reminder of this. Being well-defined likely would have allowed reversal of the elision rules with much more ease. 8 | 9 | Compiling Rust programs is slow relative to other languages. Work is underway to implement incremental compilation and other compiler performance improvements. However, based on the current design of the tool and the need for multiple runs with modified source, the issue of performance would be better addressed by improvements to name resolution in the compiler and our tool's interaction with it. If name resolution could be re-designed to allow an `interactive' mode, renaming could require a single compiler run, rather than one for every use of the variable being renamed. 10 | 11 | Our tool cannot handle macro uses in the source text. Since Rust's macros operate on the AST rather than plain text, and the compiler is aware of them to a great extent, a tool should be able to work around macros to an extent impossible in C/C++. Whilst it is unlikely that code with macros can be refactored as easily as code without, we should at least be able to give a good estimate of whether the refactoring is safe or not. 12 | 13 | The relationship between macro hygiene and refactoring is interesting, but from initial analysis, does not appear to provide any particular benefits. Further research into the relationship might provide some unique insights and a system which is able to incorporate both would be of significant interest. 14 | -------------------------------------------------------------------------------- /papers/ACSC2017/introduction.log: -------------------------------------------------------------------------------- 1 | This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex 2016.4.25) 8 JUN 2016 11:21 2 | entering extended mode 3 | restricted \write18 enabled. 4 | file:line:error style messages enabled. 5 | %&-line parsing enabled. 6 | **introduction.tex 7 | (./introduction.tex 8 | LaTeX2e <2016/03/31> 9 | Babel <3.9q> and hyphenation patterns for 81 language(s) loaded. 10 | ./introduction.tex:1: Undefined control sequence. 11 | l.1 \section 12 | {Introduction}\label{C:intro} 13 | ? 14 | ./introduction.tex:1: Emergency stop. 15 | l.1 \section 16 | {Introduction}\label{C:intro} 17 | End of file on the terminal! 18 | 19 | 20 | Here is how much of TeX's memory you used: 21 | 5 strings out of 493027 22 | 147 string characters out of 6134069 23 | 53546 words of memory out of 5000000 24 | 3647 multiletter control sequences out of 15000+600000 25 | 3640 words of font info for 14 fonts, out of 8000000 for 9000 26 | 1141 hyphenation exceptions out of 8191 27 | 5i,0n,1p,56b,8s stack positions out of 5000i,500n,10000p,200000b,80000s 28 | ./introduction.tex:1: ==> Fatal error occurred, no output PDF file produced! 29 | -------------------------------------------------------------------------------- /papers/ACSC2017/introduction.tex: -------------------------------------------------------------------------------- 1 | \section{Introduction}\label{C:intro} 2 | 3 | Rust is developed by Mozilla Research and a very active, open source community; it reached the 1.0 milestone in May 2015. As a modern, memory-safe systems programming language, the aim for the language is to provide reliable and efficient systems by combining the performance of low level control, with the convenience and guarantees of higher level constructs. All of this is achieved without a garbage collector or runtime and allows very low-overhead interoperability with C programs. Rust enforces an ownership system to restrict the duplication of references through borrowing and lifetimes. Using these techniques, Rust prevents dangling pointers, iterator invalidation problems, concurrent data races, and other memory safety issues. 4 | 5 | Refactoring is the act of performing functionality preserving code transformation. Traditionally, these transformations needed to be performed manually, but in recent years, a number of tools to aid and automate refactorings have arisen in many programming languages such as Java and C++ \cite{brown2008tool}. Manual transformations, including editor search-and-replace are potentially prone to error, and so performing tool-assisted refactoring (which guarantee some measure of correctness) can provide much greater confidence in changes. 6 | 7 | The main purpose of this work is to produce a proof-of-concept refactoring tool which utilises existing infrastructure made available by the Rust compiler. 8 | 9 | Our refactoring contributions are as follows: (1) Renaming local and global variables, function arguments, fields, functions and methods, structs, and enumerations; (2) inlining local variables; (3) lifetime parameter reification and elision. In particular, the third item was not implemented in any other language until this point. Finally, we outline the challenges involved and evaluate our tool. -------------------------------------------------------------------------------- /papers/ACSC2017/main-submitted-to-acsc2017.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GSam/rust-refactor/9618a1d235e34c0ef56a6f25de948ad71b2bad96/papers/ACSC2017/main-submitted-to-acsc2017.pdf -------------------------------------------------------------------------------- /papers/ACSC2017/main.bbl: -------------------------------------------------------------------------------- 1 | \begin{thebibliography}{10} 2 | 3 | \bibitem{brown2008tool} 4 | Christopher~Mark Brown. 5 | \newblock {\em Tool Support for Refactoring Haskell Programs}. 6 | \newblock PhD thesis, University of Kent, 2008. 7 | 8 | \bibitem{gofix11} 9 | Russ Cox. 10 | \newblock {Introducing Gofix}. 11 | \newblock \url{http://blog.golang.org/introducing-gofix}, 2011. 12 | 13 | \bibitem{cratesio15} 14 | Crates.io. 15 | \newblock {Cargo: The Rust Community's crate host}. 16 | \newblock \url{https://crates.io/}, 2015. 17 | 18 | \bibitem{fowler99} 19 | Martin Fowler and Kent Beck. 20 | \newblock {\em Refactoring: Improving the Design of Existing Code}. 21 | \newblock AW, 1999. 22 | 23 | \bibitem{graph} 24 | Tom Mens, Serge Demeyer, and Dirk Janssens. 25 | \newblock {Formalising behaviour preserving program transformations}. 26 | \newblock In {\em {ICGT}}, pages 286--301. SV, 2002. 27 | 28 | \bibitem{opdyke1992refactoring} 29 | William~F Opdyke. 30 | \newblock {\em Refactoring object-oriented frameworks}. 31 | \newblock PhD thesis, University of Illinois at Urbana-Champaign, 1992. 32 | 33 | \bibitem{effects} 34 | Lukas Rytz, Martin Odersky, and Philipp Haller. 35 | \newblock {Lightweight polymorphic effects}. 36 | \newblock In {\em {ECOOP}}, pages 258--282. SV, 2012. 37 | 38 | \bibitem{rrproject} 39 | Garming Sam. 40 | \newblock {rust-refactor: Rust refactoring project}. 41 | \newblock \url{https://github.com/GSam/rust-refactor}, 2015. 42 | 43 | \bibitem{schafer2010specification} 44 | Max Schafer. 45 | \newblock {\em Specification, Implementation and Verification of Refactorings}. 46 | \newblock PhD thesis, Oxford, 2010. 47 | 48 | \bibitem{sculthorpe} 49 | N.~Sculthorpe, A.~Farmer, and K.~Beck. 50 | \newblock {The HERMIT in the Tree}. 51 | \newblock In {\em {IAFL}}, pages 86--103. SV, 2013. 52 | 53 | \bibitem{aop} 54 | Friedrich Steimann. 55 | \newblock The paradoxical success of aspect-oriented programming. 56 | \newblock {\em ACM Sigplan Notices}, 41:481--497, 2006. 57 | 58 | \bibitem{gorename15} 59 | {The Go Authors}. 60 | \newblock {Rename: check.go}. 61 | \newblock 62 | \url{https://github.com/golang/tools/blob/master/refactor/rename/check.go}, 63 | 2015. 64 | 65 | \bibitem{elisionrules} 66 | {The Rust Community}. 67 | \newblock {RFC - Lifetime elision}. 68 | \newblock 69 | \url{https://github.com/rust-lang/rfcs/blob/master/text/0141-lifetime-elision.md}, 70 | 2014. 71 | 72 | \bibitem{doc15} 73 | {The Rust Community}. 74 | \newblock {Rust Documentation}. 75 | \newblock \url{https://doc.rust-lang.org/}, 2015. 76 | 77 | \bibitem{pwalton} 78 | {Walton, P. (Mozilla)}. 79 | \newblock {Why in the Rust language functions are not pure by default? -- 80 | Email}. 81 | \newblock 82 | \url{https://mail.mozilla.org/pipermail/rust-dev/2013-January/002903.html}, 83 | 2013. 84 | 85 | \end{thebibliography} 86 | -------------------------------------------------------------------------------- /papers/ACSC2017/main.tex: -------------------------------------------------------------------------------- 1 | \documentclass{sig-alternate-05-2015} 2 | 3 | \usepackage{graphicx} 4 | \usepackage{color} 5 | \usepackage{url} 6 | \usepackage{multicol} 7 | \usepackage{microtype} 8 | 9 | \begin{document} 10 | 11 | \title{Automated Refactoring of Rust Programs} 12 | 13 | \author{Garming Sam\\ Catalyst IT, NZ\\ \url{garming@catalyst.net.nz} \and Nick Cameron\\ Mozilla Research, NZ\\ \url{ncameron@mozilla.com} \and Alex Potanin\\ VUW, NZ\\ \url{alex@ecs.vuw.ac.nz}} 14 | 15 | \CopyrightYear{2017} 16 | \setcopyright{acmlicensed} 17 | \conferenceinfo{ACSW '17,}{January 31-February 03, 2017, Geelong, Australia} 18 | \isbn{978-1-4503-4768-6/17/01}\acmPrice{\$15.00} 19 | \doi{http://dx.doi.org/10.1145/3014812.3014826} 20 | 21 | \maketitle 22 | 23 | \begin{abstract} 24 | Rust is a modern systems programming language developed by Mozilla Research and the Rust community. Rust supports modern constructs such as ownership, lifetimes, traits, and macros, whilst supporting systems programming idioms with low-cost abstractions and memory safety without garbage collection. 25 | 26 | We describe a new refactoring tool for Rust developers, including discussing the issues and unusual decisions encountered due to the complexities of modern systems languages. We outline lessons learned and hope our paper will help inform design of future programming languages and refactoring tools. The resulting refactoring tool is written in Rust and available from Github under an MIT license~\cite{rrproject}. 27 | \end{abstract} 28 | 29 | \input{introduction} 30 | \input{background} 31 | \input{workdone} 32 | \input{implementation} 33 | \input{evaluation} 34 | \input{discussion} 35 | \input{future} 36 | \input{conclusion} 37 | 38 | \newpage 39 | 40 | \bibliographystyle{plain} 41 | \bibliography{garming} 42 | 43 | \end{document} -------------------------------------------------------------------------------- /papers/ACSC2017/refactorings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GSam/rust-refactor/9618a1d235e34c0ef56a6f25de948ad71b2bad96/papers/ACSC2017/refactorings.png -------------------------------------------------------------------------------- /papers/ACSC2017/scaling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GSam/rust-refactor/9618a1d235e34c0ef56a6f25de948ad71b2bad96/papers/ACSC2017/scaling.png -------------------------------------------------------------------------------- /src/compiler/lifetime_walker.rs: -------------------------------------------------------------------------------- 1 | 2 | use syntax::ast::Name; 3 | use std::collections::HashSet; 4 | use rustc_front::hir::*; 5 | use rustc_front::intravisit::{self as visit, Visitor}; 6 | 7 | pub struct LifetimeWalker { 8 | pub anon: u32, 9 | pub total: u32, 10 | pub expl_self: u32, 11 | pub names: HashSet 12 | } 13 | 14 | impl LifetimeWalker { 15 | pub fn new() -> LifetimeWalker { 16 | LifetimeWalker { 17 | anon: 0, 18 | total: 0, 19 | expl_self: 0, 20 | names: HashSet::new(), 21 | } 22 | } 23 | } 24 | 25 | // Walk the AST for lifetimes and count them. 26 | impl<'v> Visitor<'v> for LifetimeWalker { 27 | /* FIXME! 28 | fn visit_opt_lifetime_ref(&mut self, 29 | _span: Span, 30 | opt_lifetime: &'v Option) { 31 | self.total += 1; 32 | match *opt_lifetime { 33 | Some(ref l) => { 34 | self.names.insert(l.name); 35 | self.visit_lifetime_ref(l); 36 | } 37 | None => self.anon += 1 38 | } 39 | } 40 | */ 41 | 42 | fn visit_explicit_self(&mut self, es: &'v ExplicitSelf) { 43 | self.expl_self = self.anon; 44 | visit::walk_explicit_self(self, es); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/compiler/loader.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use std::fs::{self, File}; 3 | use std::io::{self, Read}; 4 | use std::path::Path; 5 | use syntax::codemap::{FileLoader, FileName}; 6 | 7 | pub struct ReplaceLoader { 8 | files: HashMap, 9 | } 10 | 11 | // Custom file loader to replace files matching certain names for the codemap. 12 | impl FileLoader for ReplaceLoader { 13 | fn file_exists(&self, path: &Path) -> bool { 14 | fs::metadata(path).is_ok() 15 | } 16 | 17 | fn read_file(&self, path: &Path) -> io::Result { 18 | let file = path.to_str().unwrap(); 19 | if let Some(input) = self.files.get(file) { 20 | return Ok(input.clone()); 21 | } 22 | 23 | let mut src = String::new(); 24 | try!(File::open(path)).read_to_string(&mut src).map(move |_| src) 25 | } 26 | } 27 | 28 | impl ReplaceLoader { 29 | pub fn new() -> ReplaceLoader { 30 | ReplaceLoader { files: HashMap::new() } 31 | } 32 | 33 | pub fn add_file(&mut self, file: FileName, src: String) { 34 | self.files.insert(file, src); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | #![feature(rustc_private)] 2 | #![feature(vec_push_all)] 3 | #![feature(catch_panic)] 4 | 5 | extern crate rustc; 6 | extern crate rustc_driver; 7 | extern crate rustc_front; 8 | extern crate rustc_lint; 9 | extern crate rustc_resolve; 10 | extern crate rustc_trans; 11 | extern crate syntax; 12 | 13 | extern crate csv; 14 | extern crate getopts; 15 | #[macro_use] 16 | extern crate log; 17 | extern crate strings; 18 | 19 | pub mod analysis; 20 | mod compiler; 21 | mod rebuilder; 22 | pub mod refactor; 23 | pub mod util; 24 | 25 | pub use analysis::{ 26 | AnalysisData 27 | }; 28 | 29 | pub use refactor::{ 30 | Response, 31 | elide_fn_lifetime, 32 | inline_local, 33 | rename_function, 34 | rename_type, 35 | rename_variable, 36 | restore_fn_lifetime 37 | }; 38 | 39 | pub use util::{ 40 | identify_id 41 | }; 42 | -------------------------------------------------------------------------------- /src/refactor/error.rs: -------------------------------------------------------------------------------- 1 | // The general idea is to expand the variants to be more fine-grained. 2 | #[derive(Debug, PartialEq)] 3 | pub enum Response { 4 | Error, 5 | Conflict, 6 | Possible, 7 | } -------------------------------------------------------------------------------- /src/refactor/inline_local.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use std::fs::File; 3 | use std::io::Read; 4 | 5 | use syntax::ast::NodeId; 6 | use super::{RefactorType, Response}; 7 | 8 | use strings::src_rope::Rope; 9 | 10 | use analysis::AnalysisData; 11 | use compiler; 12 | 13 | // Inline a local variable 14 | pub fn inline_local(input_file: &str, 15 | analyzed_data: &AnalysisData, 16 | rename_var: &str) 17 | -> Result, Response> { 18 | let dec_map = &analyzed_data.var_map; 19 | //let ref_map = &analyzed_data.var_ref_map; 20 | let node: NodeId = rename_var.parse().unwrap(); 21 | 22 | let input_file_str = String::from(input_file); 23 | 24 | let mut filename = String::from(input_file); 25 | if let Some(decl) = dec_map.get(rename_var) { 26 | if let Some(file) = decl.get("file_name") { 27 | filename = file.clone(); 28 | } 29 | } 30 | let filename = filename; 31 | let (x,y,z,_) = match compiler::run_resolution(input_file_str, None, Some(filename.clone()), RefactorType::InlineLocal, 32 | String::from(rename_var), node, true) { 33 | Ok(()) => { debug!("Unexpected success!"); return Err(Response::Conflict) }, 34 | Err(x) => { println!("{:?}", x); x } 35 | }; 36 | 37 | let mut new_file = String::new(); 38 | File::open(&filename).expect("Missing file").read_to_string(&mut new_file).unwrap(); 39 | let mut rope = Rope::from_string(new_file); 40 | 41 | rope.src_remove(x, y); 42 | rope.src_insert(x, z); 43 | 44 | let mut output = HashMap::new(); 45 | output.insert(filename, rope.to_string()); 46 | Ok(output) 47 | } 48 | -------------------------------------------------------------------------------- /src/refactor/lifetimes.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use std::fs::File; 3 | use std::io::Read; 4 | 5 | use syntax::ast::NodeId; 6 | use super::{RefactorType, Response}; 7 | 8 | use strings::src_rope::Rope; 9 | 10 | use analysis::AnalysisData; 11 | use compiler; 12 | 13 | // Reify the lifetimes in a signature 14 | pub fn restore_fn_lifetime(input_file: &str, 15 | analyzed_data: &AnalysisData, 16 | rename_var: &str) 17 | -> Result, Response> { 18 | let dec_map = &analyzed_data.func_map; 19 | 20 | let node: NodeId = rename_var.parse().unwrap(); 21 | 22 | let input_file_str = String::from(input_file); 23 | 24 | let mut filename = String::from(input_file); 25 | if let Some(decl) = dec_map.get(rename_var) { 26 | if let Some(file) = decl.get("file_name") { 27 | filename = file.clone(); 28 | } 29 | } 30 | let (x,y,z,_) = match compiler::run_resolution(input_file_str, None, Some(filename.clone()), RefactorType::ReifyLifetime, 31 | String::from(rename_var), node, true) { 32 | Ok(()) => { debug!("Unexpected success!"); return Err(Response::Conflict) }, 33 | Err(x) => { println!("{:?}", x); x } 34 | }; 35 | 36 | let mut new_file = String::new(); 37 | File::open(&filename).expect("Missing file").read_to_string(&mut new_file).unwrap(); 38 | let mut rope = Rope::from_string(new_file); 39 | 40 | debug!("{}", filename); 41 | debug!("{}", rope.to_string()); 42 | rope.src_remove(x, y); 43 | rope.src_insert(x, z); 44 | 45 | let mut output = HashMap::new(); 46 | output.insert(filename, rope.to_string()); 47 | debug!("{}", rope.to_string()); 48 | Ok(output) 49 | } 50 | 51 | // Elide the lifetimes in a signature 52 | pub fn elide_fn_lifetime(input_file: &str, 53 | analyzed_data: &AnalysisData, 54 | rename_var: &str) 55 | -> Result, Response> { 56 | let dec_map = &analyzed_data.func_map; 57 | 58 | let node: NodeId = rename_var.parse().unwrap(); 59 | 60 | let input_file_str = String::from(input_file); 61 | 62 | let mut filename = String::from(input_file); 63 | if let Some(decl) = dec_map.get(rename_var) { 64 | if let Some(file) = decl.get("file_name") { 65 | filename = file.clone(); 66 | } 67 | } 68 | let filename = filename; 69 | debug!("{}", filename); 70 | let (x,y,z,_) = match compiler::run_resolution(input_file_str, None, Some(filename.clone()), RefactorType::ElideLifetime, 71 | String::from(rename_var), node, true) { 72 | Ok(()) => { debug!("Unexpected success!"); return Err(Response::Conflict) }, 73 | Err(x) => { println!("{:?}", x); x } 74 | }; 75 | 76 | let mut new_file = String::new(); 77 | File::open(&filename).expect("Missing file").read_to_string(&mut new_file).unwrap(); 78 | let mut rope = Rope::from_string(new_file); 79 | 80 | debug!("{}", filename); 81 | debug!("{}", rope.to_string()); 82 | rope.src_remove(x, y); 83 | rope.src_insert(x, z); 84 | 85 | let mut output = HashMap::new(); 86 | output.insert(filename, rope.to_string()); 87 | debug!("{}", rope.to_string()); 88 | Ok(output) 89 | } 90 | -------------------------------------------------------------------------------- /src/refactor/mod.rs: -------------------------------------------------------------------------------- 1 | mod error; 2 | pub mod inline_local; 3 | pub mod lifetimes; 4 | mod rename; 5 | pub mod rename_function; 6 | pub mod rename_type; 7 | pub mod rename_variable; 8 | 9 | pub use self::error::Response; 10 | pub use self::inline_local::inline_local; 11 | pub use self::lifetimes::{elide_fn_lifetime, restore_fn_lifetime}; 12 | pub use self::rename::{rename, rename_dec_and_ref}; 13 | pub use self::rename_function::rename_function; 14 | pub use self::rename_type::rename_type; 15 | pub use self::rename_variable::rename_variable; 16 | 17 | #[derive(Copy, Clone, PartialEq)] 18 | pub enum RefactorType { 19 | Variable, 20 | Function, 21 | Type, 22 | InlineLocal, 23 | Reduced, 24 | ReifyLifetime, 25 | ElideLifetime, 26 | Nil, 27 | } 28 | -------------------------------------------------------------------------------- /src/refactor/rename_type.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use std::fs::File; 3 | use std::io::Read; 4 | 5 | use syntax::ast::NodeId;use super::{RefactorType, Response}; 6 | 7 | use strings::src_rope::Rope; 8 | 9 | use analysis::AnalysisData; 10 | use compiler; 11 | use refactor; 12 | 13 | // Rename concrete types (structs, enums and struct enums). 14 | pub fn rename_type(input_file: &str, 15 | analyzed_data: &AnalysisData, 16 | new_name: &str, 17 | rename_var: &str) 18 | -> Result, Response> { 19 | 20 | let dec_map = &analyzed_data.type_map; 21 | let ref_map = &analyzed_data.type_ref_map; 22 | let node: NodeId = rename_var.parse().unwrap(); 23 | 24 | let input_file_str = String::from(input_file); 25 | let mut filename = String::from(input_file); 26 | if let Some(decl) = dec_map.get(rename_var) { 27 | if let Some(file) = decl.get("file_name") { 28 | // FIXME: what's the point of this? We never use this value... 29 | filename = file.clone(); 30 | } 31 | } 32 | 33 | match compiler::run_resolution(input_file_str, None, None, RefactorType::Type, 34 | String::from(new_name), node, false) { 35 | Ok(()) => {}, 36 | Err(_) => { debug!("Unexpected failure!"); return Err(Response::Conflict) } 37 | } 38 | 39 | if let Some(references) = ref_map.get(rename_var) { 40 | for map in references.iter() { 41 | let filename = map.get("file_name").unwrap(); 42 | 43 | let mut file = match File::open(&filename) { 44 | Err(why) => panic!("couldn't open file {}", why), 45 | Ok(file) => file, 46 | }; 47 | let mut file_str = String::new(); 48 | let _ = file.read_to_string(&mut file_str); 49 | let file_str = &file_str[..]; 50 | let mut ropes: Vec = file_str.lines().map(|x| Rope::from_string(String::from(x))).collect(); 51 | let file_col: usize = map.get("file_col").unwrap().parse().unwrap(); 52 | let file_line: usize = map.get("file_line").unwrap().parse().unwrap(); 53 | let file_col_end: usize = map.get("file_col_end").unwrap().parse().unwrap(); 54 | let file_line_end: usize = map.get("file_line_end").unwrap().parse().unwrap(); 55 | 56 | //let _ = writeln!(&mut stderr(), "{} {} {} {}", file_col, file_line, file_col_end, file_line_end); 57 | refactor::rename(&mut ropes, file_col, file_line, file_col_end, file_line_end, new_name); 58 | let mut answer = String::new(); 59 | let mut count = ropes.len(); 60 | for rope in &ropes { 61 | answer.push_str(&rope.to_string()); 62 | if count > 1 { 63 | answer.push_str("\n"); 64 | count -= 1; 65 | } 66 | } 67 | 68 | match compiler::run_resolution(String::from(input_file), Some(vec![(String::from(filename.clone()), answer)]), 69 | None, RefactorType::Variable, String::from(new_name), 70 | node, true) { 71 | Ok(()) => { 72 | debug!("Unexpected success!"); 73 | // Check for conflicts 74 | return Err(Response::Conflict); 75 | }, 76 | Err(_) => { debug!("Expected failure!");} 77 | } 78 | } 79 | } 80 | 81 | Ok(refactor::rename_dec_and_ref(new_name, rename_var, dec_map, ref_map)) 82 | } -------------------------------------------------------------------------------- /src/util.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use std::io::{self, Write}; 3 | use analysis::AnalysisData; 4 | 5 | // Find the id associated with the row and column given 6 | // (or a -1 wildcard is given and any with a matching name will be returned). 7 | // TODO more efficient, perhaps better indexed and given type of node as arg 8 | pub fn identify_id(input_filename: &str, 9 | analyzed_data: &AnalysisData, 10 | rename_var: &str, 11 | row: i32, 12 | col: i32, 13 | file: Option<&str>) 14 | -> String { 15 | let _ = writeln!(&mut io::stderr(), "{} {} {}", rename_var, row, col); 16 | for (key, value) in &analyzed_data.var_map { 17 | if check_match(rename_var, input_filename, row, col, value, file) { 18 | return key.clone(); 19 | } 20 | } 21 | 22 | for (key, value) in &analyzed_data.type_map { 23 | if check_match(rename_var, input_filename, row, col, value, file) { 24 | return key.clone(); 25 | } 26 | } 27 | 28 | for (key, value) in &analyzed_data.func_map { 29 | if check_match(rename_var, input_filename, row, col, value, file) { 30 | return key.clone(); 31 | } 32 | } 33 | 34 | "".to_string() 35 | } 36 | 37 | fn check_match(name: &str, 38 | _input_filename: &str, 39 | row: i32, 40 | col: i32, 41 | record: &HashMap, 42 | file: Option<&str>) 43 | -> bool { 44 | 45 | let c: i32 = record.get("file_col").unwrap().parse().unwrap(); 46 | let r: i32 = record.get("file_line").unwrap().parse().unwrap(); 47 | let r_end: i32 = record.get("file_line_end").unwrap().parse().unwrap(); 48 | let c_end: i32 = record.get("file_col_end").unwrap().parse().unwrap(); 49 | let filename = record.get("file_name").unwrap(); 50 | let n = record.get("name").unwrap(); 51 | 52 | if &name == n && (!file.is_some() || filename == file.unwrap()) { 53 | if !(row < 0) { 54 | if row >= r && row <= r_end { 55 | if !(col < 0) { 56 | if col >= c && col < c_end { 57 | return true; 58 | } 59 | } else { 60 | return true; 61 | } 62 | } 63 | } else { 64 | return true; 65 | } 66 | } 67 | 68 | false 69 | } 70 | -------------------------------------------------------------------------------- /tests/field/simple_field.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/field/simple_field.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,9,file_col_end,0,extent_end,103,extent_end_bytes,103,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/field/simple_field.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/field/simple_field.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/field/simple_field.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/field/simple_field.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/field/simple_field.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/field/simple_field.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/field/simple_field.rs" 9 | end_external_crates 10 | struct,file_name,"tests/field/simple_field.rs",file_line,1,file_col,7,extent_start,7,extent_start_bytes,7,file_line_end,1,file_col_end,12,extent_end,12,extent_end_bytes,12,id,"4",ctor_id,"4294967295",qualname,"::Point",scopeid,"0",value,"struct Point { 11 | x: u32, 12 | y: u32, 13 | }" 14 | variable,file_name,"tests/field/simple_field.rs",file_line,2,file_col,4,extent_start,19,extent_start_bytes,19,file_line_end,2,file_col_end,5,extent_end,20,extent_end_bytes,20,id,"5",name,"x",qualname,"::Point::x",value,"",type,"u32",scopeid,"4" 15 | variable,file_name,"tests/field/simple_field.rs",file_line,3,file_col,4,extent_start,31,extent_start_bytes,31,file_line_end,3,file_col_end,5,extent_end,32,extent_end_bytes,32,id,"7",name,"y",qualname,"::Point::y",value,"",type,"u32",scopeid,"4" 16 | function,file_name,"tests/field/simple_field.rs",file_line,6,file_col,3,extent_start,45,extent_start_bytes,45,file_line_end,6,file_col_end,7,extent_end,49,extent_end_bytes,49,id,"10",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 17 | variable,file_name,"tests/field/simple_field.rs",file_line,7,file_col,8,extent_start,62,extent_start_bytes,62,file_line_end,7,file_col_end,9,extent_end,63,extent_end_bytes,63,id,"15",name,"x",qualname,"x$15",value,"x = Point{ x: 2, y: 3}",type,"Point",scopeid,"0" 18 | type_ref,file_name,"tests/field/simple_field.rs",file_line,7,file_col,12,extent_start,66,extent_start_bytes,66,file_line_end,7,file_col_end,17,extent_end,71,extent_end_bytes,71,refid,"4",refidcrate,"0",qualname,"",scopeid,"12" 19 | var_ref,file_name,"tests/field/simple_field.rs",file_line,7,file_col,19,extent_start,73,extent_start_bytes,73,file_line_end,7,file_col_end,20,extent_end,74,extent_end_bytes,74,refid,"5",refidcrate,"0",qualname,"",scopeid,"12" 20 | var_ref,file_name,"tests/field/simple_field.rs",file_line,7,file_col,25,extent_start,79,extent_start_bytes,79,file_line_end,7,file_col_end,26,extent_end,80,extent_end_bytes,80,refid,"7",refidcrate,"0",qualname,"",scopeid,"12" 21 | var_ref,file_name,"tests/field/simple_field.rs",file_line,8,file_col,12,extent_start,98,extent_start_bytes,98,file_line_end,8,file_col_end,13,extent_end,99,extent_end_bytes,99,refid,"15",refidcrate,"0",qualname,"",scopeid,"12" 22 | var_ref,file_name,"tests/field/simple_field.rs",file_line,8,file_col,14,extent_start,100,extent_start_bytes,100,file_line_end,8,file_col_end,15,extent_end,101,extent_end_bytes,101,refid,"5",refidcrate,"0",qualname,"",scopeid,"12" 23 | -------------------------------------------------------------------------------- /tests/field/simple_field.rs: -------------------------------------------------------------------------------- 1 | struct Point { 2 | x: u32, 3 | y: u32, 4 | } 5 | 6 | fn main() { 7 | let x = Point{ x: 2, y: 3 }; 8 | let _ = x.x; 9 | } 10 | -------------------------------------------------------------------------------- /tests/field/simple_field_out.rs: -------------------------------------------------------------------------------- 1 | struct Point { 2 | z: u32, 3 | y: u32, 4 | } 5 | 6 | fn main() { 7 | let x = Point{ z: 2, y: 3 }; 8 | let _ = x.z; 9 | } 10 | -------------------------------------------------------------------------------- /tests/function/alex_override_method.rs: -------------------------------------------------------------------------------- 1 | trait Foo { 2 | fn foo(&self) { println!("FOO"); } 3 | } 4 | 5 | struct Bar; 6 | impl Foo for Bar { 7 | fn foo(&self) { println!("BARFOO"); } 8 | } 9 | impl Bar { 10 | fn baz(&self) { println!("BAZ"); } 11 | } 12 | 13 | fn main() { 14 | let x = Bar; 15 | x.foo(); 16 | x.baz(); 17 | } 18 | -------------------------------------------------------------------------------- /tests/function/alex_override_method_out.rs: -------------------------------------------------------------------------------- 1 | trait Foo { 2 | fn foo(&self) { println!("FOO"); } 3 | } 4 | 5 | struct Bar; 6 | impl Foo for Bar { 7 | fn foo(&self) { println!("BARFOO"); } 8 | } 9 | impl Bar { 10 | fn foo(&self) { println!("BAZ"); } 11 | } 12 | 13 | fn main() { 14 | let x = Bar; 15 | x.foo(); 16 | x.foo(); 17 | } 18 | -------------------------------------------------------------------------------- /tests/function/alex_override_method_out2.rs: -------------------------------------------------------------------------------- 1 | trait Foo { 2 | fn foo(&self) { println!("FOO"); } 3 | } 4 | 5 | struct Bar; 6 | impl Foo for Bar { 7 | fn foo(&self) { println!("BARFOO"); } 8 | } 9 | impl Bar { 10 | fn grue(&self) { println!("BAZ"); } 11 | } 12 | 13 | fn main() { 14 | let x = Bar; 15 | x.foo(); 16 | x.grue(); 17 | } 18 | -------------------------------------------------------------------------------- /tests/function/basic_default_method.rs: -------------------------------------------------------------------------------- 1 | trait Foo { 2 | fn foo(&self) { println!("FOO"); } 3 | } 4 | 5 | struct Bar; 6 | impl Foo for Bar { 7 | } 8 | 9 | fn main() { 10 | let x = Bar; 11 | x.foo(); 12 | } 13 | -------------------------------------------------------------------------------- /tests/function/basic_function.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/function/basic_function.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,6,file_col_end,0,extent_end,37,extent_end_bytes,37,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/function/basic_function.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/function/basic_function.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/function/basic_function.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/function/basic_function.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/function/basic_function.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/function/basic_function.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/function/basic_function.rs" 9 | end_external_crates 10 | function,file_name,"tests/function/basic_function.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,6,extent_end,6,extent_end_bytes,6,id,"4",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 11 | function,file_name,"tests/function/basic_function.rs",file_line,4,file_col,3,extent_start,17,extent_start_bytes,17,file_line_end,4,file_col_end,7,extent_end,21,extent_end_bytes,21,id,"7",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 12 | fn_call,file_name,"tests/function/basic_function.rs",file_line,5,file_col,4,extent_start,30,extent_start_bytes,30,file_line_end,5,file_col_end,7,extent_end,33,extent_end_bytes,33,refid,"4",refidcrate,"0",qualname,"",scopeid,"9" 13 | -------------------------------------------------------------------------------- /tests/function/basic_function.rs: -------------------------------------------------------------------------------- 1 | fn foo() { 2 | } 3 | 4 | fn main() { 5 | foo(); 6 | } 7 | -------------------------------------------------------------------------------- /tests/function/basic_function_out.rs: -------------------------------------------------------------------------------- 1 | fn bar() { 2 | } 3 | 4 | fn main() { 5 | bar(); 6 | } 7 | -------------------------------------------------------------------------------- /tests/function/basic_generic_function.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/function/basic_generic_function.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,10,file_col_end,0,extent_end,117,extent_end_bytes,117,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/function/basic_generic_function.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/function/basic_generic_function.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/function/basic_generic_function.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/function/basic_generic_function.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/function/basic_generic_function.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/function/basic_generic_function.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/function/basic_generic_function.rs" 9 | end_external_crates 10 | type_ref,file_name,"tests/function/basic_generic_function.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,refid,"154037",refidcrate,"2",qualname,"",scopeid,"0" 11 | use_alias,file_name,"tests/function/basic_generic_function.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,id,"4",refid,"154037",refidcrate,"2",name,"Debug",scopeid,"0" 12 | mod_ref,file_name,"tests/function/basic_generic_function.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,refid,"0",refidcrate,"0",qualname,"::std",scopeid,"0" 13 | mod_ref,file_name,"tests/function/basic_generic_function.rs",file_line,1,file_col,9,extent_start,9,extent_start_bytes,9,file_line_end,1,file_col_end,12,extent_end,12,extent_end_bytes,12,refid,"0",refidcrate,"0",qualname,"std::fmt",scopeid,"0" 14 | function,file_name,"tests/function/basic_generic_function.rs",file_line,3,file_col,3,extent_start,25,extent_start_bytes,25,file_line_end,3,file_col_end,6,extent_end,28,extent_end_bytes,28,id,"5",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 15 | variable,file_name,"tests/function/basic_generic_function.rs",file_line,3,file_col,16,extent_start,38,extent_start_bytes,38,file_line_end,3,file_col_end,17,extent_end,39,extent_end_bytes,39,id,"7",name,"x",qualname,"::foo::x",value,"",type,"T",scopeid,"0" 16 | typedef,file_name,"tests/function/basic_generic_function.rs",file_line,3,file_col,7,extent_start,29,extent_start_bytes,29,file_line_end,3,file_col_end,8,extent_end,30,extent_end_bytes,30,id,"9",qualname,"::foo::T$5",value,"" 17 | type_ref,file_name,"tests/function/basic_generic_function.rs",file_line,3,file_col,9,extent_start,31,extent_start_bytes,31,file_line_end,3,file_col_end,14,extent_end,36,extent_end_bytes,36,refid,"154037",refidcrate,"2",qualname,"",scopeid,"0" 18 | type_ref,file_name,"tests/function/basic_generic_function.rs",file_line,3,file_col,19,extent_start,41,extent_start_bytes,41,file_line_end,3,file_col_end,20,extent_end,42,extent_end_bytes,42,refid,"9",refidcrate,"0",qualname,"",scopeid,"0" 19 | function,file_name,"tests/function/basic_generic_function.rs",file_line,7,file_col,3,extent_start,77,extent_start_bytes,77,file_line_end,7,file_col_end,7,extent_end,81,extent_end_bytes,81,id,"45",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 20 | fn_call,file_name,"tests/function/basic_generic_function.rs",file_line,8,file_col,4,extent_start,90,extent_start_bytes,90,file_line_end,8,file_col_end,7,extent_end,93,extent_end_bytes,93,refid,"5",refidcrate,"0",qualname,"",scopeid,"47" 21 | fn_call,file_name,"tests/function/basic_generic_function.rs",file_line,9,file_col,4,extent_start,102,extent_start_bytes,102,file_line_end,9,file_col_end,7,extent_end,105,extent_end_bytes,105,refid,"5",refidcrate,"0",qualname,"",scopeid,"47" 22 | -------------------------------------------------------------------------------- /tests/function/basic_generic_function.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo(x: T) { 4 | println!("{:?}", x); 5 | } 6 | 7 | fn main() { 8 | foo(2); 9 | foo("STRING"); 10 | } 11 | -------------------------------------------------------------------------------- /tests/function/basic_generic_function_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn bar(x: T) { 4 | println!("{:?}", x); 5 | } 6 | 7 | fn main() { 8 | bar(2); 9 | bar("STRING"); 10 | } 11 | -------------------------------------------------------------------------------- /tests/function/basic_module_function.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/function/basic_module_function.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,8,file_col_end,0,extent_end,66,extent_end_bytes,66,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/function/basic_module_function.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/function/basic_module_function.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/function/basic_module_function.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/function/basic_module_function.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/function/basic_module_function.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/function/basic_module_function.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/function/basic_module_function.rs" 9 | end_external_crates 10 | module,file_name,"tests/function/basic_module_function.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::bar",scopeid,"0",def_file,"tests/function/basic_module_function.rs" 11 | function,file_name,"tests/function/basic_module_function.rs",file_line,2,file_col,11,extent_start,21,extent_start_bytes,21,file_line_end,2,file_col_end,14,extent_end,24,extent_end_bytes,24,id,"6",qualname,"::bar::foo",declid,"",declidcrate,"",scopeid,"4" 12 | function,file_name,"tests/function/basic_module_function.rs",file_line,6,file_col,3,extent_start,41,extent_start_bytes,41,file_line_end,6,file_col_end,7,extent_end,45,extent_end_bytes,45,id,"9",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 13 | fn_call,file_name,"tests/function/basic_module_function.rs",file_line,7,file_col,9,extent_start,59,extent_start_bytes,59,file_line_end,7,file_col_end,12,extent_end,62,extent_end_bytes,62,refid,"6",refidcrate,"0",qualname,"",scopeid,"11" 14 | mod_ref,file_name,"tests/function/basic_module_function.rs",file_line,7,file_col,4,extent_start,54,extent_start_bytes,54,file_line_end,7,file_col_end,7,extent_end,57,extent_end_bytes,57,refid,"0",refidcrate,"0",qualname,"bar",scopeid,"9" 15 | -------------------------------------------------------------------------------- /tests/function/basic_module_function.rs: -------------------------------------------------------------------------------- 1 | mod bar { 2 | pub fn foo() { 3 | } 4 | } 5 | 6 | fn main() { 7 | bar::foo(); 8 | } 9 | -------------------------------------------------------------------------------- /tests/function/basic_module_function_out.rs: -------------------------------------------------------------------------------- 1 | mod bar { 2 | pub fn bar() { 3 | } 4 | } 5 | 6 | fn main() { 7 | bar::bar(); 8 | } 9 | -------------------------------------------------------------------------------- /tests/function/basic_trait_function.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/function/basic_trait_function.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,10,file_col_end,0,extent_end,115,extent_end_bytes,115,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/function/basic_trait_function.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/function/basic_trait_function.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/function/basic_trait_function.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/function/basic_trait_function.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/function/basic_trait_function.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/function/basic_trait_function.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/function/basic_trait_function.rs" 9 | end_external_crates 10 | type_ref,file_name,"tests/function/basic_trait_function.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,refid,"154037",refidcrate,"2",qualname,"",scopeid,"0" 11 | use_alias,file_name,"tests/function/basic_trait_function.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,id,"4",refid,"154037",refidcrate,"2",name,"Debug",scopeid,"0" 12 | mod_ref,file_name,"tests/function/basic_trait_function.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,refid,"0",refidcrate,"0",qualname,"::std",scopeid,"0" 13 | mod_ref,file_name,"tests/function/basic_trait_function.rs",file_line,1,file_col,9,extent_start,9,extent_start_bytes,9,file_line_end,1,file_col_end,12,extent_end,12,extent_end_bytes,12,refid,"0",refidcrate,"0",qualname,"std::fmt",scopeid,"0" 14 | function,file_name,"tests/function/basic_trait_function.rs",file_line,3,file_col,3,extent_start,25,extent_start_bytes,25,file_line_end,3,file_col_end,6,extent_end,28,extent_end_bytes,28,id,"5",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 15 | variable,file_name,"tests/function/basic_trait_function.rs",file_line,3,file_col,7,extent_start,29,extent_start_bytes,29,file_line_end,3,file_col_end,8,extent_end,30,extent_end_bytes,30,id,"7",name,"x",qualname,"::foo::x",value,"",type,"&core::fmt::Debug",scopeid,"0" 16 | type_ref,file_name,"tests/function/basic_trait_function.rs",file_line,3,file_col,11,extent_start,33,extent_start_bytes,33,file_line_end,3,file_col_end,16,extent_end,38,extent_end_bytes,38,refid,"154037",refidcrate,"2",qualname,"",scopeid,"0" 17 | function,file_name,"tests/function/basic_trait_function.rs",file_line,7,file_col,3,extent_start,73,extent_start_bytes,73,file_line_end,7,file_col_end,7,extent_end,77,extent_end_bytes,77,id,"44",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 18 | fn_call,file_name,"tests/function/basic_trait_function.rs",file_line,8,file_col,4,extent_start,86,extent_start_bytes,86,file_line_end,8,file_col_end,7,extent_end,89,extent_end_bytes,89,refid,"5",refidcrate,"0",qualname,"",scopeid,"46" 19 | fn_call,file_name,"tests/function/basic_trait_function.rs",file_line,9,file_col,4,extent_start,99,extent_start_bytes,99,file_line_end,9,file_col_end,7,extent_end,102,extent_end_bytes,102,refid,"5",refidcrate,"0",qualname,"",scopeid,"46" 20 | -------------------------------------------------------------------------------- /tests/function/basic_trait_function.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo(x: &Debug) { 4 | println!("{:?}", x); 5 | } 6 | 7 | fn main() { 8 | foo(&2); 9 | foo(&"STRING"); 10 | } 11 | -------------------------------------------------------------------------------- /tests/function/basic_trait_function_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn bar(x: &Debug) { 4 | println!("{:?}", x); 5 | } 6 | 7 | fn main() { 8 | bar(&2); 9 | bar(&"STRING"); 10 | } 11 | -------------------------------------------------------------------------------- /tests/function/basic_use_function.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/function/basic_use_function.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,10,file_col_end,0,extent_end,76,extent_end_bytes,76,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/function/basic_use_function.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/function/basic_use_function.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/function/basic_use_function.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/function/basic_use_function.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/function/basic_use_function.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/function/basic_use_function.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/function/basic_use_function.rs" 9 | end_external_crates 10 | module,file_name,"tests/function/basic_use_function.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::bar",scopeid,"0",def_file,"tests/function/basic_use_function.rs" 11 | function,file_name,"tests/function/basic_use_function.rs",file_line,2,file_col,11,extent_start,21,extent_start_bytes,21,file_line_end,2,file_col_end,14,extent_end,24,extent_end_bytes,24,id,"6",qualname,"::bar::foo",declid,"",declidcrate,"",scopeid,"4" 12 | fn_ref,file_name,"tests/function/basic_use_function.rs",file_line,6,file_col,9,extent_start,47,extent_start_bytes,47,file_line_end,6,file_col_end,12,extent_end,50,extent_end_bytes,50,refid,"6",refidcrate,"0",qualname,"",scopeid,"0" 13 | use_alias,file_name,"tests/function/basic_use_function.rs",file_line,6,file_col,9,extent_start,47,extent_start_bytes,47,file_line_end,6,file_col_end,12,extent_end,50,extent_end_bytes,50,id,"9",refid,"6",refidcrate,"0",name,"foo",scopeid,"0" 14 | mod_ref,file_name,"tests/function/basic_use_function.rs",file_line,6,file_col,4,extent_start,42,extent_start_bytes,42,file_line_end,6,file_col_end,7,extent_end,45,extent_end_bytes,45,refid,"0",refidcrate,"0",qualname,"::bar",scopeid,"0" 15 | function,file_name,"tests/function/basic_use_function.rs",file_line,8,file_col,3,extent_start,56,extent_start_bytes,56,file_line_end,8,file_col_end,7,extent_end,60,extent_end_bytes,60,id,"10",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 16 | fn_call,file_name,"tests/function/basic_use_function.rs",file_line,9,file_col,4,extent_start,69,extent_start_bytes,69,file_line_end,9,file_col_end,7,extent_end,72,extent_end_bytes,72,refid,"6",refidcrate,"0",qualname,"",scopeid,"12" 17 | -------------------------------------------------------------------------------- /tests/function/basic_use_function.rs: -------------------------------------------------------------------------------- 1 | mod bar { 2 | pub fn foo() { 3 | } 4 | } 5 | 6 | use bar::foo; 7 | 8 | fn main() { 9 | foo(); 10 | } 11 | -------------------------------------------------------------------------------- /tests/function/basic_use_function_out.rs: -------------------------------------------------------------------------------- 1 | mod bar { 2 | pub fn bar() { 3 | } 4 | } 5 | 6 | use bar::bar; 7 | 8 | fn main() { 9 | bar(); 10 | } 11 | -------------------------------------------------------------------------------- /tests/function/conflict_fn_with_var.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/function/conflict_fn_with_var.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,6,file_col_end,0,extent_end,73,extent_end_bytes,73,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/function/conflict_fn_with_var.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/function/conflict_fn_with_var.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/function/conflict_fn_with_var.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/function/conflict_fn_with_var.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/function/conflict_fn_with_var.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/function/conflict_fn_with_var.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/function/conflict_fn_with_var.rs" 9 | end_external_crates 10 | function,file_name,"tests/function/conflict_fn_with_var.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | function,file_name,"tests/function/conflict_fn_with_var.rs",file_line,2,file_col,7,extent_start,19,extent_start_bytes,19,file_line_end,2,file_col_end,10,extent_end,22,extent_end_bytes,22,id,"8",qualname,"::main::foo",declid,"",declidcrate,"",scopeid,"6" 12 | variable,file_name,"tests/function/conflict_fn_with_var.rs",file_line,3,file_col,8,extent_start,36,extent_start_bytes,36,file_line_end,3,file_col_end,9,extent_end,37,extent_end_bytes,37,id,"13",name,"a",qualname,"a$13",value,"a = 2",type,"i32",scopeid,"0" 13 | fn_call,file_name,"tests/function/conflict_fn_with_var.rs",file_line,4,file_col,4,extent_start,47,extent_start_bytes,47,file_line_end,4,file_col_end,7,extent_end,50,extent_end_bytes,50,refid,"8",refidcrate,"0",qualname,"",scopeid,"6" 14 | var_ref,file_name,"tests/function/conflict_fn_with_var.rs",file_line,5,file_col,16,extent_start,70,extent_start_bytes,70,file_line_end,5,file_col_end,17,extent_end,71,extent_end_bytes,71,refid,"13",refidcrate,"0",qualname,"",scopeid,"6" 15 | -------------------------------------------------------------------------------- /tests/function/conflict_fn_with_var.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | fn foo() {} 3 | let a = 2; 4 | foo(); 5 | let _ = 3 + a; 6 | } 7 | -------------------------------------------------------------------------------- /tests/function/conflict_module_function.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/function/conflict_module_function.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,11,file_col_end,0,extent_end,92,extent_end_bytes,92,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/function/conflict_module_function.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/function/conflict_module_function.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/function/conflict_module_function.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/function/conflict_module_function.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/function/conflict_module_function.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/function/conflict_module_function.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/function/conflict_module_function.rs" 9 | end_external_crates 10 | module,file_name,"tests/function/conflict_module_function.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::bar",scopeid,"0",def_file,"tests/function/conflict_module_function.rs" 11 | function,file_name,"tests/function/conflict_module_function.rs",file_line,2,file_col,11,extent_start,21,extent_start_bytes,21,file_line_end,2,file_col_end,14,extent_end,24,extent_end_bytes,24,id,"6",qualname,"::bar::foo",declid,"",declidcrate,"",scopeid,"4" 12 | function,file_name,"tests/function/conflict_module_function.rs",file_line,5,file_col,11,extent_start,47,extent_start_bytes,47,file_line_end,5,file_col_end,14,extent_end,50,extent_end_bytes,50,id,"9",qualname,"::bar::bar",declid,"",declidcrate,"",scopeid,"4" 13 | function,file_name,"tests/function/conflict_module_function.rs",file_line,9,file_col,3,extent_start,67,extent_start_bytes,67,file_line_end,9,file_col_end,7,extent_end,71,extent_end_bytes,71,id,"12",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 14 | fn_call,file_name,"tests/function/conflict_module_function.rs",file_line,10,file_col,9,extent_start,85,extent_start_bytes,85,file_line_end,10,file_col_end,12,extent_end,88,extent_end_bytes,88,refid,"6",refidcrate,"0",qualname,"",scopeid,"14" 15 | mod_ref,file_name,"tests/function/conflict_module_function.rs",file_line,10,file_col,4,extent_start,80,extent_start_bytes,80,file_line_end,10,file_col_end,7,extent_end,83,extent_end_bytes,83,refid,"0",refidcrate,"0",qualname,"bar",scopeid,"12" 16 | -------------------------------------------------------------------------------- /tests/function/conflict_module_function.rs: -------------------------------------------------------------------------------- 1 | mod bar { 2 | pub fn foo() { 3 | } 4 | 5 | pub fn bar() { 6 | } 7 | } 8 | 9 | fn main() { 10 | bar::foo(); 11 | } 12 | -------------------------------------------------------------------------------- /tests/function/extern_function.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/function/extern_function.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,6,file_col_end,0,extent_end,44,extent_end_bytes,44,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/function/extern_function.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/function/extern_function.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/function/extern_function.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/function/extern_function.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/function/extern_function.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/function/extern_function.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/function/extern_function.rs" 9 | end_external_crates 10 | function,file_name,"tests/function/extern_function.rs",file_line,1,file_col,10,extent_start,10,extent_start_bytes,10,file_line_end,1,file_col_end,13,extent_end,13,extent_end_bytes,13,id,"4",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 11 | function,file_name,"tests/function/extern_function.rs",file_line,4,file_col,3,extent_start,24,extent_start_bytes,24,file_line_end,4,file_col_end,7,extent_end,28,extent_end_bytes,28,id,"7",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 12 | fn_call,file_name,"tests/function/extern_function.rs",file_line,5,file_col,4,extent_start,37,extent_start_bytes,37,file_line_end,5,file_col_end,7,extent_end,40,extent_end_bytes,40,refid,"4",refidcrate,"0",qualname,"",scopeid,"9" 13 | -------------------------------------------------------------------------------- /tests/function/extern_function.rs: -------------------------------------------------------------------------------- 1 | extern fn foo() { 2 | } 3 | 4 | fn main() { 5 | foo(); 6 | } 7 | -------------------------------------------------------------------------------- /tests/function/extern_function_out.rs: -------------------------------------------------------------------------------- 1 | extern fn bar() { 2 | } 3 | 4 | fn main() { 5 | bar(); 6 | } 7 | -------------------------------------------------------------------------------- /tests/function/extern_stdcall_function.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/function/extern_stdcall_function.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,6,file_col_end,0,extent_end,54,extent_end_bytes,54,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/function/extern_stdcall_function.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/function/extern_stdcall_function.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/function/extern_stdcall_function.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/function/extern_stdcall_function.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/function/extern_stdcall_function.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/function/extern_stdcall_function.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/function/extern_stdcall_function.rs" 9 | end_external_crates 10 | function,file_name,"tests/function/extern_stdcall_function.rs",file_line,1,file_col,20,extent_start,20,extent_start_bytes,20,file_line_end,1,file_col_end,23,extent_end,23,extent_end_bytes,23,id,"4",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 11 | function,file_name,"tests/function/extern_stdcall_function.rs",file_line,4,file_col,3,extent_start,34,extent_start_bytes,34,file_line_end,4,file_col_end,7,extent_end,38,extent_end_bytes,38,id,"7",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 12 | fn_call,file_name,"tests/function/extern_stdcall_function.rs",file_line,5,file_col,4,extent_start,47,extent_start_bytes,47,file_line_end,5,file_col_end,7,extent_end,50,extent_end_bytes,50,refid,"4",refidcrate,"0",qualname,"",scopeid,"9" 13 | -------------------------------------------------------------------------------- /tests/function/extern_stdcall_function.rs: -------------------------------------------------------------------------------- 1 | extern "stdcall" fn foo() { 2 | } 3 | 4 | fn main() { 5 | foo(); 6 | } 7 | -------------------------------------------------------------------------------- /tests/function/extern_stdcall_function_out.rs: -------------------------------------------------------------------------------- 1 | extern "stdcall" fn bar() { 2 | } 3 | 4 | fn main() { 5 | bar(); 6 | } 7 | -------------------------------------------------------------------------------- /tests/function/fn_local_mod.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/function/fn_local_mod.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,7,file_col_end,0,extent_end,82,extent_end_bytes,82,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/function/fn_local_mod.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/function/fn_local_mod.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/function/fn_local_mod.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/function/fn_local_mod.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/function/fn_local_mod.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/function/fn_local_mod.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/function/fn_local_mod.rs" 9 | end_external_crates 10 | function,file_name,"tests/function/fn_local_mod.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | module,file_name,"tests/function/fn_local_mod.rs",file_line,2,file_col,8,extent_start,20,extent_start_bytes,20,file_line_end,2,file_col_end,11,extent_end,23,extent_end_bytes,23,id,"8",qualname,"::main::foo",scopeid,"6",def_file,"tests/function/fn_local_mod.rs" 12 | function,file_name,"tests/function/fn_local_mod.rs",file_line,3,file_col,15,extent_start,41,extent_start_bytes,41,file_line_end,3,file_col_end,18,extent_end,44,extent_end_bytes,44,id,"10",qualname,"::main::foo::foo",declid,"",declidcrate,"",scopeid,"8" 13 | fn_call,file_name,"tests/function/fn_local_mod.rs",file_line,6,file_col,9,extent_start,75,extent_start_bytes,75,file_line_end,6,file_col_end,12,extent_end,78,extent_end_bytes,78,refid,"10",refidcrate,"0",qualname,"",scopeid,"6" 14 | mod_ref,file_name,"tests/function/fn_local_mod.rs",file_line,6,file_col,4,extent_start,70,extent_start_bytes,70,file_line_end,6,file_col_end,7,extent_end,73,extent_end_bytes,73,refid,"0",refidcrate,"0",qualname,"foo",scopeid,"4" 15 | -------------------------------------------------------------------------------- /tests/function/fn_local_mod.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | mod foo { 3 | pub fn foo () { 4 | } 5 | } 6 | foo::foo(); 7 | } 8 | -------------------------------------------------------------------------------- /tests/function/fn_local_mod_after.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/function/fn_local_mod_after.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,7,file_col_end,0,extent_end,82,extent_end_bytes,82,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/function/fn_local_mod_after.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/function/fn_local_mod_after.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/function/fn_local_mod_after.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/function/fn_local_mod_after.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/function/fn_local_mod_after.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/function/fn_local_mod_after.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/function/fn_local_mod_after.rs" 9 | end_external_crates 10 | function,file_name,"tests/function/fn_local_mod_after.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | fn_call,file_name,"tests/function/fn_local_mod_after.rs",file_line,2,file_col,9,extent_start,21,extent_start_bytes,21,file_line_end,2,file_col_end,12,extent_end,24,extent_end_bytes,24,refid,"13",refidcrate,"0",qualname,"",scopeid,"6" 12 | mod_ref,file_name,"tests/function/fn_local_mod_after.rs",file_line,2,file_col,4,extent_start,16,extent_start_bytes,16,file_line_end,2,file_col_end,7,extent_end,19,extent_end_bytes,19,refid,"0",refidcrate,"0",qualname,"foo",scopeid,"4" 13 | module,file_name,"tests/function/fn_local_mod_after.rs",file_line,3,file_col,8,extent_start,36,extent_start_bytes,36,file_line_end,3,file_col_end,11,extent_end,39,extent_end_bytes,39,id,"11",qualname,"::main::foo",scopeid,"6",def_file,"tests/function/fn_local_mod_after.rs" 14 | function,file_name,"tests/function/fn_local_mod_after.rs",file_line,4,file_col,15,extent_start,57,extent_start_bytes,57,file_line_end,4,file_col_end,18,extent_end,60,extent_end_bytes,60,id,"13",qualname,"::main::foo::foo",declid,"",declidcrate,"",scopeid,"11" 15 | -------------------------------------------------------------------------------- /tests/function/fn_local_mod_after.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | foo::foo(); 3 | mod foo { 4 | pub fn foo () { 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/function/fn_local_mod_after_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | foo::bar(); 3 | mod foo { 4 | pub fn bar () { 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/function/fn_local_mod_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | mod foo { 3 | pub fn bar () { 4 | } 5 | } 6 | foo::bar(); 7 | } 8 | -------------------------------------------------------------------------------- /tests/function/impl_override_method.rs: -------------------------------------------------------------------------------- 1 | trait Foo { 2 | fn foo(&self) { println!("FOO"); } 3 | } 4 | 5 | struct Bar; 6 | impl Foo for Bar { 7 | fn foo(&self) { println!("BAR"); } 8 | } 9 | 10 | fn main() { 11 | let x = Bar; 12 | x.foo(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/function/working_method_1_out.rs: -------------------------------------------------------------------------------- 1 | trait Foo { 2 | fn func(&self) { println!("FOO"); } 3 | } 4 | 5 | struct Bar; 6 | impl Foo for Bar { 7 | } 8 | 9 | fn main() { 10 | let x = Bar; 11 | x.func(); 12 | } 13 | -------------------------------------------------------------------------------- /tests/function/working_method_2_out.rs: -------------------------------------------------------------------------------- 1 | trait Foo { 2 | fn func(&self) { println!("FOO"); } 3 | } 4 | 5 | struct Bar; 6 | impl Foo for Bar { 7 | fn func(&self) { println!("BAR"); } 8 | } 9 | 10 | fn main() { 11 | let x = Bar; 12 | x.func(); 13 | } 14 | -------------------------------------------------------------------------------- /tests/inline/inline.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = 2; 3 | let b = a + 1; 4 | println!("{}", b); 5 | } 6 | -------------------------------------------------------------------------------- /tests/inline/inline3.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/inline/inline3.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,4,file_col_end,0,extent_end,50,extent_end_bytes,50,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/inline/inline3.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/inline/inline3.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/inline/inline3.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/inline/inline3.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/inline/inline3.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/inline/inline3.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/inline/inline3.rs" 9 | end_external_crates 10 | function,file_name,"tests/inline/inline3.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/inline/inline3.rs",file_line,2,file_col,8,extent_start,20,extent_start_bytes,20,file_line_end,2,file_col_end,9,extent_end,21,extent_end_bytes,21,id,"9",name,"a",qualname,"a$9",value,"a = 2 + 1",type,"i32",scopeid,"0" 12 | var_ref,file_name,"tests/inline/inline3.rs",file_line,3,file_col,12,extent_start,43,extent_start_bytes,43,file_line_end,3,file_col_end,13,extent_end,44,extent_end_bytes,44,refid,"9",refidcrate,"0",qualname,"",scopeid,"6" 13 | -------------------------------------------------------------------------------- /tests/inline/inline3.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = 2 + 1; 3 | let _ = a * 2; 4 | } 5 | -------------------------------------------------------------------------------- /tests/inline/inline3_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { let _ = (2 + 1) * 2; } 2 | -------------------------------------------------------------------------------- /tests/inline/inline4.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/inline/inline4.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,4,file_col_end,0,extent_end,55,extent_end_bytes,55,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/inline/inline4.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/inline/inline4.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/inline/inline4.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/inline/inline4.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/inline/inline4.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/inline/inline4.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/inline/inline4.rs" 9 | end_external_crates 10 | function,file_name,"tests/inline/inline4.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/inline/inline4.rs",file_line,2,file_col,8,extent_start,20,extent_start_bytes,20,file_line_end,2,file_col_end,9,extent_end,21,extent_end_bytes,21,id,"9",name,"a",qualname,"a$9",value,"a = 1 + 2",type,"i32",scopeid,"0" 12 | var_ref,file_name,"tests/inline/inline4.rs",file_line,3,file_col,12,extent_start,43,extent_start_bytes,43,file_line_end,3,file_col_end,13,extent_end,44,extent_end_bytes,44,refid,"9",refidcrate,"0",qualname,"",scopeid,"6" 13 | -------------------------------------------------------------------------------- /tests/inline/inline4.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = 1 + 2; 3 | let _ = a as usize; 4 | } 5 | -------------------------------------------------------------------------------- /tests/inline/inline4_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { let _ = (1 + 2) as usize; } 2 | -------------------------------------------------------------------------------- /tests/inline/inline5.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/inline/inline5.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,4,file_col_end,0,extent_end,58,extent_end_bytes,58,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/inline/inline5.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/inline/inline5.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/inline/inline5.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/inline/inline5.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/inline/inline5.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/inline/inline5.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/inline/inline5.rs" 9 | end_external_crates 10 | function,file_name,"tests/inline/inline5.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/inline/inline5.rs",file_line,2,file_col,8,extent_start,20,extent_start_bytes,20,file_line_end,2,file_col_end,9,extent_end,21,extent_end_bytes,21,id,"9",name,"a",qualname,"a$9",value,"a = 1 + 2 + 3 + 4",type,"i32",scopeid,"0" 12 | var_ref,file_name,"tests/inline/inline5.rs",file_line,3,file_col,16,extent_start,55,extent_start_bytes,55,file_line_end,3,file_col_end,17,extent_end,56,extent_end_bytes,56,refid,"9",refidcrate,"0",qualname,"",scopeid,"6" 13 | -------------------------------------------------------------------------------- /tests/inline/inline5.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = 1 + 2 + 3 + 4; 3 | let _ = 2 * a; 4 | } 5 | -------------------------------------------------------------------------------- /tests/inline/inline5_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { let _ = 2 * (1 + 2 + 3 + 4); } 2 | -------------------------------------------------------------------------------- /tests/inline/inline6.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/inline/inline6.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,4,file_col_end,0,extent_end,61,extent_end_bytes,61,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/inline/inline6.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/inline/inline6.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/inline/inline6.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/inline/inline6.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/inline/inline6.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/inline/inline6.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/inline/inline6.rs" 9 | end_external_crates 10 | function,file_name,"tests/inline/inline6.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/inline/inline6.rs",file_line,2,file_col,8,extent_start,20,extent_start_bytes,20,file_line_end,2,file_col_end,9,extent_end,21,extent_end_bytes,21,id,"9",name,"a",qualname,"a$9",value,"a = &""hello""",type,"&&str",scopeid,"0" 12 | method_call,file_name,"tests/inline/inline6.rs",file_line,3,file_col,14,extent_start,48,extent_start_bytes,48,file_line_end,3,file_col_end,23,extent_end,57,extent_end_bytes,57,refid,"0",refidcrate,"0",declid,"30226",declidcrate,"3",scopeid,"6" 13 | var_ref,file_name,"tests/inline/inline6.rs",file_line,3,file_col,12,extent_start,46,extent_start_bytes,46,file_line_end,3,file_col_end,13,extent_end,47,extent_end_bytes,47,refid,"9",refidcrate,"0",qualname,"",scopeid,"6" 14 | -------------------------------------------------------------------------------- /tests/inline/inline6.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = &"hello"; 3 | let _ = a.to_string(); 4 | } 5 | -------------------------------------------------------------------------------- /tests/inline/inline6_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { let _ = &"hello".to_string(); } 2 | -------------------------------------------------------------------------------- /tests/inline/inline7.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/inline/inline7.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,4,file_col_end,0,extent_end,52,extent_end_bytes,52,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/inline/inline7.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/inline/inline7.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/inline/inline7.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/inline/inline7.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/inline/inline7.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/inline/inline7.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/inline/inline7.rs" 9 | end_external_crates 10 | function,file_name,"tests/inline/inline7.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/inline/inline7.rs",file_line,2,file_col,8,extent_start,20,extent_start_bytes,20,file_line_end,2,file_col_end,9,extent_end,21,extent_end_bytes,21,id,"9",name,"a",qualname,"a$9",value,"a = 1 + 2",type,"i32",scopeid,"0" 12 | variable,file_name,"tests/inline/inline7.rs",file_line,3,file_col,8,extent_start,39,extent_start_bytes,39,file_line_end,3,file_col_end,9,extent_end,40,extent_end_bytes,40,id,"15",name,"b",qualname,"b$15",value,"b = (a) * 2",type,"i32",scopeid,"0" 13 | var_ref,file_name,"tests/inline/inline7.rs",file_line,3,file_col,13,extent_start,44,extent_start_bytes,44,file_line_end,3,file_col_end,14,extent_end,45,extent_end_bytes,45,refid,"9",refidcrate,"0",qualname,"",scopeid,"6" 14 | -------------------------------------------------------------------------------- /tests/inline/inline7.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = 1 + 2; 3 | let b = (a) * 2; 4 | } 5 | -------------------------------------------------------------------------------- /tests/inline/inline7_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { let b = (1 + 2) * 2; } 2 | -------------------------------------------------------------------------------- /tests/inline/inline8.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/inline/inline8.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,4,file_col_end,0,extent_end,97,extent_end_bytes,97,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/inline/inline8.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/inline/inline8.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/inline/inline8.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/inline/inline8.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/inline/inline8.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/inline/inline8.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/inline/inline8.rs" 9 | end_external_crates 10 | function,file_name,"tests/inline/inline8.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/inline/inline8.rs",file_line,2,file_col,8,extent_start,20,extent_start_bytes,20,file_line_end,2,file_col_end,9,extent_end,21,extent_end_bytes,21,id,"9",name,"a",qualname,"a$9",value,"a = /* comment */ 2 + 1",type,"i32",scopeid,"0" 12 | var_ref,file_name,"tests/inline/inline8.rs",file_line,3,file_col,26,extent_start,90,extent_start_bytes,90,file_line_end,3,file_col_end,27,extent_end,91,extent_end_bytes,91,refid,"9",refidcrate,"0",qualname,"",scopeid,"6" 13 | -------------------------------------------------------------------------------- /tests/inline/inline8.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = /* comment */ 2 + 1; // Another comment 3 | let _ = /* comment */ a * 2; 4 | } 5 | -------------------------------------------------------------------------------- /tests/inline/inline8_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | /* comment */ 3 | // Another comment 4 | let _ = /* comment */(2 + 1) * 2; 5 | } 6 | -------------------------------------------------------------------------------- /tests/inline/inline_single.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/inline/inline_single.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,4,file_col_end,0,extent_end,46,extent_end_bytes,46,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/inline/inline_single.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/inline/inline_single.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/inline/inline_single.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/inline/inline_single.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/inline/inline_single.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/inline/inline_single.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/inline/inline_single.rs" 9 | end_external_crates 10 | function,file_name,"tests/inline/inline_single.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/inline/inline_single.rs",file_line,2,file_col,8,extent_start,20,extent_start_bytes,20,file_line_end,2,file_col_end,9,extent_end,21,extent_end_bytes,21,id,"9",name,"a",qualname,"a$9",value,"a = 2",type,"i32",scopeid,"0" 12 | var_ref,file_name,"tests/inline/inline_single.rs",file_line,3,file_col,12,extent_start,39,extent_start_bytes,39,file_line_end,3,file_col_end,13,extent_end,40,extent_end_bytes,40,refid,"9",refidcrate,"0",qualname,"",scopeid,"6" 13 | -------------------------------------------------------------------------------- /tests/inline/inline_single.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = 2; 3 | let _ = a + 1; 4 | } 5 | -------------------------------------------------------------------------------- /tests/inline/inline_single_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { let _ = 2 + 1; } 2 | -------------------------------------------------------------------------------- /tests/lifetime/elide_multi_anon_self_ret.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | struct Point; 4 | 5 | impl Point { 6 | fn foo<'b, 'c>(&self, x: &'b Debug, y: &'c Debug) -> &Point { 7 | println!("{:?} {:?}", x, y); 8 | self 9 | } 10 | } 11 | 12 | fn main() { 13 | let p = Point; 14 | p.foo(&2, &2); 15 | p.foo(&"STRING", &"STRING"); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/lifetime/elide_multi_anon_self_ret_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | struct Point; 4 | 5 | impl Point { 6 | fn foo(&self, x: &Debug, y: &Debug) -> &Point { 7 | println!("{:?} {:?}", x, y); 8 | self 9 | } 10 | } 11 | 12 | fn main() { 13 | let p = Point; 14 | p.foo(&2, &2); 15 | p.foo(&"STRING", &"STRING"); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/lifetime/elide_multi_in.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/lifetime/elide_multi_in.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,10,file_col_end,0,extent_end,163,extent_end_bytes,163,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/lifetime/elide_multi_in.rs" 3 | external_crate,name,"libc",crate,"7",file_name,"tests/lifetime/elide_multi_in.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/lifetime/elide_multi_in.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/lifetime/elide_multi_in.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/lifetime/elide_multi_in.rs" 7 | external_crate,name,"rand",crate,"6",file_name,"tests/lifetime/elide_multi_in.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/lifetime/elide_multi_in.rs" 9 | external_crate,name,"alloc_jemalloc",crate,"8",file_name,"tests/lifetime/elide_multi_in.rs" 10 | end_external_crates 11 | type_ref,file_name,"tests/lifetime/elide_multi_in.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 12 | use_alias,file_name,"tests/lifetime/elide_multi_in.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,id,"4",refid,"164184",refidcrate,"2",name,"Debug",scopeid,"0" 13 | mod_ref,file_name,"tests/lifetime/elide_multi_in.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,refid,"0",refidcrate,"0",qualname,"::std",scopeid,"0" 14 | mod_ref,file_name,"tests/lifetime/elide_multi_in.rs",file_line,1,file_col,9,extent_start,9,extent_start_bytes,9,file_line_end,1,file_col_end,12,extent_end,12,extent_end_bytes,12,refid,"0",refidcrate,"0",qualname,"std::fmt",scopeid,"0" 15 | function,file_name,"tests/lifetime/elide_multi_in.rs",file_line,3,file_col,3,extent_start,25,extent_start_bytes,25,file_line_end,3,file_col_end,6,extent_end,28,extent_end_bytes,28,id,"5",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 16 | variable,file_name,"tests/lifetime/elide_multi_in.rs",file_line,3,file_col,15,extent_start,37,extent_start_bytes,37,file_line_end,3,file_col_end,16,extent_end,38,extent_end_bytes,38,id,"7",name,"x",qualname,"::foo::x",value,"",type,"&'a core::fmt::Debug + 'a",scopeid,"0" 17 | variable,file_name,"tests/lifetime/elide_multi_in.rs",file_line,3,file_col,29,extent_start,51,extent_start_bytes,51,file_line_end,3,file_col_end,30,extent_end,52,extent_end_bytes,52,id,"12",name,"y",qualname,"::foo::y",value,"",type,"&'b core::fmt::Debug + 'b",scopeid,"0" 18 | type_ref,file_name,"tests/lifetime/elide_multi_in.rs",file_line,3,file_col,22,extent_start,44,extent_start_bytes,44,file_line_end,3,file_col_end,27,extent_end,49,extent_end_bytes,49,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 19 | type_ref,file_name,"tests/lifetime/elide_multi_in.rs",file_line,3,file_col,36,extent_start,58,extent_start_bytes,58,file_line_end,3,file_col_end,41,extent_end,63,extent_end_bytes,63,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 20 | function,file_name,"tests/lifetime/elide_multi_in.rs",file_line,7,file_col,3,extent_start,106,extent_start_bytes,106,file_line_end,7,file_col_end,7,extent_end,110,extent_end_bytes,110,id,"60",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 21 | fn_call,file_name,"tests/lifetime/elide_multi_in.rs",file_line,8,file_col,4,extent_start,119,extent_start_bytes,119,file_line_end,8,file_col_end,7,extent_end,122,extent_end_bytes,122,refid,"5",refidcrate,"0",qualname,"",scopeid,"62" 22 | fn_call,file_name,"tests/lifetime/elide_multi_in.rs",file_line,9,file_col,4,extent_start,136,extent_start_bytes,136,file_line_end,9,file_col_end,7,extent_end,139,extent_end_bytes,139,refid,"5",refidcrate,"0",qualname,"",scopeid,"62" 23 | -------------------------------------------------------------------------------- /tests/lifetime/elide_multi_in.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo<'a, 'b>(x: &'a Debug, y: &'b Debug) { 4 | println!("{:?} {:?}", x, y); 5 | } 6 | 7 | fn main() { 8 | foo(&2, &2); 9 | foo(&"STRING", &"STRING"); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/lifetime/elide_multi_in_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo(x: &Debug, y: &Debug) { 4 | println!("{:?} {:?}", x, y); 5 | } 6 | 7 | fn main() { 8 | foo(&2, &2); 9 | foo(&"STRING", &"STRING"); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/lifetime/elide_multi_named_self_ret.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | struct Point; 4 | 5 | impl Point { 6 | fn foo<'b, 'c, 'a>(&'a self, x: &'b Debug, y: &'c Debug) -> &'a Point { 7 | println!("{:?} {:?}", x, y); 8 | self 9 | } 10 | } 11 | 12 | fn main() { 13 | let p = Point; 14 | p.foo(&2, &2); 15 | p.foo(&"STRING", &"STRING"); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/lifetime/elide_multi_named_self_ret_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | struct Point; 4 | 5 | impl Point { 6 | fn foo(&self, x: &Debug, y: &Debug) -> &Point { 7 | println!("{:?} {:?}", x, y); 8 | self 9 | } 10 | } 11 | 12 | fn main() { 13 | let p = Point; 14 | p.foo(&2, &2); 15 | p.foo(&"STRING", &"STRING"); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/lifetime/elide_multi_static_self_ret.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | struct Point; 4 | 5 | impl Point { 6 | fn foo<'a, 'b>(&'a self, x: &'b Debug, y: &'static Debug) -> &'a Point { 7 | self 8 | } 9 | } 10 | 11 | fn main() { 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/lifetime/elide_multi_static_self_ret_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | struct Point; 4 | 5 | impl Point { 6 | fn foo(&self, x: &Debug, y: &'static Debug) -> &Point { 7 | self 8 | } 9 | } 10 | 11 | fn main() { 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/lifetime/elide_single_anon_static_ret.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/lifetime/elide_single_anon_static_ret.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,11,file_col_end,0,extent_end,123,extent_end_bytes,123,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/lifetime/elide_single_anon_static_ret.rs" 3 | external_crate,name,"libc",crate,"7",file_name,"tests/lifetime/elide_single_anon_static_ret.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/lifetime/elide_single_anon_static_ret.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/lifetime/elide_single_anon_static_ret.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/lifetime/elide_single_anon_static_ret.rs" 7 | external_crate,name,"rand",crate,"6",file_name,"tests/lifetime/elide_single_anon_static_ret.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/lifetime/elide_single_anon_static_ret.rs" 9 | external_crate,name,"alloc_jemalloc",crate,"8",file_name,"tests/lifetime/elide_single_anon_static_ret.rs" 10 | end_external_crates 11 | type_ref,file_name,"tests/lifetime/elide_single_anon_static_ret.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 12 | use_alias,file_name,"tests/lifetime/elide_single_anon_static_ret.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,id,"4",refid,"164184",refidcrate,"2",name,"Debug",scopeid,"0" 13 | mod_ref,file_name,"tests/lifetime/elide_single_anon_static_ret.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,refid,"0",refidcrate,"0",qualname,"::std",scopeid,"0" 14 | mod_ref,file_name,"tests/lifetime/elide_single_anon_static_ret.rs",file_line,1,file_col,9,extent_start,9,extent_start_bytes,9,file_line_end,1,file_col_end,12,extent_end,12,extent_end_bytes,12,refid,"0",refidcrate,"0",qualname,"std::fmt",scopeid,"0" 15 | function,file_name,"tests/lifetime/elide_single_anon_static_ret.rs",file_line,4,file_col,3,extent_start,26,extent_start_bytes,26,file_line_end,4,file_col_end,6,extent_end,29,extent_end_bytes,29,id,"5",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 16 | variable,file_name,"tests/lifetime/elide_single_anon_static_ret.rs",file_line,4,file_col,7,extent_start,30,extent_start_bytes,30,file_line_end,4,file_col_end,8,extent_end,31,extent_end_bytes,31,id,"7",name,"x",qualname,"::foo::x",value,"",type,"&core::fmt::Debug",scopeid,"0" 17 | type_ref,file_name,"tests/lifetime/elide_single_anon_static_ret.rs",file_line,4,file_col,11,extent_start,34,extent_start_bytes,34,file_line_end,4,file_col_end,16,extent_end,39,extent_end_bytes,39,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 18 | type_ref,file_name,"tests/lifetime/elide_single_anon_static_ret.rs",file_line,4,file_col,30,extent_start,53,extent_start_bytes,53,file_line_end,4,file_col_end,35,extent_end,58,extent_end_bytes,58,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 19 | function,file_name,"tests/lifetime/elide_single_anon_static_ret.rs",file_line,8,file_col,3,extent_start,81,extent_start_bytes,81,file_line_end,8,file_col_end,7,extent_end,85,extent_end_bytes,85,id,"37",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 20 | fn_call,file_name,"tests/lifetime/elide_single_anon_static_ret.rs",file_line,9,file_col,4,extent_start,94,extent_start_bytes,94,file_line_end,9,file_col_end,7,extent_end,97,extent_end_bytes,97,refid,"5",refidcrate,"0",qualname,"",scopeid,"39" 21 | fn_call,file_name,"tests/lifetime/elide_single_anon_static_ret.rs",file_line,10,file_col,4,extent_start,107,extent_start_bytes,107,file_line_end,10,file_col_end,7,extent_end,110,extent_end_bytes,110,refid,"5",refidcrate,"0",qualname,"",scopeid,"39" 22 | -------------------------------------------------------------------------------- /tests/lifetime/elide_single_anon_static_ret.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | 4 | fn foo(x: &Debug) -> &'static Debug { 5 | panic!(); 6 | } 7 | 8 | fn main() { 9 | foo(&2); 10 | foo(&"STRING"); 11 | } 12 | -------------------------------------------------------------------------------- /tests/lifetime/elide_single_in.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/lifetime/elide_single_in.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,10,file_col_end,0,extent_end,122,extent_end_bytes,122,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/lifetime/elide_single_in.rs" 3 | external_crate,name,"libc",crate,"7",file_name,"tests/lifetime/elide_single_in.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/lifetime/elide_single_in.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/lifetime/elide_single_in.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/lifetime/elide_single_in.rs" 7 | external_crate,name,"rand",crate,"6",file_name,"tests/lifetime/elide_single_in.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/lifetime/elide_single_in.rs" 9 | external_crate,name,"alloc_jemalloc",crate,"8",file_name,"tests/lifetime/elide_single_in.rs" 10 | end_external_crates 11 | type_ref,file_name,"tests/lifetime/elide_single_in.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 12 | use_alias,file_name,"tests/lifetime/elide_single_in.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,id,"4",refid,"164184",refidcrate,"2",name,"Debug",scopeid,"0" 13 | mod_ref,file_name,"tests/lifetime/elide_single_in.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,refid,"0",refidcrate,"0",qualname,"::std",scopeid,"0" 14 | mod_ref,file_name,"tests/lifetime/elide_single_in.rs",file_line,1,file_col,9,extent_start,9,extent_start_bytes,9,file_line_end,1,file_col_end,12,extent_end,12,extent_end_bytes,12,refid,"0",refidcrate,"0",qualname,"std::fmt",scopeid,"0" 15 | function,file_name,"tests/lifetime/elide_single_in.rs",file_line,3,file_col,3,extent_start,25,extent_start_bytes,25,file_line_end,3,file_col_end,6,extent_end,28,extent_end_bytes,28,id,"5",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 16 | variable,file_name,"tests/lifetime/elide_single_in.rs",file_line,3,file_col,11,extent_start,33,extent_start_bytes,33,file_line_end,3,file_col_end,12,extent_end,34,extent_end_bytes,34,id,"7",name,"x",qualname,"::foo::x",value,"",type,"&'a core::fmt::Debug + 'a",scopeid,"0" 17 | type_ref,file_name,"tests/lifetime/elide_single_in.rs",file_line,3,file_col,18,extent_start,40,extent_start_bytes,40,file_line_end,3,file_col_end,23,extent_end,45,extent_end_bytes,45,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 18 | function,file_name,"tests/lifetime/elide_single_in.rs",file_line,7,file_col,3,extent_start,80,extent_start_bytes,80,file_line_end,7,file_col_end,7,extent_end,84,extent_end_bytes,84,id,"46",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 19 | fn_call,file_name,"tests/lifetime/elide_single_in.rs",file_line,8,file_col,4,extent_start,93,extent_start_bytes,93,file_line_end,8,file_col_end,7,extent_end,96,extent_end_bytes,96,refid,"5",refidcrate,"0",qualname,"",scopeid,"48" 20 | fn_call,file_name,"tests/lifetime/elide_single_in.rs",file_line,9,file_col,4,extent_start,106,extent_start_bytes,106,file_line_end,9,file_col_end,7,extent_end,109,extent_end_bytes,109,refid,"5",refidcrate,"0",qualname,"",scopeid,"48" 21 | -------------------------------------------------------------------------------- /tests/lifetime/elide_single_in.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo<'a>(x: &'a Debug) { 4 | println!("{:?}", x); 5 | } 6 | 7 | fn main() { 8 | foo(&2); 9 | foo(&"STRING"); 10 | } 11 | -------------------------------------------------------------------------------- /tests/lifetime/elide_single_in_anon_ret.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo<'a>(x: &'a Debug) -> &Debug { 4 | println!("{:?}", x); 5 | x 6 | } 7 | 8 | fn main() { 9 | foo(&2); 10 | foo(&"STRING"); 11 | } 12 | -------------------------------------------------------------------------------- /tests/lifetime/elide_single_in_anon_ret_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo(x: &Debug) -> &Debug { 4 | println!("{:?}", x); 5 | x 6 | } 7 | 8 | fn main() { 9 | foo(&2); 10 | foo(&"STRING"); 11 | } 12 | -------------------------------------------------------------------------------- /tests/lifetime/elide_single_in_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo(x: &Debug) { 4 | println!("{:?}", x); 5 | } 6 | 7 | fn main() { 8 | foo(&2); 9 | foo(&"STRING"); 10 | } 11 | -------------------------------------------------------------------------------- /tests/lifetime/elide_single_in_ret.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo<'a>(x: &'a Debug) -> &'a Debug { 4 | println!("{:?}", x); 5 | x 6 | } 7 | 8 | fn main() { 9 | foo(&2); 10 | foo(&"STRING"); 11 | } 12 | -------------------------------------------------------------------------------- /tests/lifetime/elide_single_in_ret_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo(x: &Debug) -> &Debug { 4 | println!("{:?}", x); 5 | x 6 | } 7 | 8 | fn main() { 9 | foo(&2); 10 | foo(&"STRING"); 11 | } 12 | -------------------------------------------------------------------------------- /tests/lifetime/elide_single_static_ret.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/lifetime/elide_single_static_ret.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,11,file_col_end,0,extent_end,130,extent_end_bytes,130,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/lifetime/elide_single_static_ret.rs" 3 | external_crate,name,"libc",crate,"7",file_name,"tests/lifetime/elide_single_static_ret.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/lifetime/elide_single_static_ret.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/lifetime/elide_single_static_ret.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/lifetime/elide_single_static_ret.rs" 7 | external_crate,name,"rand",crate,"6",file_name,"tests/lifetime/elide_single_static_ret.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/lifetime/elide_single_static_ret.rs" 9 | external_crate,name,"alloc_jemalloc",crate,"8",file_name,"tests/lifetime/elide_single_static_ret.rs" 10 | end_external_crates 11 | type_ref,file_name,"tests/lifetime/elide_single_static_ret.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 12 | use_alias,file_name,"tests/lifetime/elide_single_static_ret.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,id,"4",refid,"164184",refidcrate,"2",name,"Debug",scopeid,"0" 13 | mod_ref,file_name,"tests/lifetime/elide_single_static_ret.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,refid,"0",refidcrate,"0",qualname,"::std",scopeid,"0" 14 | mod_ref,file_name,"tests/lifetime/elide_single_static_ret.rs",file_line,1,file_col,9,extent_start,9,extent_start_bytes,9,file_line_end,1,file_col_end,12,extent_end,12,extent_end_bytes,12,refid,"0",refidcrate,"0",qualname,"std::fmt",scopeid,"0" 15 | function,file_name,"tests/lifetime/elide_single_static_ret.rs",file_line,4,file_col,3,extent_start,26,extent_start_bytes,26,file_line_end,4,file_col_end,6,extent_end,29,extent_end_bytes,29,id,"5",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 16 | variable,file_name,"tests/lifetime/elide_single_static_ret.rs",file_line,4,file_col,11,extent_start,34,extent_start_bytes,34,file_line_end,4,file_col_end,12,extent_end,35,extent_end_bytes,35,id,"7",name,"x",qualname,"::foo::x",value,"",type,"&'a core::fmt::Debug + 'a",scopeid,"0" 17 | type_ref,file_name,"tests/lifetime/elide_single_static_ret.rs",file_line,4,file_col,18,extent_start,41,extent_start_bytes,41,file_line_end,4,file_col_end,23,extent_end,46,extent_end_bytes,46,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 18 | type_ref,file_name,"tests/lifetime/elide_single_static_ret.rs",file_line,4,file_col,37,extent_start,60,extent_start_bytes,60,file_line_end,4,file_col_end,42,extent_end,65,extent_end_bytes,65,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 19 | function,file_name,"tests/lifetime/elide_single_static_ret.rs",file_line,8,file_col,3,extent_start,88,extent_start_bytes,88,file_line_end,8,file_col_end,7,extent_end,92,extent_end_bytes,92,id,"39",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 20 | fn_call,file_name,"tests/lifetime/elide_single_static_ret.rs",file_line,9,file_col,4,extent_start,101,extent_start_bytes,101,file_line_end,9,file_col_end,7,extent_end,104,extent_end_bytes,104,refid,"5",refidcrate,"0",qualname,"",scopeid,"41" 21 | fn_call,file_name,"tests/lifetime/elide_single_static_ret.rs",file_line,10,file_col,4,extent_start,114,extent_start_bytes,114,file_line_end,10,file_col_end,7,extent_end,117,extent_end_bytes,117,refid,"5",refidcrate,"0",qualname,"",scopeid,"41" 22 | -------------------------------------------------------------------------------- /tests/lifetime/elide_single_static_ret.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | 4 | fn foo<'a>(x: &'a Debug) -> &'static Debug { 5 | panic!(); 6 | } 7 | 8 | fn main() { 9 | foo(&2); 10 | foo(&"STRING"); 11 | } 12 | -------------------------------------------------------------------------------- /tests/lifetime/elide_single_static_ret_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | 4 | fn foo(x: &Debug) -> &'static Debug { 5 | panic!(); 6 | } 7 | 8 | fn main() { 9 | foo(&2); 10 | foo(&"STRING"); 11 | } 12 | -------------------------------------------------------------------------------- /tests/lifetime/reify_multi_in.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/lifetime/reify_multi_in.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,10,file_col_end,0,extent_end,149,extent_end_bytes,149,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/lifetime/reify_multi_in.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/lifetime/reify_multi_in.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/lifetime/reify_multi_in.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/lifetime/reify_multi_in.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/lifetime/reify_multi_in.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/lifetime/reify_multi_in.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/lifetime/reify_multi_in.rs" 9 | end_external_crates 10 | type_ref,file_name,"tests/lifetime/reify_multi_in.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,refid,"153826",refidcrate,"2",qualname,"",scopeid,"0" 11 | use_alias,file_name,"tests/lifetime/reify_multi_in.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,id,"4",refid,"153826",refidcrate,"2",name,"Debug",scopeid,"0" 12 | mod_ref,file_name,"tests/lifetime/reify_multi_in.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,refid,"0",refidcrate,"0",qualname,"::std",scopeid,"0" 13 | mod_ref,file_name,"tests/lifetime/reify_multi_in.rs",file_line,1,file_col,9,extent_start,9,extent_start_bytes,9,file_line_end,1,file_col_end,12,extent_end,12,extent_end_bytes,12,refid,"0",refidcrate,"0",qualname,"std::fmt",scopeid,"0" 14 | function,file_name,"tests/lifetime/reify_multi_in.rs",file_line,3,file_col,3,extent_start,25,extent_start_bytes,25,file_line_end,3,file_col_end,6,extent_end,28,extent_end_bytes,28,id,"5",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 15 | variable,file_name,"tests/lifetime/reify_multi_in.rs",file_line,3,file_col,7,extent_start,29,extent_start_bytes,29,file_line_end,3,file_col_end,8,extent_end,30,extent_end_bytes,30,id,"7",name,"x",qualname,"::foo::x",value,"",type,"&core::fmt::Debug",scopeid,"0" 16 | variable,file_name,"tests/lifetime/reify_multi_in.rs",file_line,3,file_col,18,extent_start,40,extent_start_bytes,40,file_line_end,3,file_col_end,19,extent_end,41,extent_end_bytes,41,id,"11",name,"y",qualname,"::foo::y",value,"",type,"&core::fmt::Debug",scopeid,"0" 17 | type_ref,file_name,"tests/lifetime/reify_multi_in.rs",file_line,3,file_col,11,extent_start,33,extent_start_bytes,33,file_line_end,3,file_col_end,16,extent_end,38,extent_end_bytes,38,refid,"153826",refidcrate,"2",qualname,"",scopeid,"0" 18 | type_ref,file_name,"tests/lifetime/reify_multi_in.rs",file_line,3,file_col,22,extent_start,44,extent_start_bytes,44,file_line_end,3,file_col_end,27,extent_end,49,extent_end_bytes,49,refid,"153826",refidcrate,"2",qualname,"",scopeid,"0" 19 | function,file_name,"tests/lifetime/reify_multi_in.rs",file_line,7,file_col,3,extent_start,92,extent_start_bytes,92,file_line_end,7,file_col_end,7,extent_end,96,extent_end_bytes,96,id,"56",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 20 | fn_call,file_name,"tests/lifetime/reify_multi_in.rs",file_line,8,file_col,4,extent_start,105,extent_start_bytes,105,file_line_end,8,file_col_end,7,extent_end,108,extent_end_bytes,108,refid,"5",refidcrate,"0",qualname,"",scopeid,"58" 21 | fn_call,file_name,"tests/lifetime/reify_multi_in.rs",file_line,9,file_col,4,extent_start,122,extent_start_bytes,122,file_line_end,9,file_col_end,7,extent_end,125,extent_end_bytes,125,refid,"5",refidcrate,"0",qualname,"",scopeid,"58" 22 | -------------------------------------------------------------------------------- /tests/lifetime/reify_multi_in.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo(x: &Debug, y: &Debug) { 4 | println!("{:?} {:?}", x, y); 5 | } 6 | 7 | fn main() { 8 | foo(&2, &2); 9 | foo(&"STRING", &"STRING"); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/lifetime/reify_multi_in_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo<'a, 'b>(x: &'a Debug, y: &'b Debug) { 4 | println!("{:?} {:?}", x, y); 5 | } 6 | 7 | fn main() { 8 | foo(&2, &2); 9 | foo(&"STRING", &"STRING"); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/lifetime/reify_multi_named_in.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,10,file_col_end,0,extent_end,156,extent_end_bytes,156,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/lifetime/reify_multi_named_in.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/lifetime/reify_multi_named_in.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/lifetime/reify_multi_named_in.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/lifetime/reify_multi_named_in.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/lifetime/reify_multi_named_in.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/lifetime/reify_multi_named_in.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/lifetime/reify_multi_named_in.rs" 9 | end_external_crates 10 | type_ref,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,refid,"153826",refidcrate,"2",qualname,"",scopeid,"0" 11 | use_alias,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,id,"4",refid,"153826",refidcrate,"2",name,"Debug",scopeid,"0" 12 | mod_ref,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,refid,"0",refidcrate,"0",qualname,"::std",scopeid,"0" 13 | mod_ref,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,1,file_col,9,extent_start,9,extent_start_bytes,9,file_line_end,1,file_col_end,12,extent_end,12,extent_end_bytes,12,refid,"0",refidcrate,"0",qualname,"std::fmt",scopeid,"0" 14 | function,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,3,file_col,3,extent_start,25,extent_start_bytes,25,file_line_end,3,file_col_end,6,extent_end,28,extent_end_bytes,28,id,"5",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 15 | variable,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,3,file_col,11,extent_start,33,extent_start_bytes,33,file_line_end,3,file_col_end,12,extent_end,34,extent_end_bytes,34,id,"7",name,"x",qualname,"::foo::x",value,"",type,"&'a core::fmt::Debug + 'a",scopeid,"0" 16 | variable,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,3,file_col,25,extent_start,47,extent_start_bytes,47,file_line_end,3,file_col_end,26,extent_end,48,extent_end_bytes,48,id,"12",name,"y",qualname,"::foo::y",value,"",type,"&core::fmt::Debug",scopeid,"0" 17 | type_ref,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,3,file_col,18,extent_start,40,extent_start_bytes,40,file_line_end,3,file_col_end,23,extent_end,45,extent_end_bytes,45,refid,"153826",refidcrate,"2",qualname,"",scopeid,"0" 18 | type_ref,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,3,file_col,29,extent_start,51,extent_start_bytes,51,file_line_end,3,file_col_end,34,extent_end,56,extent_end_bytes,56,refid,"153826",refidcrate,"2",qualname,"",scopeid,"0" 19 | function,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,7,file_col,3,extent_start,99,extent_start_bytes,99,file_line_end,7,file_col_end,7,extent_end,103,extent_end_bytes,103,id,"58",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 20 | fn_call,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,8,file_col,4,extent_start,112,extent_start_bytes,112,file_line_end,8,file_col_end,7,extent_end,115,extent_end_bytes,115,refid,"5",refidcrate,"0",qualname,"",scopeid,"60" 21 | fn_call,file_name,"tests/lifetime/reify_multi_named_in.rs",file_line,9,file_col,4,extent_start,129,extent_start_bytes,129,file_line_end,9,file_col_end,7,extent_end,132,extent_end_bytes,132,refid,"5",refidcrate,"0",qualname,"",scopeid,"60" 22 | -------------------------------------------------------------------------------- /tests/lifetime/reify_multi_named_in.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo<'a>(x: &'a Debug, y: &Debug) { 4 | println!("{:?} {:?}", x, y); 5 | } 6 | 7 | fn main() { 8 | foo(&2, &2); 9 | foo(&"STRING", &"STRING"); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/lifetime/reify_multi_named_in_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo<'b, 'a>(x: &'a Debug, y: &'b Debug) { 4 | println!("{:?} {:?}", x, y); 5 | } 6 | 7 | fn main() { 8 | foo(&2, &2); 9 | foo(&"STRING", &"STRING"); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /tests/lifetime/reify_multi_named_self_ret.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | struct Point; 4 | 5 | impl Point { 6 | fn foo<'a>(&'a self, x: &Debug, y: &Debug) -> &Point { 7 | println!("{:?} {:?}", x, y); 8 | self 9 | } 10 | } 11 | 12 | fn main() { 13 | let p = Point; 14 | p.foo(&2, &2); 15 | p.foo(&"STRING", &"STRING"); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/lifetime/reify_multi_named_self_ret_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | struct Point; 4 | 5 | impl Point { 6 | fn foo<'b, 'c, 'a>(&'a self, x: &'b Debug, y: &'c Debug) -> &'a Point { 7 | println!("{:?} {:?}", x, y); 8 | self 9 | } 10 | } 11 | 12 | fn main() { 13 | let p = Point; 14 | p.foo(&2, &2); 15 | p.foo(&"STRING", &"STRING"); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/lifetime/reify_multi_self_ret.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | struct Point; 4 | 5 | impl Point { 6 | fn foo(&self, x: &Debug, y: &Debug) -> &Point { 7 | println!("{:?} {:?}", x, y); 8 | self 9 | } 10 | } 11 | 12 | fn main() { 13 | let p = Point; 14 | p.foo(&2, &2); 15 | p.foo(&"STRING", &"STRING"); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/lifetime/reify_multi_self_ret_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | struct Point; 4 | 5 | impl Point { 6 | fn foo<'a, 'b, 'c>(&'a self, x: &'b Debug, y: &'c Debug) -> &'a Point { 7 | println!("{:?} {:?}", x, y); 8 | self 9 | } 10 | } 11 | 12 | fn main() { 13 | let p = Point; 14 | p.foo(&2, &2); 15 | p.foo(&"STRING", &"STRING"); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/lifetime/reify_single_in.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/lifetime/reify_single_in.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,10,file_col_end,0,extent_end,115,extent_end_bytes,115,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/lifetime/reify_single_in.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/lifetime/reify_single_in.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/lifetime/reify_single_in.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/lifetime/reify_single_in.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/lifetime/reify_single_in.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/lifetime/reify_single_in.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/lifetime/reify_single_in.rs" 9 | end_external_crates 10 | type_ref,file_name,"tests/lifetime/reify_single_in.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,refid,"153826",refidcrate,"2",qualname,"",scopeid,"0" 11 | use_alias,file_name,"tests/lifetime/reify_single_in.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,id,"4",refid,"153826",refidcrate,"2",name,"Debug",scopeid,"0" 12 | mod_ref,file_name,"tests/lifetime/reify_single_in.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,refid,"0",refidcrate,"0",qualname,"::std",scopeid,"0" 13 | mod_ref,file_name,"tests/lifetime/reify_single_in.rs",file_line,1,file_col,9,extent_start,9,extent_start_bytes,9,file_line_end,1,file_col_end,12,extent_end,12,extent_end_bytes,12,refid,"0",refidcrate,"0",qualname,"std::fmt",scopeid,"0" 14 | function,file_name,"tests/lifetime/reify_single_in.rs",file_line,3,file_col,3,extent_start,25,extent_start_bytes,25,file_line_end,3,file_col_end,6,extent_end,28,extent_end_bytes,28,id,"5",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 15 | variable,file_name,"tests/lifetime/reify_single_in.rs",file_line,3,file_col,7,extent_start,29,extent_start_bytes,29,file_line_end,3,file_col_end,8,extent_end,30,extent_end_bytes,30,id,"7",name,"x",qualname,"::foo::x",value,"",type,"&core::fmt::Debug",scopeid,"0" 16 | type_ref,file_name,"tests/lifetime/reify_single_in.rs",file_line,3,file_col,11,extent_start,33,extent_start_bytes,33,file_line_end,3,file_col_end,16,extent_end,38,extent_end_bytes,38,refid,"153826",refidcrate,"2",qualname,"",scopeid,"0" 17 | function,file_name,"tests/lifetime/reify_single_in.rs",file_line,7,file_col,3,extent_start,73,extent_start_bytes,73,file_line_end,7,file_col_end,7,extent_end,77,extent_end_bytes,77,id,"44",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 18 | fn_call,file_name,"tests/lifetime/reify_single_in.rs",file_line,8,file_col,4,extent_start,86,extent_start_bytes,86,file_line_end,8,file_col_end,7,extent_end,89,extent_end_bytes,89,refid,"5",refidcrate,"0",qualname,"",scopeid,"46" 19 | fn_call,file_name,"tests/lifetime/reify_single_in.rs",file_line,9,file_col,4,extent_start,99,extent_start_bytes,99,file_line_end,9,file_col_end,7,extent_end,102,extent_end_bytes,102,refid,"5",refidcrate,"0",qualname,"",scopeid,"46" 20 | -------------------------------------------------------------------------------- /tests/lifetime/reify_single_in.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo(x: &Debug) { 4 | println!("{:?}", x); 5 | } 6 | 7 | fn main() { 8 | foo(&2); 9 | foo(&"STRING"); 10 | } 11 | -------------------------------------------------------------------------------- /tests/lifetime/reify_single_in_anon_ret.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo<'a>(x: &'a Debug) -> &Debug { 4 | println!("{:?}", x); 5 | x 6 | } 7 | 8 | fn main() { 9 | foo(&2); 10 | foo(&"STRING"); 11 | } 12 | -------------------------------------------------------------------------------- /tests/lifetime/reify_single_in_anon_ret_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo<'a>(x: &'a Debug) -> &'a Debug { 4 | println!("{:?}", x); 5 | x 6 | } 7 | 8 | fn main() { 9 | foo(&2); 10 | foo(&"STRING"); 11 | } 12 | -------------------------------------------------------------------------------- /tests/lifetime/reify_single_in_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo<'a>(x: &'a Debug) { 4 | println!("{:?}", x); 5 | } 6 | 7 | fn main() { 8 | foo(&2); 9 | foo(&"STRING"); 10 | } 11 | -------------------------------------------------------------------------------- /tests/lifetime/reify_single_in_ret.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,11,file_col_end,0,extent_end,131,extent_end_bytes,131,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/lifetime/reify_single_in_ret.rs" 3 | external_crate,name,"libc",crate,"7",file_name,"tests/lifetime/reify_single_in_ret.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/lifetime/reify_single_in_ret.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/lifetime/reify_single_in_ret.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/lifetime/reify_single_in_ret.rs" 7 | external_crate,name,"rand",crate,"6",file_name,"tests/lifetime/reify_single_in_ret.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/lifetime/reify_single_in_ret.rs" 9 | external_crate,name,"alloc_jemalloc",crate,"8",file_name,"tests/lifetime/reify_single_in_ret.rs" 10 | end_external_crates 11 | type_ref,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 12 | use_alias,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,19,extent_end,19,extent_end_bytes,19,id,"4",refid,"164184",refidcrate,"2",name,"Debug",scopeid,"0" 13 | mod_ref,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,refid,"0",refidcrate,"0",qualname,"::std",scopeid,"0" 14 | mod_ref,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,1,file_col,9,extent_start,9,extent_start_bytes,9,file_line_end,1,file_col_end,12,extent_end,12,extent_end_bytes,12,refid,"0",refidcrate,"0",qualname,"std::fmt",scopeid,"0" 15 | function,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,3,file_col,3,extent_start,25,extent_start_bytes,25,file_line_end,3,file_col_end,6,extent_end,28,extent_end_bytes,28,id,"5",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 16 | variable,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,3,file_col,7,extent_start,29,extent_start_bytes,29,file_line_end,3,file_col_end,8,extent_end,30,extent_end_bytes,30,id,"7",name,"x",qualname,"::foo::x",value,"",type,"&core::fmt::Debug",scopeid,"0" 17 | type_ref,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,3,file_col,11,extent_start,33,extent_start_bytes,33,file_line_end,3,file_col_end,16,extent_end,38,extent_end_bytes,38,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 18 | type_ref,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,3,file_col,22,extent_start,44,extent_start_bytes,44,file_line_end,3,file_col_end,27,extent_end,49,extent_end_bytes,49,refid,"164184",refidcrate,"2",qualname,"",scopeid,"0" 19 | var_ref,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,5,file_col,4,extent_start,81,extent_start_bytes,81,file_line_end,5,file_col_end,5,extent_end,82,extent_end_bytes,82,refid,"7",refidcrate,"0",qualname,"",scopeid,"13" 20 | function,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,8,file_col,3,extent_start,89,extent_start_bytes,89,file_line_end,8,file_col_end,7,extent_end,93,extent_end_bytes,93,id,"47",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 21 | fn_call,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,9,file_col,4,extent_start,102,extent_start_bytes,102,file_line_end,9,file_col_end,7,extent_end,105,extent_end_bytes,105,refid,"5",refidcrate,"0",qualname,"",scopeid,"49" 22 | fn_call,file_name,"tests/lifetime/reify_single_in_ret.rs",file_line,10,file_col,4,extent_start,115,extent_start_bytes,115,file_line_end,10,file_col_end,7,extent_end,118,extent_end_bytes,118,refid,"5",refidcrate,"0",qualname,"",scopeid,"49" 23 | -------------------------------------------------------------------------------- /tests/lifetime/reify_single_in_ret.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo(x: &Debug) -> &Debug { 4 | println!("{:?}", x); 5 | x 6 | } 7 | 8 | fn main() { 9 | foo(&2); 10 | foo(&"STRING"); 11 | } 12 | -------------------------------------------------------------------------------- /tests/lifetime/reify_single_in_ret_out.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | fn foo<'a>(x: &'a Debug) -> &'a Debug { 4 | println!("{:?}", x); 5 | x 6 | } 7 | 8 | fn main() { 9 | foo(&2); 10 | foo(&"STRING"); 11 | } 12 | -------------------------------------------------------------------------------- /tests/multi-file/simple_function_1/foo.rs: -------------------------------------------------------------------------------- 1 | pub fn hah() { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /tests/multi-file/simple_function_1/foo_out.rs: -------------------------------------------------------------------------------- 1 | pub fn boo() { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /tests/multi-file/simple_function_1/main.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/multi-file/simple_function_1/main.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,5,file_col_end,0,extent_end,38,extent_end_bytes,38,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/multi-file/simple_function_1/main.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/multi-file/simple_function_1/main.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/multi-file/simple_function_1/main.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/multi-file/simple_function_1/main.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/multi-file/simple_function_1/main.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/multi-file/simple_function_1/main.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/multi-file/simple_function_1/main.rs" 9 | end_external_crates 10 | module,file_name,"tests/multi-file/simple_function_1/main.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::foo",scopeid,"0",def_file,"tests/multi-file/simple_function_1/foo.rs" 11 | function,file_name,"tests/multi-file/simple_function_1/foo.rs",file_line,1,file_col,7,extent_start,7,extent_start_bytes,7,file_line_end,1,file_col_end,10,extent_end,10,extent_end_bytes,10,id,"6",qualname,"::foo::hah",declid,"",declidcrate,"",scopeid,"4" 12 | function,file_name,"tests/multi-file/simple_function_1/main.rs",file_line,3,file_col,3,extent_start,13,extent_start_bytes,13,file_line_end,3,file_col_end,7,extent_end,17,extent_end_bytes,17,id,"9",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 13 | fn_call,file_name,"tests/multi-file/simple_function_1/main.rs",file_line,4,file_col,9,extent_start,31,extent_start_bytes,31,file_line_end,4,file_col_end,12,extent_end,34,extent_end_bytes,34,refid,"6",refidcrate,"0",qualname,"",scopeid,"11" 14 | mod_ref,file_name,"tests/multi-file/simple_function_1/main.rs",file_line,4,file_col,4,extent_start,26,extent_start_bytes,26,file_line_end,4,file_col_end,7,extent_end,29,extent_end_bytes,29,refid,"0",refidcrate,"0",qualname,"foo",scopeid,"9" 15 | -------------------------------------------------------------------------------- /tests/multi-file/simple_function_1/main.rs: -------------------------------------------------------------------------------- 1 | mod foo; 2 | 3 | fn main() { 4 | foo::hah(); 5 | } 6 | -------------------------------------------------------------------------------- /tests/multi-file/simple_function_1/main_out.rs: -------------------------------------------------------------------------------- 1 | mod foo; 2 | 3 | fn main() { 4 | foo::boo(); 5 | } 6 | -------------------------------------------------------------------------------- /tests/multi-file/simple_function_2/foo/mod.rs: -------------------------------------------------------------------------------- 1 | pub fn hah() { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /tests/multi-file/simple_function_2/foo/mod_out.rs: -------------------------------------------------------------------------------- 1 | pub fn boo() { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /tests/multi-file/simple_function_2/main.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/multi-file/simple_function_2/main.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,5,file_col_end,0,extent_end,38,extent_end_bytes,38,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/multi-file/simple_function_2/main.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/multi-file/simple_function_2/main.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/multi-file/simple_function_2/main.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/multi-file/simple_function_2/main.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/multi-file/simple_function_2/main.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/multi-file/simple_function_2/main.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/multi-file/simple_function_2/main.rs" 9 | end_external_crates 10 | module,file_name,"tests/multi-file/simple_function_2/main.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::foo",scopeid,"0",def_file,"tests/multi-file/simple_function_2/foo/mod.rs" 11 | function,file_name,"tests/multi-file/simple_function_2/foo/mod.rs",file_line,1,file_col,7,extent_start,7,extent_start_bytes,7,file_line_end,1,file_col_end,10,extent_end,10,extent_end_bytes,10,id,"6",qualname,"::foo::hah",declid,"",declidcrate,"",scopeid,"4" 12 | function,file_name,"tests/multi-file/simple_function_2/main.rs",file_line,3,file_col,3,extent_start,13,extent_start_bytes,13,file_line_end,3,file_col_end,7,extent_end,17,extent_end_bytes,17,id,"9",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 13 | fn_call,file_name,"tests/multi-file/simple_function_2/main.rs",file_line,4,file_col,9,extent_start,31,extent_start_bytes,31,file_line_end,4,file_col_end,12,extent_end,34,extent_end_bytes,34,refid,"6",refidcrate,"0",qualname,"",scopeid,"11" 14 | mod_ref,file_name,"tests/multi-file/simple_function_2/main.rs",file_line,4,file_col,4,extent_start,26,extent_start_bytes,26,file_line_end,4,file_col_end,7,extent_end,29,extent_end_bytes,29,refid,"0",refidcrate,"0",qualname,"foo",scopeid,"9" 15 | -------------------------------------------------------------------------------- /tests/multi-file/simple_function_2/main.rs: -------------------------------------------------------------------------------- 1 | mod foo; 2 | 3 | fn main() { 4 | foo::hah(); 5 | } 6 | -------------------------------------------------------------------------------- /tests/multi-file/simple_function_2/main_out.rs: -------------------------------------------------------------------------------- 1 | mod foo; 2 | 3 | fn main() { 4 | foo::boo(); 5 | } 6 | -------------------------------------------------------------------------------- /tests/multi-file/simple_inline_1/foo.rs: -------------------------------------------------------------------------------- 1 | pub fn hah() { 2 | let a = 1; 3 | let _ = 1 + a; 4 | } 5 | -------------------------------------------------------------------------------- /tests/multi-file/simple_inline_1/foo_out.rs: -------------------------------------------------------------------------------- 1 | pub fn hah() { let _ = 1 + 1; } 2 | -------------------------------------------------------------------------------- /tests/multi-file/simple_inline_1/main.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/multi-file/simple_inline_1/main.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,5,file_col_end,0,extent_end,38,extent_end_bytes,38,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/multi-file/simple_inline_1/main.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/multi-file/simple_inline_1/main.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/multi-file/simple_inline_1/main.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/multi-file/simple_inline_1/main.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/multi-file/simple_inline_1/main.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/multi-file/simple_inline_1/main.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/multi-file/simple_inline_1/main.rs" 9 | end_external_crates 10 | module,file_name,"tests/multi-file/simple_inline_1/main.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::foo",scopeid,"0",def_file,"tests/multi-file/simple_inline_1/foo.rs" 11 | function,file_name,"tests/multi-file/simple_inline_1/foo.rs",file_line,1,file_col,7,extent_start,7,extent_start_bytes,7,file_line_end,1,file_col_end,10,extent_end,10,extent_end_bytes,10,id,"6",qualname,"::foo::hah",declid,"",declidcrate,"",scopeid,"4" 12 | variable,file_name,"tests/multi-file/simple_inline_1/foo.rs",file_line,2,file_col,8,extent_start,23,extent_start_bytes,23,file_line_end,2,file_col_end,9,extent_end,24,extent_end_bytes,24,id,"11",name,"a",qualname,"a$11",value,"a = 1",type,"i32",scopeid,"0" 13 | var_ref,file_name,"tests/multi-file/simple_inline_1/foo.rs",file_line,3,file_col,16,extent_start,46,extent_start_bytes,46,file_line_end,3,file_col_end,17,extent_end,47,extent_end_bytes,47,refid,"11",refidcrate,"0",qualname,"",scopeid,"8" 14 | function,file_name,"tests/multi-file/simple_inline_1/main.rs",file_line,3,file_col,3,extent_start,13,extent_start_bytes,13,file_line_end,3,file_col_end,7,extent_end,17,extent_end_bytes,17,id,"19",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 15 | fn_call,file_name,"tests/multi-file/simple_inline_1/main.rs",file_line,4,file_col,9,extent_start,31,extent_start_bytes,31,file_line_end,4,file_col_end,12,extent_end,34,extent_end_bytes,34,refid,"6",refidcrate,"0",qualname,"",scopeid,"21" 16 | mod_ref,file_name,"tests/multi-file/simple_inline_1/main.rs",file_line,4,file_col,4,extent_start,26,extent_start_bytes,26,file_line_end,4,file_col_end,7,extent_end,29,extent_end_bytes,29,refid,"0",refidcrate,"0",qualname,"foo",scopeid,"19" 17 | -------------------------------------------------------------------------------- /tests/multi-file/simple_inline_1/main.rs: -------------------------------------------------------------------------------- 1 | mod foo; 2 | 3 | fn main() { 4 | foo::hah(); 5 | } 6 | -------------------------------------------------------------------------------- /tests/multi-file/simple_inline_1/main_out.rs: -------------------------------------------------------------------------------- 1 | mod foo; 2 | 3 | fn main() { 4 | foo::hah(); 5 | } 6 | -------------------------------------------------------------------------------- /tests/type/basic_enum.rs: -------------------------------------------------------------------------------- 1 | enum Choice { 2 | Yes, 3 | No 4 | } 5 | 6 | impl Choice { 7 | fn new() -> Choice { 8 | Choice::Yes 9 | } 10 | } 11 | 12 | fn main() { 13 | let choice = Choice::new(); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tests/type/basic_struct.rs: -------------------------------------------------------------------------------- 1 | struct Point { 2 | x: i32, 3 | y: i32 4 | } 5 | 6 | impl Point { 7 | fn new(x: i32, y: i32) -> Point { 8 | Point { 9 | x: x, 10 | y: y 11 | } 12 | } 13 | } 14 | 15 | fn main() { 16 | let p: Point = Point::new(1, 1); 17 | } 18 | -------------------------------------------------------------------------------- /tests/type/conflict_local_struct.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/type/conflict_local_struct.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,7,file_col_end,0,extent_end,67,extent_end_bytes,67,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/type/conflict_local_struct.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/type/conflict_local_struct.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/type/conflict_local_struct.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/type/conflict_local_struct.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/type/conflict_local_struct.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/type/conflict_local_struct.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/type/conflict_local_struct.rs" 9 | end_external_crates 10 | struct,file_name,"tests/type/conflict_local_struct.rs",file_line,1,file_col,7,extent_start,7,extent_start_bytes,7,file_line_end,1,file_col_end,8,extent_end,8,extent_end_bytes,8,id,"4",ctor_id,"5",qualname,"::A",scopeid,"0",value,"struct A;" 11 | function,file_name,"tests/type/conflict_local_struct.rs",file_line,3,file_col,3,extent_start,14,extent_start_bytes,14,file_line_end,3,file_col_end,7,extent_end,18,extent_end_bytes,18,id,"7",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 12 | struct,file_name,"tests/type/conflict_local_struct.rs",file_line,4,file_col,11,extent_start,34,extent_start_bytes,34,file_line_end,4,file_col_end,12,extent_end,35,extent_end_bytes,35,id,"11",ctor_id,"12",qualname,"::main::B",scopeid,"7",value,"struct B;" 13 | type_ref,file_name,"tests/type/conflict_local_struct.rs",file_line,5,file_col,12,extent_start,49,extent_start_bytes,49,file_line_end,5,file_col_end,13,extent_end,50,extent_end_bytes,50,refid,"5",refidcrate,"0",qualname,"",scopeid,"9" 14 | type_ref,file_name,"tests/type/conflict_local_struct.rs",file_line,6,file_col,12,extent_start,64,extent_start_bytes,64,file_line_end,6,file_col_end,13,extent_end,65,extent_end_bytes,65,refid,"12",refidcrate,"0",qualname,"",scopeid,"9" 15 | -------------------------------------------------------------------------------- /tests/type/conflict_local_struct.rs: -------------------------------------------------------------------------------- 1 | struct A; 2 | 3 | fn main() { 4 | struct B; 5 | let _ = A; 6 | let _ = B; 7 | } 8 | -------------------------------------------------------------------------------- /tests/type/conflict_mod_struct.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/type/conflict_mod_struct.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,9,file_col_end,0,extent_end,107,extent_end_bytes,107,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/type/conflict_mod_struct.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/type/conflict_mod_struct.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/type/conflict_mod_struct.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/type/conflict_mod_struct.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/type/conflict_mod_struct.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/type/conflict_mod_struct.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/type/conflict_mod_struct.rs" 9 | end_external_crates 10 | module,file_name,"tests/type/conflict_mod_struct.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,9,extent_end,9,extent_end_bytes,9,id,"4",qualname,"::group",scopeid,"0",def_file,"tests/type/conflict_mod_struct.rs" 11 | struct,file_name,"tests/type/conflict_mod_struct.rs",file_line,2,file_col,15,extent_start,27,extent_start_bytes,27,file_line_end,2,file_col_end,16,extent_end,28,extent_end_bytes,28,id,"6",ctor_id,"7",qualname,"::group::A",scopeid,"4",value,"pub struct A;" 12 | struct,file_name,"tests/type/conflict_mod_struct.rs",file_line,3,file_col,15,extent_start,45,extent_start_bytes,45,file_line_end,3,file_col_end,16,extent_end,46,extent_end_bytes,46,id,"9",ctor_id,"10",qualname,"::group::B",scopeid,"4",value,"pub struct B;" 13 | function,file_name,"tests/type/conflict_mod_struct.rs",file_line,6,file_col,3,extent_start,54,extent_start_bytes,54,file_line_end,6,file_col_end,7,extent_end,58,extent_end_bytes,58,id,"12",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 14 | type_ref,file_name,"tests/type/conflict_mod_struct.rs",file_line,7,file_col,19,extent_start,82,extent_start_bytes,82,file_line_end,7,file_col_end,20,extent_end,83,extent_end_bytes,83,refid,"7",refidcrate,"0",qualname,"",scopeid,"14" 15 | mod_ref,file_name,"tests/type/conflict_mod_struct.rs",file_line,7,file_col,12,extent_start,75,extent_start_bytes,75,file_line_end,7,file_col_end,17,extent_end,80,extent_end_bytes,80,refid,"0",refidcrate,"0",qualname,"group",scopeid,"12" 16 | type_ref,file_name,"tests/type/conflict_mod_struct.rs",file_line,8,file_col,19,extent_start,104,extent_start_bytes,104,file_line_end,8,file_col_end,20,extent_end,105,extent_end_bytes,105,refid,"10",refidcrate,"0",qualname,"",scopeid,"14" 17 | mod_ref,file_name,"tests/type/conflict_mod_struct.rs",file_line,8,file_col,12,extent_start,97,extent_start_bytes,97,file_line_end,8,file_col_end,17,extent_end,102,extent_end_bytes,102,refid,"0",refidcrate,"0",qualname,"group",scopeid,"12" 18 | -------------------------------------------------------------------------------- /tests/type/conflict_mod_struct.rs: -------------------------------------------------------------------------------- 1 | mod group { 2 | pub struct A; 3 | pub struct B; 4 | } 5 | 6 | fn main() { 7 | let _ = group::A; 8 | let _ = group::B; 9 | } 10 | -------------------------------------------------------------------------------- /tests/type/conflict_struct.rs: -------------------------------------------------------------------------------- 1 | struct Point { 2 | x: i32, 3 | y: i32 4 | } 5 | 6 | struct P { 7 | x: i32, 8 | y: i32 9 | } 10 | 11 | impl Point { 12 | fn new(x: i32, y: i32) -> Point { 13 | Point { 14 | x: x, 15 | y: y 16 | } 17 | } 18 | } 19 | 20 | fn main() { 21 | let p: Point = Point::new(1, 1); 22 | } 23 | -------------------------------------------------------------------------------- /tests/type/conflict_use_mod_struct.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/type/conflict_use_mod_struct.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,12,file_col_end,0,extent_end,101,extent_end_bytes,101,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/type/conflict_use_mod_struct.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/type/conflict_use_mod_struct.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/type/conflict_use_mod_struct.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/type/conflict_use_mod_struct.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/type/conflict_use_mod_struct.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/type/conflict_use_mod_struct.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/type/conflict_use_mod_struct.rs" 9 | end_external_crates 10 | module,file_name,"tests/type/conflict_use_mod_struct.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,9,extent_end,9,extent_end_bytes,9,id,"4",qualname,"::group",scopeid,"0",def_file,"tests/type/conflict_use_mod_struct.rs" 11 | struct,file_name,"tests/type/conflict_use_mod_struct.rs",file_line,2,file_col,15,extent_start,27,extent_start_bytes,27,file_line_end,2,file_col_end,16,extent_end,28,extent_end_bytes,28,id,"6",ctor_id,"7",qualname,"::group::A",scopeid,"4",value,"pub struct A;" 12 | type_ref,file_name,"tests/type/conflict_use_mod_struct.rs",file_line,5,file_col,11,extent_start,44,extent_start_bytes,44,file_line_end,5,file_col_end,12,extent_end,45,extent_end_bytes,45,refid,"6",refidcrate,"0",qualname,"",scopeid,"0" 13 | use_alias,file_name,"tests/type/conflict_use_mod_struct.rs",file_line,5,file_col,11,extent_start,44,extent_start_bytes,44,file_line_end,5,file_col_end,12,extent_end,45,extent_end_bytes,45,id,"9",refid,"6",refidcrate,"0",name,"A",scopeid,"0" 14 | mod_ref,file_name,"tests/type/conflict_use_mod_struct.rs",file_line,5,file_col,4,extent_start,37,extent_start_bytes,37,file_line_end,5,file_col_end,9,extent_end,42,extent_end_bytes,42,refid,"0",refidcrate,"0",qualname,"::group",scopeid,"0" 15 | struct,file_name,"tests/type/conflict_use_mod_struct.rs",file_line,7,file_col,7,extent_start,55,extent_start_bytes,55,file_line_end,7,file_col_end,8,extent_end,56,extent_end_bytes,56,id,"10",ctor_id,"11",qualname,"::B",scopeid,"0",value,"struct B;" 16 | function,file_name,"tests/type/conflict_use_mod_struct.rs",file_line,9,file_col,3,extent_start,62,extent_start_bytes,62,file_line_end,9,file_col_end,7,extent_end,66,extent_end_bytes,66,id,"13",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 17 | type_ref,file_name,"tests/type/conflict_use_mod_struct.rs",file_line,10,file_col,12,extent_start,83,extent_start_bytes,83,file_line_end,10,file_col_end,13,extent_end,84,extent_end_bytes,84,refid,"7",refidcrate,"0",qualname,"",scopeid,"15" 18 | type_ref,file_name,"tests/type/conflict_use_mod_struct.rs",file_line,11,file_col,12,extent_start,98,extent_start_bytes,98,file_line_end,11,file_col_end,13,extent_end,99,extent_end_bytes,99,refid,"11",refidcrate,"0",qualname,"",scopeid,"15" 19 | -------------------------------------------------------------------------------- /tests/type/conflict_use_mod_struct.rs: -------------------------------------------------------------------------------- 1 | mod group { 2 | pub struct A; 3 | } 4 | 5 | use group::A; 6 | 7 | struct B; 8 | 9 | fn main() { 10 | let _ = A; 11 | let _ = B; 12 | } 13 | -------------------------------------------------------------------------------- /tests/type/conflict_use_mod_struct2.rs: -------------------------------------------------------------------------------- 1 | mod group { 2 | pub struct A; 3 | } 4 | 5 | struct B; 6 | use group::A; 7 | 8 | fn main() { 9 | let _ = A; 10 | let _ = B; 11 | } 12 | -------------------------------------------------------------------------------- /tests/type/modref_enum.rs: -------------------------------------------------------------------------------- 1 | use Choice::{Yes, No}; 2 | 3 | enum Choice { 4 | Yes, 5 | No 6 | } 7 | 8 | impl Choice { 9 | fn new() -> Choice { 10 | Yes 11 | } 12 | } 13 | 14 | fn main() { 15 | let choice = Choice::new(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /tests/type/scoped_struct.rs: -------------------------------------------------------------------------------- 1 | struct Point { 2 | x: i32, 3 | y: i32 4 | } 5 | 6 | impl Point { 7 | fn new(x: i32, y: i32) -> Point { 8 | Point { 9 | x: x, 10 | y: y 11 | } 12 | } 13 | } 14 | 15 | fn main() { 16 | let p: Point = ::Point::new(1, 1); 17 | } 18 | -------------------------------------------------------------------------------- /tests/type/tuple_struct.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/type/tuple_struct.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,5,file_col_end,0,extent_end,61,extent_end_bytes,61,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/type/tuple_struct.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/type/tuple_struct.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/type/tuple_struct.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/type/tuple_struct.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/type/tuple_struct.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/type/tuple_struct.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/type/tuple_struct.rs" 9 | end_external_crates 10 | struct,file_name,"tests/type/tuple_struct.rs",file_line,1,file_col,7,extent_start,7,extent_start_bytes,7,file_line_end,1,file_col_end,12,extent_end,12,extent_end_bytes,12,id,"4",ctor_id,"9",qualname,"::Point",scopeid,"0",value,"struct Point(u32, u32);" 11 | function,file_name,"tests/type/tuple_struct.rs",file_line,3,file_col,3,extent_start,28,extent_start_bytes,28,file_line_end,3,file_col_end,7,extent_end,32,extent_end_bytes,32,id,"11",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 12 | variable,file_name,"tests/type/tuple_struct.rs",file_line,4,file_col,8,extent_start,45,extent_start_bytes,45,file_line_end,4,file_col_end,9,extent_end,46,extent_end_bytes,46,id,"16",name,"x",qualname,"x$16",value,"x = Point(2,3)",type,"Point",scopeid,"0" 13 | type_ref,file_name,"tests/type/tuple_struct.rs",file_line,4,file_col,12,extent_start,49,extent_start_bytes,49,file_line_end,4,file_col_end,17,extent_end,54,extent_end_bytes,54,refid,"9",refidcrate,"0",qualname,"",scopeid,"13" 14 | -------------------------------------------------------------------------------- /tests/type/tuple_struct.rs: -------------------------------------------------------------------------------- 1 | struct Point(u32, u32); 2 | 3 | fn main() { 4 | let x = Point(2,3); 5 | } 6 | -------------------------------------------------------------------------------- /tests/type/tuple_struct_out.rs: -------------------------------------------------------------------------------- 1 | struct Pointer(u32, u32); 2 | 3 | fn main() { 4 | let x = Pointer(2,3); 5 | } 6 | -------------------------------------------------------------------------------- /tests/type/working_enum_1_out.rs: -------------------------------------------------------------------------------- 1 | enum YesNo { 2 | Yes, 3 | No 4 | } 5 | 6 | impl YesNo { 7 | fn new() -> YesNo { 8 | YesNo::Yes 9 | } 10 | } 11 | 12 | fn main() { 13 | let choice = YesNo::new(); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tests/type/working_enum_2_out.rs: -------------------------------------------------------------------------------- 1 | use YesNo::{Yes, No}; 2 | 3 | enum YesNo { 4 | Yes, 5 | No 6 | } 7 | 8 | impl YesNo { 9 | fn new() -> YesNo { 10 | Yes 11 | } 12 | } 13 | 14 | fn main() { 15 | let choice = YesNo::new(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /tests/type/working_struct_1_out.rs: -------------------------------------------------------------------------------- 1 | struct Pointer { 2 | x: i32, 3 | y: i32 4 | } 5 | 6 | impl Pointer { 7 | fn new(x: i32, y: i32) -> Pointer { 8 | Pointer { 9 | x: x, 10 | y: y 11 | } 12 | } 13 | } 14 | 15 | fn main() { 16 | let p: Pointer = Pointer::new(1, 1); 17 | } 18 | -------------------------------------------------------------------------------- /tests/type/working_struct_2_out.rs: -------------------------------------------------------------------------------- 1 | struct Pointer { 2 | x: i32, 3 | y: i32 4 | } 5 | 6 | impl Pointer { 7 | fn new(x: i32, y: i32) -> Pointer { 8 | Pointer { 9 | x: x, 10 | y: y 11 | } 12 | } 13 | } 14 | 15 | fn main() { 16 | let p: Pointer = Pointer::new(1, 1); 17 | } 18 | -------------------------------------------------------------------------------- /tests/variable/alex_var_test.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/alex_var_test.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,14,file_col_end,0,extent_end,248,extent_end_bytes,248,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/alex_var_test.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/alex_var_test.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/alex_var_test.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/alex_var_test.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/alex_var_test.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/alex_var_test.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/alex_var_test.rs" 9 | end_external_crates 10 | variable,file_name,"tests/variable/alex_var_test.rs",file_line,1,file_col,11,extent_start,11,extent_start_bytes,11,file_line_end,1,file_col_end,14,extent_end,14,extent_end_bytes,14,id,"4",name,"FOO",qualname,"::FOO",value,"",type,"i32",scopeid,"0" 11 | function,file_name,"tests/variable/alex_var_test.rs",file_line,3,file_col,10,extent_start,38,extent_start_bytes,38,file_line_end,3,file_col_end,15,extent_end,43,extent_end_bytes,43,id,"7",qualname,"::do_it",declid,"",declidcrate,"",scopeid,"0" 12 | variable,file_name,"tests/variable/alex_var_test.rs",file_line,4,file_col,6,extent_start,61,extent_start_bytes,61,file_line_end,4,file_col_end,9,extent_end,64,extent_end_bytes,64,id,"14",name,"foo",qualname,"foo$14",value,"foo : i32 = 55",type,"i32",scopeid,"0" 13 | var_ref,file_name,"tests/variable/alex_var_test.rs",file_line,5,file_col,9,extent_start,86,extent_start_bytes,86,file_line_end,5,file_col_end,12,extent_end,89,extent_end_bytes,89,refid,"4",refidcrate,"0",qualname,"",scopeid,"10" 14 | var_ref,file_name,"tests/variable/alex_var_test.rs",file_line,5,file_col,15,extent_start,92,extent_start_bytes,92,file_line_end,5,file_col_end,18,extent_end,95,extent_end_bytes,95,refid,"14",refidcrate,"0",qualname,"",scopeid,"10" 15 | function,file_name,"tests/variable/alex_var_test.rs",file_line,8,file_col,3,extent_start,103,extent_start_bytes,103,file_line_end,8,file_col_end,7,extent_end,107,extent_end_bytes,107,id,"21",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 16 | var_ref,file_name,"tests/variable/alex_var_test.rs",file_line,11,file_col,4,extent_start,178,extent_start_bytes,178,file_line_end,11,file_col_end,7,extent_end,181,extent_end_bytes,181,refid,"4",refidcrate,"0",qualname,"",scopeid,"25" 17 | -------------------------------------------------------------------------------- /tests/variable/alex_var_test.rs: -------------------------------------------------------------------------------- 1 | static mut FOO : i32 = 42; 2 | 3 | unsafe fn do_it() -> i32 { 4 | let foo : i32 = 55; 5 | return FOO + foo; 6 | } 7 | 8 | fn main() { 9 | unsafe { 10 | println!("Values of variables once: {}", FOO); 11 | FOO = 37; 12 | println!("Values of variables twice: {}", do_it()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/variable/alex_var_test_out.rs: -------------------------------------------------------------------------------- 1 | static mut FOO : i32 = 42; 2 | 3 | unsafe fn do_it() -> i32 { 4 | let bar : i32 = 55; 5 | return FOO + bar; 6 | } 7 | 8 | fn main() { 9 | unsafe { 10 | println!("Values of variables once: {}", FOO); 11 | FOO = 37; 12 | println!("Values of variables twice: {}", do_it()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/variable/alex_var_test_out2.rs: -------------------------------------------------------------------------------- 1 | static mut bar : i32 = 42; 2 | 3 | unsafe fn do_it() -> i32 { 4 | let foo : i32 = 55; 5 | return bar + foo; 6 | } 7 | 8 | fn main() { 9 | unsafe { 10 | println!("Values of variables once: {}", FOO); 11 | bar = 37; 12 | println!("Values of variables twice: {}", do_it()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tests/variable/basic_rename.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let x = 10; 3 | let y = 20; 4 | let z = 30; 5 | 6 | let mut i = 0; 7 | while i < 10 { 8 | let j = 2 * i; 9 | let k = 2 * i * j; 10 | let z = z * y * x; 11 | println!("{} {} {}", j, k, z); 12 | i += 1; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tests/variable/conflict_var_use_mod.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/conflict_var_use_mod.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,10,file_col_end,0,extent_end,131,extent_end_bytes,131,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/conflict_var_use_mod.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/conflict_var_use_mod.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/conflict_var_use_mod.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/conflict_var_use_mod.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/conflict_var_use_mod.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/conflict_var_use_mod.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/conflict_var_use_mod.rs" 9 | end_external_crates 10 | module,file_name,"tests/variable/conflict_var_use_mod.rs",file_line,1,file_col,4,extent_start,4,extent_start_bytes,4,file_line_end,1,file_col_end,9,extent_end,9,extent_end_bytes,9,id,"4",qualname,"::point",scopeid,"0",def_file,"tests/variable/conflict_var_use_mod.rs" 11 | variable,file_name,"tests/variable/conflict_var_use_mod.rs",file_line,2,file_col,14,extent_start,26,extent_start_bytes,26,file_line_end,2,file_col_end,18,extent_end,30,extent_end_bytes,30,id,"6",name,"BIT1",qualname,"::point::BIT1",value,"1 << 0",type,"u32",scopeid,"4" 12 | variable,file_name,"tests/variable/conflict_var_use_mod.rs",file_line,3,file_col,14,extent_start,60,extent_start_bytes,60,file_line_end,3,file_col_end,18,extent_end,64,extent_end_bytes,64,id,"11",name,"BIT2",qualname,"::point::BIT2",value,"1 << 1",type,"u32",scopeid,"4" 13 | var_ref,file_name,"tests/variable/conflict_var_use_mod.rs",file_line,6,file_col,11,extent_start,94,extent_start_bytes,94,file_line_end,6,file_col_end,15,extent_end,98,extent_end_bytes,98,refid,"6",refidcrate,"0",qualname,"",scopeid,"0" 14 | use_alias,file_name,"tests/variable/conflict_var_use_mod.rs",file_line,6,file_col,11,extent_start,94,extent_start_bytes,94,file_line_end,6,file_col_end,15,extent_end,98,extent_end_bytes,98,id,"16",refid,"6",refidcrate,"0",name,"BIT1",scopeid,"0" 15 | mod_ref,file_name,"tests/variable/conflict_var_use_mod.rs",file_line,6,file_col,4,extent_start,87,extent_start_bytes,87,file_line_end,6,file_col_end,9,extent_end,92,extent_end_bytes,92,refid,"0",refidcrate,"0",qualname,"::point",scopeid,"0" 16 | function,file_name,"tests/variable/conflict_var_use_mod.rs",file_line,8,file_col,3,extent_start,104,extent_start_bytes,104,file_line_end,8,file_col_end,7,extent_end,108,extent_end_bytes,108,id,"17",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 17 | var_ref,file_name,"tests/variable/conflict_var_use_mod.rs",file_line,9,file_col,12,extent_start,125,extent_start_bytes,125,file_line_end,9,file_col_end,16,extent_end,129,extent_end_bytes,129,refid,"6",refidcrate,"0",qualname,"",scopeid,"19" 18 | -------------------------------------------------------------------------------- /tests/variable/conflict_var_use_mod.rs: -------------------------------------------------------------------------------- 1 | mod point { 2 | pub const BIT1: u32 = 1 << 0; 3 | pub const BIT2: u32 = 1 << 1; 4 | } 5 | 6 | use point::BIT1; 7 | 8 | fn main() { 9 | let _ = BIT1; 10 | } 11 | -------------------------------------------------------------------------------- /tests/variable/conflict_var_use_mod_out.rs: -------------------------------------------------------------------------------- 1 | mod point { 2 | pub const BIT3: u32 = 1 << 0; 3 | pub const BIT2: u32 = 1 << 1; 4 | } 5 | 6 | use point::BIT3; 7 | 8 | fn main() { 9 | let _ = BIT3; 10 | } 11 | -------------------------------------------------------------------------------- /tests/variable/const_rename.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/const_rename.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,5,file_col_end,0,extent_end,85,extent_end_bytes,85,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/const_rename.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/const_rename.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/const_rename.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/const_rename.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/const_rename.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/const_rename.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/const_rename.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/const_rename.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/variable/const_rename.rs",file_line,2,file_col,10,extent_start,22,extent_start_bytes,22,file_line_end,2,file_col_end,13,extent_end,25,extent_end_bytes,25,id,"8",name,"FOO",qualname,"::main::FOO",value,"10",type,"u32",scopeid,"6" 12 | variable,file_name,"tests/variable/const_rename.rs",file_line,3,file_col,8,extent_start,45,extent_start_bytes,45,file_line_end,3,file_col_end,11,extent_end,48,extent_end_bytes,48,id,"13",name,"bar",qualname,"bar$13",value,"bar = 2 * FOO",type,"u32",scopeid,"0" 13 | var_ref,file_name,"tests/variable/const_rename.rs",file_line,3,file_col,18,extent_start,55,extent_start_bytes,55,file_line_end,3,file_col_end,21,extent_end,58,extent_end_bytes,58,refid,"8",refidcrate,"0",qualname,"",scopeid,"6" 14 | -------------------------------------------------------------------------------- /tests/variable/const_rename.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | const FOO: u32 = 10; 3 | let bar = 2 * FOO; 4 | println!("{}", bar); 5 | } 6 | -------------------------------------------------------------------------------- /tests/variable/const_rename_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | const BAZ: u32 = 10; 3 | let bar = 2 * BAZ; 4 | println!("{}", bar); 5 | } 6 | -------------------------------------------------------------------------------- /tests/variable/destructure_conflict.rs: -------------------------------------------------------------------------------- 1 | struct Point { 2 | x: u32, 3 | y: u32 4 | } 5 | 6 | fn main() { 7 | let Point{x, y} = Point{x: 1, y: 2}; 8 | println!("{} {}", x, y); 9 | } 10 | -------------------------------------------------------------------------------- /tests/variable/fn_args_1.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/fn_args_1.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,8,file_col_end,0,extent_end,121,extent_end_bytes,121,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/fn_args_1.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/fn_args_1.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/fn_args_1.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/fn_args_1.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/fn_args_1.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/fn_args_1.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/fn_args_1.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/fn_args_1.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,6,extent_end,6,extent_end_bytes,6,id,"4",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/variable/fn_args_1.rs",file_line,1,file_col,7,extent_start,7,extent_start_bytes,7,file_line_end,1,file_col_end,8,extent_end,8,extent_end_bytes,8,id,"6",name,"a",qualname,"::foo::a",value,"",type,"u32",scopeid,"0" 12 | variable,file_name,"tests/variable/fn_args_1.rs",file_line,1,file_col,14,extent_start,14,extent_start_bytes,14,file_line_end,1,file_col_end,15,extent_end,15,extent_end_bytes,15,id,"9",name,"b",qualname,"::foo::b",value,"",type,"u32",scopeid,"0" 13 | variable,file_name,"tests/variable/fn_args_1.rs",file_line,1,file_col,21,extent_start,21,extent_start_bytes,21,file_line_end,1,file_col_end,22,extent_end,22,extent_end_bytes,22,id,"12",name,"c",qualname,"::foo::c",value,"",type,"u32",scopeid,"0" 14 | var_ref,file_name,"tests/variable/fn_args_1.rs",file_line,2,file_col,12,extent_start,42,extent_start_bytes,42,file_line_end,2,file_col_end,13,extent_end,43,extent_end_bytes,43,refid,"6",refidcrate,"0",qualname,"",scopeid,"15" 15 | var_ref,file_name,"tests/variable/fn_args_1.rs",file_line,2,file_col,16,extent_start,46,extent_start_bytes,46,file_line_end,2,file_col_end,17,extent_end,47,extent_end_bytes,47,refid,"9",refidcrate,"0",qualname,"",scopeid,"15" 16 | var_ref,file_name,"tests/variable/fn_args_1.rs",file_line,2,file_col,20,extent_start,50,extent_start_bytes,50,file_line_end,2,file_col_end,21,extent_end,51,extent_end_bytes,51,refid,"12",refidcrate,"0",qualname,"",scopeid,"15" 17 | function,file_name,"tests/variable/fn_args_1.rs",file_line,6,file_col,3,extent_start,94,extent_start_bytes,94,file_line_end,6,file_col_end,7,extent_end,98,extent_end_bytes,98,id,"72",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 18 | fn_call,file_name,"tests/variable/fn_args_1.rs",file_line,7,file_col,4,extent_start,107,extent_start_bytes,107,file_line_end,7,file_col_end,7,extent_end,110,extent_end_bytes,110,refid,"4",refidcrate,"0",qualname,"",scopeid,"74" 19 | -------------------------------------------------------------------------------- /tests/variable/fn_args_1.rs: -------------------------------------------------------------------------------- 1 | fn foo(a:u32, b:u32, c:u32) { 2 | let _ = a + b + c; 3 | println!("{} {} {}", a, b, c); 4 | } 5 | 6 | fn main() { 7 | foo(1, 2, 3); 8 | } 9 | -------------------------------------------------------------------------------- /tests/variable/fn_args_1_out.rs: -------------------------------------------------------------------------------- 1 | fn foo(z:u32, b:u32, c:u32) { 2 | let _ = z + b + c; 3 | println!("{} {} {}", a, b, c); 4 | } 5 | 6 | fn main() { 7 | foo(1, 2, 3); 8 | } 9 | -------------------------------------------------------------------------------- /tests/variable/fn_args_2.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/fn_args_2.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,8,file_col_end,0,extent_end,139,extent_end_bytes,139,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/fn_args_2.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/fn_args_2.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/fn_args_2.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/fn_args_2.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/fn_args_2.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/fn_args_2.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/fn_args_2.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/fn_args_2.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,6,extent_end,6,extent_end_bytes,6,id,"4",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/variable/fn_args_2.rs",file_line,1,file_col,7,extent_start,7,extent_start_bytes,7,file_line_end,1,file_col_end,8,extent_end,8,extent_end_bytes,8,id,"6",name,"a",qualname,"::foo::a",value,"",type,"u32",scopeid,"0" 12 | variable,file_name,"tests/variable/fn_args_2.rs",file_line,1,file_col,15,extent_start,15,extent_start_bytes,15,file_line_end,1,file_col_end,16,extent_end,16,extent_end_bytes,16,id,"10",name,"b",qualname,"::foo::b",value,"",type,"u32",scopeid,"0" 13 | variable,file_name,"tests/variable/fn_args_2.rs",file_line,1,file_col,28,extent_start,28,extent_start_bytes,28,file_line_end,1,file_col_end,29,extent_end,29,extent_end_bytes,29,id,"15",name,"c",qualname,"::foo::c",value,"",type,"u32",scopeid,"0" 14 | var_ref,file_name,"tests/variable/fn_args_2.rs",file_line,2,file_col,12,extent_start,54,extent_start_bytes,54,file_line_end,2,file_col_end,13,extent_end,55,extent_end_bytes,55,refid,"6",refidcrate,"0",qualname,"",scopeid,"19" 15 | var_ref,file_name,"tests/variable/fn_args_2.rs",file_line,2,file_col,16,extent_start,58,extent_start_bytes,58,file_line_end,2,file_col_end,17,extent_end,59,extent_end_bytes,59,refid,"10",refidcrate,"0",qualname,"",scopeid,"19" 16 | var_ref,file_name,"tests/variable/fn_args_2.rs",file_line,2,file_col,20,extent_start,62,extent_start_bytes,62,file_line_end,2,file_col_end,21,extent_end,63,extent_end_bytes,63,refid,"15",refidcrate,"0",qualname,"",scopeid,"19" 17 | function,file_name,"tests/variable/fn_args_2.rs",file_line,6,file_col,3,extent_start,106,extent_start_bytes,106,file_line_end,6,file_col_end,7,extent_end,110,extent_end_bytes,110,id,"76",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 18 | fn_call,file_name,"tests/variable/fn_args_2.rs",file_line,7,file_col,4,extent_start,119,extent_start_bytes,119,file_line_end,7,file_col_end,7,extent_end,122,extent_end_bytes,122,refid,"4",refidcrate,"0",qualname,"",scopeid,"78" 19 | -------------------------------------------------------------------------------- /tests/variable/fn_args_2.rs: -------------------------------------------------------------------------------- 1 | fn foo(a:u32, &b:&u32, &mut c:&mut u32) { 2 | let _ = a + b + c; 3 | println!("{} {} {}", a, b, c); 4 | } 5 | 6 | fn main() { 7 | foo(1, &2, &mut 3); 8 | } 9 | -------------------------------------------------------------------------------- /tests/variable/fn_args_2_1_out.rs: -------------------------------------------------------------------------------- 1 | fn foo(a:u32, &z:&u32, &mut c:&mut u32) { 2 | let _ = a + z + c; 3 | println!("{} {} {}", a, b, c); 4 | } 5 | 6 | fn main() { 7 | foo(1, &2, &mut 3); 8 | } 9 | -------------------------------------------------------------------------------- /tests/variable/fn_args_2_2_out.rs: -------------------------------------------------------------------------------- 1 | fn foo(a:u32, &b:&u32, &mut z:&mut u32) { 2 | let _ = a + b + z; 3 | println!("{} {} {}", a, b, c); 4 | } 5 | 6 | fn main() { 7 | foo(1, &2, &mut 3); 8 | } 9 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_global.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/name_conflict_global.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,6,file_col_end,0,extent_end,69,extent_end_bytes,69,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/name_conflict_global.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/name_conflict_global.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/name_conflict_global.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/name_conflict_global.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/name_conflict_global.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/name_conflict_global.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/name_conflict_global.rs" 9 | end_external_crates 10 | variable,file_name,"tests/variable/name_conflict_global.rs",file_line,1,file_col,7,extent_start,7,extent_start_bytes,7,file_line_end,1,file_col_end,10,extent_end,10,extent_end_bytes,10,id,"4",name,"FOO",qualname,"::FOO",value,"3",type,"u32",scopeid,"0" 11 | function,file_name,"tests/variable/name_conflict_global.rs",file_line,3,file_col,3,extent_start,24,extent_start_bytes,24,file_line_end,3,file_col_end,7,extent_end,28,extent_end_bytes,28,id,"7",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 12 | variable,file_name,"tests/variable/name_conflict_global.rs",file_line,4,file_col,8,extent_start,41,extent_start_bytes,41,file_line_end,4,file_col_end,9,extent_end,42,extent_end_bytes,42,id,"12",name,"a",qualname,"a$12",value,"a = 2",type,"u32",scopeid,"0" 13 | var_ref,file_name,"tests/variable/name_conflict_global.rs",file_line,5,file_col,12,extent_start,60,extent_start_bytes,60,file_line_end,5,file_col_end,15,extent_end,63,extent_end_bytes,63,refid,"4",refidcrate,"0",qualname,"",scopeid,"9" 14 | var_ref,file_name,"tests/variable/name_conflict_global.rs",file_line,5,file_col,18,extent_start,66,extent_start_bytes,66,file_line_end,5,file_col_end,19,extent_end,67,extent_end_bytes,67,refid,"12",refidcrate,"0",qualname,"",scopeid,"9" 15 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_global.rs: -------------------------------------------------------------------------------- 1 | static FOO:u32 = 3; 2 | 3 | fn main() { 4 | let a = 2; 5 | let _ = FOO + a; 6 | } 7 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_method.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/name_conflict_method.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,6,file_col_end,0,extent_end,51,extent_end_bytes,51,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/name_conflict_method.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/name_conflict_method.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/name_conflict_method.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/name_conflict_method.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/name_conflict_method.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/name_conflict_method.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/name_conflict_method.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/name_conflict_method.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,6,extent_end,6,extent_end_bytes,6,id,"4",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 11 | function,file_name,"tests/variable/name_conflict_method.rs",file_line,3,file_col,3,extent_start,16,extent_start_bytes,16,file_line_end,3,file_col_end,7,extent_end,20,extent_end_bytes,20,id,"7",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 12 | variable,file_name,"tests/variable/name_conflict_method.rs",file_line,4,file_col,8,extent_start,33,extent_start_bytes,33,file_line_end,4,file_col_end,9,extent_end,34,extent_end_bytes,34,id,"12",name,"a",qualname,"a$12",value,"a = 2",type,"i32",scopeid,"0" 13 | fn_call,file_name,"tests/variable/name_conflict_method.rs",file_line,5,file_col,4,extent_start,44,extent_start_bytes,44,file_line_end,5,file_col_end,7,extent_end,47,extent_end_bytes,47,refid,"4",refidcrate,"0",qualname,"",scopeid,"9" 14 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_method.rs: -------------------------------------------------------------------------------- 1 | fn foo() {} 2 | 3 | fn main() { 4 | let a = 2; 5 | foo(); 6 | } 7 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_method_global.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/name_conflict_method_global.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,6,file_col_end,0,extent_end,54,extent_end_bytes,54,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/name_conflict_method_global.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/name_conflict_method_global.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/name_conflict_method_global.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/name_conflict_method_global.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/name_conflict_method_global.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/name_conflict_method_global.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/name_conflict_method_global.rs" 9 | end_external_crates 10 | variable,file_name,"tests/variable/name_conflict_method_global.rs",file_line,1,file_col,7,extent_start,7,extent_start_bytes,7,file_line_end,1,file_col_end,8,extent_end,8,extent_end_bytes,8,id,"4",name,"a",qualname,"::a",value,"2",type,"u32",scopeid,"0" 11 | function,file_name,"tests/variable/name_conflict_method_global.rs",file_line,2,file_col,3,extent_start,21,extent_start_bytes,21,file_line_end,2,file_col_end,6,extent_end,24,extent_end_bytes,24,id,"7",qualname,"::foo",declid,"",declidcrate,"",scopeid,"0" 12 | function,file_name,"tests/variable/name_conflict_method_global.rs",file_line,4,file_col,3,extent_start,34,extent_start_bytes,34,file_line_end,4,file_col_end,7,extent_end,38,extent_end_bytes,38,id,"10",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 13 | fn_call,file_name,"tests/variable/name_conflict_method_global.rs",file_line,5,file_col,4,extent_start,47,extent_start_bytes,47,file_line_end,5,file_col_end,7,extent_end,50,extent_end_bytes,50,refid,"7",refidcrate,"0",qualname,"",scopeid,"12" 14 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_method_global.rs: -------------------------------------------------------------------------------- 1 | static a:u32 = 2; 2 | fn foo() {} 3 | 4 | fn main() { 5 | foo(); 6 | } 7 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_method_local.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/name_conflict_method_local.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,5,file_col_end,0,extent_end,54,extent_end_bytes,54,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/name_conflict_method_local.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/name_conflict_method_local.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/name_conflict_method_local.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/name_conflict_method_local.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/name_conflict_method_local.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/name_conflict_method_local.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/name_conflict_method_local.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/name_conflict_method_local.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | function,file_name,"tests/variable/name_conflict_method_local.rs",file_line,2,file_col,7,extent_start,19,extent_start_bytes,19,file_line_end,2,file_col_end,10,extent_end,22,extent_end_bytes,22,id,"8",qualname,"::main::foo",declid,"",declidcrate,"",scopeid,"6" 12 | variable,file_name,"tests/variable/name_conflict_method_local.rs",file_line,3,file_col,8,extent_start,36,extent_start_bytes,36,file_line_end,3,file_col_end,9,extent_end,37,extent_end_bytes,37,id,"13",name,"a",qualname,"a$13",value,"a = 2",type,"i32",scopeid,"0" 13 | fn_call,file_name,"tests/variable/name_conflict_method_local.rs",file_line,4,file_col,4,extent_start,47,extent_start_bytes,47,file_line_end,4,file_col_end,7,extent_end,50,extent_end_bytes,50,refid,"8",refidcrate,"0",qualname,"",scopeid,"6" 14 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_method_local.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | fn foo() {} 3 | let a = 2; 4 | foo(); 5 | } 6 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_method_local2.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/name_conflict_method_local2.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,6,file_col_end,0,extent_end,73,extent_end_bytes,73,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/name_conflict_method_local2.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/name_conflict_method_local2.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/name_conflict_method_local2.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/name_conflict_method_local2.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/name_conflict_method_local2.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/name_conflict_method_local2.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/name_conflict_method_local2.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/name_conflict_method_local2.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/variable/name_conflict_method_local2.rs",file_line,2,file_col,8,extent_start,20,extent_start_bytes,20,file_line_end,2,file_col_end,9,extent_end,21,extent_end_bytes,21,id,"9",name,"a",qualname,"a$9",value,"a = 2",type,"i32",scopeid,"0" 12 | function,file_name,"tests/variable/name_conflict_method_local2.rs",file_line,3,file_col,7,extent_start,34,extent_start_bytes,34,file_line_end,3,file_col_end,10,extent_end,37,extent_end_bytes,37,id,"12",qualname,"::main::foo",declid,"",declidcrate,"",scopeid,"6" 13 | fn_call,file_name,"tests/variable/name_conflict_method_local2.rs",file_line,4,file_col,4,extent_start,47,extent_start_bytes,47,file_line_end,4,file_col_end,7,extent_end,50,extent_end_bytes,50,refid,"12",refidcrate,"0",qualname,"",scopeid,"6" 14 | var_ref,file_name,"tests/variable/name_conflict_method_local2.rs",file_line,5,file_col,16,extent_start,70,extent_start_bytes,70,file_line_end,5,file_col_end,17,extent_end,71,extent_end_bytes,71,refid,"9",refidcrate,"0",qualname,"",scopeid,"6" 15 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_method_local2.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = 2; 3 | fn foo() {} 4 | foo(); 5 | let _ = 3 + a; 6 | } 7 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_type.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/name_conflict_type.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,5,file_col_end,0,extent_end,56,extent_end_bytes,56,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/name_conflict_type.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/name_conflict_type.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/name_conflict_type.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/name_conflict_type.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/name_conflict_type.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/name_conflict_type.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/name_conflict_type.rs" 9 | end_external_crates 10 | struct,file_name,"tests/variable/name_conflict_type.rs",file_line,1,file_col,7,extent_start,7,extent_start_bytes,7,file_line_end,1,file_col_end,10,extent_end,10,extent_end_bytes,10,id,"4",ctor_id,"5",qualname,"::Foo",scopeid,"0",value,"struct Foo;" 11 | function,file_name,"tests/variable/name_conflict_type.rs",file_line,2,file_col,3,extent_start,15,extent_start_bytes,15,file_line_end,2,file_col_end,7,extent_end,19,extent_end_bytes,19,id,"7",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 12 | variable,file_name,"tests/variable/name_conflict_type.rs",file_line,3,file_col,8,extent_start,32,extent_start_bytes,32,file_line_end,3,file_col_end,9,extent_end,33,extent_end_bytes,33,id,"12",name,"a",qualname,"a$12",value,"a = 2",type,"i32",scopeid,"0" 13 | variable,file_name,"tests/variable/name_conflict_type.rs",file_line,4,file_col,8,extent_start,47,extent_start_bytes,47,file_line_end,4,file_col_end,9,extent_end,48,extent_end_bytes,48,id,"16",name,"b",qualname,"b$16",value,"b = Foo",type,"Foo",scopeid,"0" 14 | type_ref,file_name,"tests/variable/name_conflict_type.rs",file_line,4,file_col,12,extent_start,51,extent_start_bytes,51,file_line_end,4,file_col_end,15,extent_end,54,extent_end_bytes,54,refid,"5",refidcrate,"0",qualname,"",scopeid,"9" 15 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_type.rs: -------------------------------------------------------------------------------- 1 | struct Foo; 2 | fn main() { 3 | let a = 2; 4 | let b = Foo; 5 | } 6 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_type_global.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/name_conflict_type_global.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,6,file_col_end,0,extent_end,60,extent_end_bytes,60,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/name_conflict_type_global.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/name_conflict_type_global.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/name_conflict_type_global.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/name_conflict_type_global.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/name_conflict_type_global.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/name_conflict_type_global.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/name_conflict_type_global.rs" 9 | end_external_crates 10 | struct,file_name,"tests/variable/name_conflict_type_global.rs",file_line,1,file_col,7,extent_start,7,extent_start_bytes,7,file_line_end,1,file_col_end,10,extent_end,10,extent_end_bytes,10,id,"4",ctor_id,"5",qualname,"::Foo",scopeid,"0",value,"struct Foo;" 11 | variable,file_name,"tests/variable/name_conflict_type_global.rs",file_line,2,file_col,7,extent_start,19,extent_start_bytes,19,file_line_end,2,file_col_end,8,extent_end,20,extent_end_bytes,20,id,"7",name,"a",qualname,"::a",value,"2",type,"u32",scopeid,"0" 12 | function,file_name,"tests/variable/name_conflict_type_global.rs",file_line,4,file_col,3,extent_start,34,extent_start_bytes,34,file_line_end,4,file_col_end,7,extent_end,38,extent_end_bytes,38,id,"10",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 13 | type_ref,file_name,"tests/variable/name_conflict_type_global.rs",file_line,5,file_col,12,extent_start,55,extent_start_bytes,55,file_line_end,5,file_col_end,15,extent_end,58,extent_end_bytes,58,refid,"5",refidcrate,"0",qualname,"",scopeid,"12" 14 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_type_global.rs: -------------------------------------------------------------------------------- 1 | struct Foo; 2 | static a:u32 = 2; 3 | 4 | fn main() { 5 | let _ = Foo; 6 | } 7 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_type_local.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/name_conflict_type_local.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,5,file_col_end,0,extent_end,60,extent_end_bytes,60,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/name_conflict_type_local.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/name_conflict_type_local.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/name_conflict_type_local.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/name_conflict_type_local.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/name_conflict_type_local.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/name_conflict_type_local.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/name_conflict_type_local.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/name_conflict_type_local.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | struct,file_name,"tests/variable/name_conflict_type_local.rs",file_line,2,file_col,11,extent_start,23,extent_start_bytes,23,file_line_end,2,file_col_end,14,extent_end,26,extent_end_bytes,26,id,"8",ctor_id,"9",qualname,"::main::Foo",scopeid,"4",value,"struct Foo;" 12 | variable,file_name,"tests/variable/name_conflict_type_local.rs",file_line,3,file_col,8,extent_start,36,extent_start_bytes,36,file_line_end,3,file_col_end,9,extent_end,37,extent_end_bytes,37,id,"13",name,"a",qualname,"a$13",value,"a = 2",type,"i32",scopeid,"0" 13 | variable,file_name,"tests/variable/name_conflict_type_local.rs",file_line,4,file_col,8,extent_start,51,extent_start_bytes,51,file_line_end,4,file_col_end,9,extent_end,52,extent_end_bytes,52,id,"17",name,"b",qualname,"b$17",value,"b = Foo",type,"main::Foo",scopeid,"0" 14 | type_ref,file_name,"tests/variable/name_conflict_type_local.rs",file_line,4,file_col,12,extent_start,55,extent_start_bytes,55,file_line_end,4,file_col_end,15,extent_end,58,extent_end_bytes,58,refid,"9",refidcrate,"0",qualname,"",scopeid,"6" 15 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_type_local.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | struct Foo; 3 | let a = 2; 4 | let b = Foo; 5 | } 6 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_type_local2.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/name_conflict_type_local2.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,5,file_col_end,0,extent_end,60,extent_end_bytes,60,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/name_conflict_type_local2.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/name_conflict_type_local2.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/name_conflict_type_local2.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/name_conflict_type_local2.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/name_conflict_type_local2.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/name_conflict_type_local2.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/name_conflict_type_local2.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/name_conflict_type_local2.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/variable/name_conflict_type_local2.rs",file_line,2,file_col,8,extent_start,20,extent_start_bytes,20,file_line_end,2,file_col_end,9,extent_end,21,extent_end_bytes,21,id,"9",name,"a",qualname,"a$9",value,"a = 2",type,"i32",scopeid,"0" 12 | struct,file_name,"tests/variable/name_conflict_type_local2.rs",file_line,3,file_col,11,extent_start,38,extent_start_bytes,38,file_line_end,3,file_col_end,14,extent_end,41,extent_end_bytes,41,id,"12",ctor_id,"13",qualname,"::main::Foo",scopeid,"4",value,"struct Foo;" 13 | variable,file_name,"tests/variable/name_conflict_type_local2.rs",file_line,4,file_col,8,extent_start,51,extent_start_bytes,51,file_line_end,4,file_col_end,9,extent_end,52,extent_end_bytes,52,id,"17",name,"b",qualname,"b$17",value,"b = Foo",type,"main::Foo",scopeid,"0" 14 | type_ref,file_name,"tests/variable/name_conflict_type_local2.rs",file_line,4,file_col,12,extent_start,55,extent_start_bytes,55,file_line_end,4,file_col_end,15,extent_end,58,extent_end_bytes,58,refid,"13",refidcrate,"0",qualname,"",scopeid,"6" 15 | -------------------------------------------------------------------------------- /tests/variable/name_conflict_type_local2.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = 2; 3 | struct Foo; 4 | let b = Foo; 5 | } 6 | -------------------------------------------------------------------------------- /tests/variable/override.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/override.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,7,file_col_end,0,extent_end,84,extent_end_bytes,84,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/override.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/override.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/override.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/override.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/override.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/override.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/override.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/override.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/variable/override.rs",file_line,2,file_col,8,extent_start,20,extent_start_bytes,20,file_line_end,2,file_col_end,9,extent_end,21,extent_end_bytes,21,id,"9",name,"u",qualname,"u$9",value,"u = 10",type,"i32",scopeid,"0" 12 | variable,file_name,"tests/variable/override.rs",file_line,4,file_col,12,extent_start,46,extent_start_bytes,46,file_line_end,4,file_col_end,13,extent_end,47,extent_end_bytes,47,id,"15",name,"v",qualname,"v$15",value,"v = 100",type,"i32",scopeid,"0" 13 | var_ref,file_name,"tests/variable/override.rs",file_line,5,file_col,16,extent_start,71,extent_start_bytes,71,file_line_end,5,file_col_end,17,extent_end,72,extent_end_bytes,72,refid,"9",refidcrate,"0",qualname,"",scopeid,"12" 14 | var_ref,file_name,"tests/variable/override.rs",file_line,5,file_col,20,extent_start,75,extent_start_bytes,75,file_line_end,5,file_col_end,21,extent_end,76,extent_end_bytes,76,refid,"15",refidcrate,"0",qualname,"",scopeid,"12" 15 | -------------------------------------------------------------------------------- /tests/variable/override.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let u = 10; 3 | { 4 | let v = 100; 5 | let _ = u + v; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/variable/working_fn_local.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/working_fn_local.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,7,file_col_end,0,extent_end,80,extent_end_bytes,80,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/working_fn_local.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/working_fn_local.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/working_fn_local.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/working_fn_local.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/working_fn_local.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/working_fn_local.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/working_fn_local.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/working_fn_local.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/variable/working_fn_local.rs",file_line,2,file_col,8,extent_start,20,extent_start_bytes,20,file_line_end,2,file_col_end,9,extent_end,21,extent_end_bytes,21,id,"9",name,"a",qualname,"a$9",value,"a = 2",type,"i32",scopeid,"0" 12 | struct,file_name,"tests/variable/working_fn_local.rs",file_line,4,file_col,15,extent_start,48,extent_start_bytes,48,file_line_end,4,file_col_end,18,extent_end,51,extent_end_bytes,51,id,"14",ctor_id,"15",qualname,"::main::Foo",scopeid,"4",value,"struct Foo;" 13 | variable,file_name,"tests/variable/working_fn_local.rs",file_line,5,file_col,12,extent_start,65,extent_start_bytes,65,file_line_end,5,file_col_end,13,extent_end,66,extent_end_bytes,66,id,"19",name,"b",qualname,"b$19",value,"b = Foo",type,"main::Foo",scopeid,"0" 14 | type_ref,file_name,"tests/variable/working_fn_local.rs",file_line,5,file_col,16,extent_start,69,extent_start_bytes,69,file_line_end,5,file_col_end,19,extent_end,72,extent_end_bytes,72,refid,"15",refidcrate,"0",qualname,"",scopeid,"12" 15 | -------------------------------------------------------------------------------- /tests/variable/working_fn_local.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let a = 2; 3 | { 4 | struct Foo; 5 | let b = Foo; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/variable/working_fn_local_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let Foo = 2; 3 | { 4 | struct Foo; 5 | let b = Foo; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/variable/working_mut_tuple_let.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/working_mut_tuple_let.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,4,file_col_end,0,extent_end,60,extent_end_bytes,60,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/working_mut_tuple_let.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/working_mut_tuple_let.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/working_mut_tuple_let.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/working_mut_tuple_let.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/working_mut_tuple_let.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/working_mut_tuple_let.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/working_mut_tuple_let.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/working_mut_tuple_let.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/variable/working_mut_tuple_let.rs",file_line,2,file_col,13,extent_start,25,extent_start_bytes,25,file_line_end,2,file_col_end,14,extent_end,26,extent_end_bytes,26,id,"10",name,"a",qualname,"a$10",value,"",type,"i32",scopeid,"0" 12 | variable,file_name,"tests/variable/working_mut_tuple_let.rs",file_line,2,file_col,16,extent_start,28,extent_start_bytes,28,file_line_end,2,file_col_end,17,extent_end,29,extent_end_bytes,29,id,"11",name,"b",qualname,"b$11",value,"(mut a, b) = (1, 2)",type,"i32",scopeid,"0" 13 | variable,file_name,"tests/variable/working_mut_tuple_let.rs",file_line,3,file_col,8,extent_start,49,extent_start_bytes,49,file_line_end,3,file_col_end,9,extent_end,50,extent_end_bytes,50,id,"17",name,"c",qualname,"c$17",value,"c = a + b",type,"i32",scopeid,"0" 14 | var_ref,file_name,"tests/variable/working_mut_tuple_let.rs",file_line,3,file_col,12,extent_start,53,extent_start_bytes,53,file_line_end,3,file_col_end,13,extent_end,54,extent_end_bytes,54,refid,"10",refidcrate,"0",qualname,"",scopeid,"6" 15 | var_ref,file_name,"tests/variable/working_mut_tuple_let.rs",file_line,3,file_col,16,extent_start,57,extent_start_bytes,57,file_line_end,3,file_col_end,17,extent_end,58,extent_end_bytes,58,refid,"11",refidcrate,"0",qualname,"",scopeid,"6" 16 | -------------------------------------------------------------------------------- /tests/variable/working_mut_tuple_let.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let (mut a, b) = (1, 2); 3 | let c = a + b; 4 | } 5 | -------------------------------------------------------------------------------- /tests/variable/working_mut_tuple_let2.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/working_mut_tuple_let2.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,4,file_col_end,0,extent_end,64,extent_end_bytes,64,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/working_mut_tuple_let2.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/working_mut_tuple_let2.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/working_mut_tuple_let2.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/working_mut_tuple_let2.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/working_mut_tuple_let2.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/working_mut_tuple_let2.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/working_mut_tuple_let2.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/working_mut_tuple_let2.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/variable/working_mut_tuple_let2.rs",file_line,2,file_col,13,extent_start,25,extent_start_bytes,25,file_line_end,2,file_col_end,14,extent_end,26,extent_end_bytes,26,id,"10",name,"a",qualname,"a$10",value,"",type,"i32",scopeid,"0" 12 | variable,file_name,"tests/variable/working_mut_tuple_let2.rs",file_line,2,file_col,20,extent_start,32,extent_start_bytes,32,file_line_end,2,file_col_end,21,extent_end,33,extent_end_bytes,33,id,"11",name,"b",qualname,"b$11",value,"",type,"i32",scopeid,"0" 13 | variable,file_name,"tests/variable/working_mut_tuple_let2.rs",file_line,3,file_col,8,extent_start,53,extent_start_bytes,53,file_line_end,3,file_col_end,9,extent_end,54,extent_end_bytes,54,id,"17",name,"c",qualname,"c$17",value,"c = a + b",type,"i32",scopeid,"0" 14 | var_ref,file_name,"tests/variable/working_mut_tuple_let2.rs",file_line,3,file_col,12,extent_start,57,extent_start_bytes,57,file_line_end,3,file_col_end,13,extent_end,58,extent_end_bytes,58,refid,"10",refidcrate,"0",qualname,"",scopeid,"6" 15 | var_ref,file_name,"tests/variable/working_mut_tuple_let2.rs",file_line,3,file_col,16,extent_start,61,extent_start_bytes,61,file_line_end,3,file_col_end,17,extent_end,62,extent_end_bytes,62,refid,"11",refidcrate,"0",qualname,"",scopeid,"6" 16 | -------------------------------------------------------------------------------- /tests/variable/working_mut_tuple_let2.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let (mut a, mut b) = (1, 2); 3 | let c = a + b; 4 | } 5 | -------------------------------------------------------------------------------- /tests/variable/working_mut_tuple_let2_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let (mut a, mut x) = (1, 2); 3 | let c = a + x; 4 | } 5 | -------------------------------------------------------------------------------- /tests/variable/working_mut_tuple_let3.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/working_mut_tuple_let3.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,4,file_col_end,0,extent_end,60,extent_end_bytes,60,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/working_mut_tuple_let3.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/working_mut_tuple_let3.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/working_mut_tuple_let3.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/working_mut_tuple_let3.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/working_mut_tuple_let3.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/working_mut_tuple_let3.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/working_mut_tuple_let3.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/working_mut_tuple_let3.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/variable/working_mut_tuple_let3.rs",file_line,2,file_col,9,extent_start,21,extent_start_bytes,21,file_line_end,2,file_col_end,10,extent_end,22,extent_end_bytes,22,id,"10",name,"a",qualname,"a$10",value,"(a, mut b) = (1, 2)",type,"i32",scopeid,"0" 12 | variable,file_name,"tests/variable/working_mut_tuple_let3.rs",file_line,2,file_col,16,extent_start,28,extent_start_bytes,28,file_line_end,2,file_col_end,17,extent_end,29,extent_end_bytes,29,id,"11",name,"b",qualname,"b$11",value,"",type,"i32",scopeid,"0" 13 | variable,file_name,"tests/variable/working_mut_tuple_let3.rs",file_line,3,file_col,8,extent_start,49,extent_start_bytes,49,file_line_end,3,file_col_end,9,extent_end,50,extent_end_bytes,50,id,"17",name,"c",qualname,"c$17",value,"c = a + b",type,"i32",scopeid,"0" 14 | var_ref,file_name,"tests/variable/working_mut_tuple_let3.rs",file_line,3,file_col,12,extent_start,53,extent_start_bytes,53,file_line_end,3,file_col_end,13,extent_end,54,extent_end_bytes,54,refid,"10",refidcrate,"0",qualname,"",scopeid,"6" 15 | var_ref,file_name,"tests/variable/working_mut_tuple_let3.rs",file_line,3,file_col,16,extent_start,57,extent_start_bytes,57,file_line_end,3,file_col_end,17,extent_end,58,extent_end_bytes,58,refid,"11",refidcrate,"0",qualname,"",scopeid,"6" 16 | -------------------------------------------------------------------------------- /tests/variable/working_mut_tuple_let3.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let (a, mut b) = (1, 2); 3 | let c = a + b; 4 | } 5 | -------------------------------------------------------------------------------- /tests/variable/working_mut_tuple_let3_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let (a, mut x) = (1, 2); 3 | let c = a + x; 4 | } 5 | -------------------------------------------------------------------------------- /tests/variable/working_mut_tuple_let_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let (mut x, b) = (1, 2); 3 | let c = x + b; 4 | } 5 | -------------------------------------------------------------------------------- /tests/variable/working_nested.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/working_nested.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,12,file_col_end,0,extent_end,158,extent_end_bytes,158,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/working_nested.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/working_nested.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/working_nested.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/working_nested.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/working_nested.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/working_nested.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/working_nested.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/working_nested.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/variable/working_nested.rs",file_line,2,file_col,12,extent_start,24,extent_start_bytes,24,file_line_end,2,file_col_end,13,extent_end,25,extent_end_bytes,25,id,"9",name,"a",qualname,"a$9",value,"",type,"i32",scopeid,"0" 12 | variable,file_name,"tests/variable/working_nested.rs",file_line,4,file_col,16,extent_start,53,extent_start_bytes,53,file_line_end,4,file_col_end,17,extent_end,54,extent_end_bytes,54,id,"16",name,"a",qualname,"a$16",value,"",type,"i32",scopeid,"0" 13 | variable,file_name,"tests/variable/working_nested.rs",file_line,6,file_col,20,extent_start,90,extent_start_bytes,90,file_line_end,6,file_col_end,21,extent_end,91,extent_end_bytes,91,id,"23",name,"a",qualname,"a$23",value,"",type,"i32",scopeid,"0" 14 | var_ref,file_name,"tests/variable/working_nested.rs",file_line,7,file_col,12,extent_start,109,extent_start_bytes,109,file_line_end,7,file_col_end,13,extent_end,110,extent_end_bytes,110,refid,"23",refidcrate,"0",qualname,"",scopeid,"20" 15 | var_ref,file_name,"tests/variable/working_nested.rs",file_line,9,file_col,8,extent_start,134,extent_start_bytes,134,file_line_end,9,file_col_end,9,extent_end,135,extent_end_bytes,135,refid,"16",refidcrate,"0",qualname,"",scopeid,"13" 16 | var_ref,file_name,"tests/variable/working_nested.rs",file_line,11,file_col,4,extent_start,151,extent_start_bytes,151,file_line_end,11,file_col_end,5,extent_end,152,extent_end_bytes,152,refid,"9",refidcrate,"0",qualname,"",scopeid,"6" 17 | -------------------------------------------------------------------------------- /tests/variable/working_nested.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut a = 2; 3 | { 4 | let mut a = 4; 5 | { 6 | let mut a = 8; 7 | a = 9; 8 | } 9 | a = 5; 10 | } 11 | a = 3; 12 | } 13 | -------------------------------------------------------------------------------- /tests/variable/working_nested_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let mut a = 2; 3 | { 4 | let mut b = 4; 5 | { 6 | let mut a = 8; 7 | a = 9; 8 | } 9 | b = 5; 10 | } 11 | a = 3; 12 | } 13 | -------------------------------------------------------------------------------- /tests/variable/working_rename_1_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let hello = 10; 3 | let y = 20; 4 | let z = 30; 5 | 6 | let mut i = 0; 7 | while i < 10 { 8 | let j = 2 * i; 9 | let k = 2 * i * j; 10 | let z = z * y * hello; 11 | println!("{} {} {}", j, k, z); 12 | i += 1; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tests/variable/working_rename_2_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let x = 10; 3 | let y = 20; 4 | let hello = 30; 5 | 6 | let mut i = 0; 7 | while i < 10 { 8 | let j = 2 * i; 9 | let k = 2 * i * j; 10 | let z = hello * y * x; 11 | println!("{} {} {}", j, k, z); 12 | i += 1; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tests/variable/working_tuple_let.csv: -------------------------------------------------------------------------------- 1 | crate,file_name,"tests/variable/working_tuple_let.rs",file_line,1,file_col,0,extent_start,0,extent_start_bytes,0,file_line_end,4,file_col_end,0,extent_end,56,extent_end_bytes,56,name,"unknown_crate" 2 | external_crate,name,"alloc",crate,"5",file_name,"tests/variable/working_tuple_let.rs" 3 | external_crate,name,"rand",crate,"7",file_name,"tests/variable/working_tuple_let.rs" 4 | external_crate,name,"std",crate,"1",file_name,"tests/variable/working_tuple_let.rs" 5 | external_crate,name,"collections",crate,"3",file_name,"tests/variable/working_tuple_let.rs" 6 | external_crate,name,"rustc_unicode",crate,"4",file_name,"tests/variable/working_tuple_let.rs" 7 | external_crate,name,"libc",crate,"6",file_name,"tests/variable/working_tuple_let.rs" 8 | external_crate,name,"core",crate,"2",file_name,"tests/variable/working_tuple_let.rs" 9 | end_external_crates 10 | function,file_name,"tests/variable/working_tuple_let.rs",file_line,1,file_col,3,extent_start,3,extent_start_bytes,3,file_line_end,1,file_col_end,7,extent_end,7,extent_end_bytes,7,id,"4",qualname,"::main",declid,"",declidcrate,"",scopeid,"0" 11 | variable,file_name,"tests/variable/working_tuple_let.rs",file_line,2,file_col,9,extent_start,21,extent_start_bytes,21,file_line_end,2,file_col_end,10,extent_end,22,extent_end_bytes,22,id,"10",name,"a",qualname,"a$10",value,"(a, b) = (1, 2)",type,"i32",scopeid,"0" 12 | variable,file_name,"tests/variable/working_tuple_let.rs",file_line,2,file_col,12,extent_start,24,extent_start_bytes,24,file_line_end,2,file_col_end,13,extent_end,25,extent_end_bytes,25,id,"11",name,"b",qualname,"b$11",value,"(a, b) = (1, 2)",type,"i32",scopeid,"0" 13 | variable,file_name,"tests/variable/working_tuple_let.rs",file_line,3,file_col,8,extent_start,45,extent_start_bytes,45,file_line_end,3,file_col_end,9,extent_end,46,extent_end_bytes,46,id,"17",name,"c",qualname,"c$17",value,"c = a + b",type,"i32",scopeid,"0" 14 | var_ref,file_name,"tests/variable/working_tuple_let.rs",file_line,3,file_col,12,extent_start,49,extent_start_bytes,49,file_line_end,3,file_col_end,13,extent_end,50,extent_end_bytes,50,refid,"10",refidcrate,"0",qualname,"",scopeid,"6" 15 | var_ref,file_name,"tests/variable/working_tuple_let.rs",file_line,3,file_col,16,extent_start,53,extent_start_bytes,53,file_line_end,3,file_col_end,17,extent_end,54,extent_end_bytes,54,refid,"11",refidcrate,"0",qualname,"",scopeid,"6" 16 | -------------------------------------------------------------------------------- /tests/variable/working_tuple_let.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let (a, b) = (1, 2); 3 | let c = a + b; 4 | } 5 | -------------------------------------------------------------------------------- /tests/variable/working_tuple_let_out.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let (x, b) = (1, 2); 3 | let c = x + b; 4 | } 5 | --------------------------------------------------------------------------------