GithubHelp home page GithubHelp logo

rustsym's People

Contributors

hawkw avatar llogiq avatar nox avatar trixnz avatar xaeroxe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rustsym's Issues

pub(in x) not supported

 $ rustsym search -l src/lib.rs Symbol
src/types_map/parsing.rs:26:5: 26:7 error: expected identifier, found keyword `in`
src/types_map/parsing.rs:26 pub(in types_map) fn parse_types_map(
                                ^~
error: internal compiler error: Error constructed but not emitted
thread 'main' panicked at 'explicit panic', .cargo/registry/src/github.com-1ecc6299db9ec823/syntex_errors-0.38.0/src/lib.rs:393

feature(llvm_asm, test, specialization, const_fn))] has been removed

cargo install -v rustsym

rustc 1.55.0-nightly (5a7834050 2021-06-23)
cargo 1.54.0-nightly (44456677b 2021-06-12)
     Running `rustc --crate-name serde_json --edition=2018 /Users/lavenderuni/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.64/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=3fdbdc286ac4f6ab -C extra-filename=-3fdbdc286ac4f6ab --out-dir /var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps -L dependency=/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps --extern itoa=/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps/libitoa-19a71e5d68c66870.rmeta --extern ryu=/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps/libryu-324322cff132e118.rmeta --extern serde=/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps/libserde-8b7b39554089312e.rmeta --cap-lints allow --cfg limb_width_64`
     Running `rustc --crate-name extprim /Users/lavenderuni/.cargo/registry/src/github.com-1ecc6299db9ec823/extprim-1.7.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="rand"' --cfg 'feature="serde"' --cfg 'feature="use-std"' -C metadata=6fa3bcbf11d1d84d -C extra-filename=-6fa3bcbf11d1d84d --out-dir /var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps -L dependency=/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps --extern num_traits=/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps/libnum_traits-e513228520d90021.rmeta --extern rand=/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps/librand-da651ec487764c79.rmeta --extern serde=/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps/libserde-8b7b39554089312e.rmeta --cap-lints allow --cfg 'extprim_channel="unstable"' --cfg extprim_has_stable_i128`
error[E0557]: feature has been removed
  --> /Users/lavenderuni/.cargo/registry/src/github.com-1ecc6299db9ec823/extprim-1.7.1/src/lib.rs:58:81
   |
58 | #![cfg_attr(extprim_channel="unstable", feature(llvm_asm, test, specialization, const_fn))]
   |                                                                                 ^^^^^^^^ feature has been removed
   |
   = note: split into finer-grained feature gates

error: aborting due to previous error

For more information about this error, try `rustc --explain E0557`.
error: could not compile `extprim`

Caused by:
  process didn't exit successfully: `rustc --crate-name extprim /Users/lavenderuni/.cargo/registry/src/github.com-1ecc6299db9ec823/extprim-1.7.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="rand"' --cfg 'feature="serde"' --cfg 'feature="use-std"' -C metadata=6fa3bcbf11d1d84d -C extra-filename=-6fa3bcbf11d1d84d --out-dir /var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps -L dependency=/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps --extern num_traits=/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps/libnum_traits-e513228520d90021.rmeta --extern rand=/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps/librand-da651ec487764c79.rmeta --extern serde=/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY/release/deps/libserde-8b7b39554089312e.rmeta --cap-lints allow --cfg 'extprim_channel="unstable"' --cfg extprim_has_stable_i128` (exit status: 1)
warning: build failed, waiting for other jobs to finish...
    Building [========================>  ] 79/83: serde_json



error: failed to compile `rustsym v0.3.2`, intermediate artifacts can be found at `/var/folders/lk/wv4ldjss537fmrfc34j5tfsm0000gn/T/cargo-installNddKiY`

Caused by:
  build failed

search -g not return anything?

rustsym search -g . main

returns

[]

while

rustsym search -l src/main.rs main

returns

[{"path":"src/main.rs","name":"main","container":"","kind":"function","line":8}]

Find alternative to syntex_syntax

Since syntex_syntax is no longer maintained, we need an alternative solution for parsing Rust to an AST.

I'm not as involved in the rust community as much as I would like to be, so I'm out of the loop as far as AST parsers go for Rust.

panics on some "use" statements

// this works
use std::ffi::{OsStr};

// this does not
use std::{ffi::OsStr};

fn main() -> std::io::Result<()> { return Ok(()); }

With this code panic popup rises:

rustsym panicked while searching D:\workspace\rust\udpate_generator\src\test.rs for symbols.
thread 'main' panicked at 'explicit panic', C:\Users\komp.cargo\registry\src\github.com-1ecc6299db9ec823\syntex_errors-0.59.1\src\diagnostic_builder.rs:204:13

rustsym can give wrong results because it doesn't run macros

The problem

So I've got this small project (can provide you a git repo if it helps) that uses the "mlua" crate. I have a file with this code:

use mlua::Lua;
use mlua::prelude::{LuaResult, LuaTable};

fn func1(_: &Lua, _: ()) -> LuaResult<()> {
    Ok(())
}

fn func2(_: &Lua, _: ()) -> LuaResult<()> {
    Ok(())
}

#[mlua::lua_module]
pub fn module(lua: &Lua) -> LuaResult<LuaTable> {
    lua.create_table_from(vec![
        ("func1", lua.create_function(func1)?),
        ("func2", lua.create_function(func2)?),
    ])
}

Now, I have a problem: I want to use this "module" function in another file. But see that #[mlua::lua_module]? That's a macro the mlua crate publishes, and it actually changes the name (and visibility) of the function it is attached to. It turns out it changes it to luaopen_module. But I didn't know that, so I installed rustsym.

So I run rustsym and:

Screen Shot 2021-02-21 at 12 59 26 AM

Cool, so there's an exported function named "module".

Except no:

Screen Shot 2021-02-20 at 7 59 13 PM

Eventually I figure out I can also use cargo doc --open for this purpose. Here's what it says exists:

Screen Shot 2021-02-21 at 12 42 34 AM

Screen Shot 2021-02-21 at 12 42 38 AM

Expected behavior

I think rustsym gave the incorrect name for luaopen_module because it doesn't run macros, whereas cargo doc --open gave the correct name because it did. Ideally rustsym should run macros.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.