Skip to content

Using rust nightly when syntax checking in sublime #187

New issue

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

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

Already on GitHub? Sign in to your account

Closed
akshaynanavati opened this issue May 29, 2017 · 6 comments
Closed

Using rust nightly when syntax checking in sublime #187

akshaynanavati opened this issue May 29, 2017 · 6 comments
Milestone

Comments

@akshaynanavati
Copy link

akshaynanavati commented May 29, 2017

Sublime Text Version

Sublime Text 3 (Build 3132)

Rust Enhanced Version

1.3.2

Operating system

OS Name Mac OS Sierra
Version 10.12.4 (16E195)

Expected behavior

When saving a file using nightly (unstable) features, sublime shows a compile error, while the code compiles (my rustup default is nightly).

Actual behavior

It should not show errors if my rustup default is nightly. If it is stable, it can show errors.

@ehuss
Copy link

ehuss commented May 29, 2017

That shouldn't be happening. I assume by errors, it is saying something like may not be used on the stable release channel? Is it possible that Sublime is using a different cargo from your terminal? The current version of Rust Enhanced prepends ~/.cargo/bin to your PATH. Is that the expected version?

Also, are there any unexpected entries in rustup override list? The current version of Rust Enhanced runs cargo in the directory of the source file.

@akshaynanavati
Copy link
Author

This is what I mean by error:

screen shot 2017-05-29 at 12 02 29 pm

How can I tell which cargo sublime is using? AFAIK I only have one installed and that lives in ~/.cargo/bin. My $PATH has ~/.cargo/bin in it.

This is output of rustup override list:

$ rustup override list
no overrides

@ehuss
Copy link

ehuss commented May 29, 2017

It looks like it is using nightly, otherwise it wouldn't include the help line. Do you have #![feature(unique)] in the crate root? Perhaps it has something to do with how your targets are set up. You can see which target it is trying to compile in the Sublime console when you save a file (Running 'cargo rustc --lib ...). If you run that command in your terminal you should get the same result.

@akshaynanavati
Copy link
Author

Ah okay, I was using a feature (unstable) behind which I was using the unstable feature unique (ref: https://stackoverflow.com/questions/37674758/ignore-benchmarks-when-using-stable-beta). Therefore when compiling I would use cargo build --features "unstable". I'm assuming the sublime rust package does not enable this feature. Is there a way to configure it as such? Once I removed that, it works fine.

@ehuss
Copy link

ehuss commented May 29, 2017

Ah. Currently it does not have support for passing extra command-line args. #165 adds support for this. In the meantime, one workaround is to add "unstable" to your list of default features in Cargo.toml.

@jasonwilliams jasonwilliams added this to the v2.0.0 milestone May 30, 2017
@jasonwilliams
Copy link
Member

Should be fixed in 2.0.0, see readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants