casbin / casbin-rs

An authorization library that supports access control models like ACL, RBAC, ABAC in Rust.
https://casbin.org
Apache License 2.0
828 stars 67 forks source link

Getting a error while setting up rust-basin-example in local environment #289

Closed SiddheshKanawade closed 2 years ago

SiddheshKanawade commented 2 years ago

I was trying to setup the local environment to run rust-cabin-example. I am consistently getting an error saying upgrade to latest version of RUST. I am using 2021 version of rust in project and have tried cargo fix —edition but still issue continues. Can someone please help to solve this issue Following is the screenshot of the issue:

Screen Shot 2022-02-23 at 4 22 33 PM

Following is how my Cargo.toml file looks like

Screen Shot 2022-02-26 at 7 33 00 AM

casbin-bot commented 2 years ago

@smrpn @hackerchai @PsiACE @GopherJ

hsluoyz commented 2 years ago

@PsiACE

PsiACE commented 2 years ago

Do not use rustc directly. I highly recommend that you use cargo for all the work that needs to be done.

I have tried cargo build in this project and there will not be any problem.

SiddheshKanawade commented 2 years ago

I have tried using cargo build and cargo test and then I ran the project using cargo run. It worked in my case but not sure why rustc gave error. Still this solves the issue in my case, thanks for the help. Also, @PsiACE, do we still have to implement Rust version of Casbin server, since this feature is removed from Casbin-rs project (GSOC '22).

PsiACE commented 2 years ago

hi @SiddheshKanawade , In GSoC 2021, we have a casbin-grpc that you can consider to improve on it.

SiddheshKanawade commented 2 years ago

Sure, I will try to improve on it Thank you.

schungx commented 2 years ago

https://doc.rust-lang.org/rustc/command-line-arguments.html#--edition-specify-the-edition-to-use

rustc defaults to 2015.

cargo just passes the correct edition to rustc. If you invoke rustc directly, you need to specify the edition yourself.

SiddheshKanawade commented 2 years ago

@schungx Thank you for your help, now its clear why rustc gave error.