-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Don’t suggest 'help: add #![feature(…)]' when it’s forbidden #23973
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
Comments
Gonna milestone this real quick, as it seems quite important. |
I might be able to whip up a quick fix, though I'm not 100% sure about testing it properly ... (I've never actually tried building something for a non-dev release channel before...) |
after chatting with @pnkfelix it seems like I have a patch, building it now |
gonna leave @pnkfelix to it |
Do not suggest `#![feature(...)]` if we are in beta or stable channel. Fix #23973
Hello good Rust folks 😄 Before the beta, I used Thanks for any tip / hints you can offer 👍 |
Hi @conradkleinespel. Commenting on random unrelated issues is usually not the right thing to do. You should rather open a new issue, or ask on http://users.rust-lang.org/ . But to answer your question anyway, that trait only has one method:
… and |
@SimonSapin Thanks for taking the time to answer. I appreciate it. I don't see how this is unrelated. This is related, since the code I'm talking about used to compile with Thanks for your tip on copying the function 👍 I guess I'll just do that if nothing better is available and change this again when the trait is stable. |
This specific issue is about fixing one of the compiler’s error message, not about fixing code that triggers that error. It really helps everyone to keep discussions on topic. |
Alright. I understand. I'll make sure to open a new issue or go on StackOverflow next time if appropriate. Thanks again 👍 |
This doesn't seem to be properly fixed in the beta channel. I'm still being recommended to add [/tmp] rustc snappy.rs
snappy.rs:1:1: 1:19 error: use of unstable library feature 'libc'
snappy.rs:1 extern crate libc;
^~~~~~~~~~~~~~~~~~
snappy.rs:1:19: 1:19 help: add #![feature(libc)] to the crate attributes to enable
snappy.rs:2:5: 2:17 error: use of unstable library feature 'libc'
snappy.rs:2 use libc::size_t;
^~~~~~~~~~~~
snappy.rs:2:17: 2:17 help: add #![feature(libc)] to the crate attributes to enable
snappy.rs:6:56: 6:62 error: use of unstable library feature 'libc'
snappy.rs:6 fn snappy_max_compressed_length(source_length: size_t) -> size_t;
^~~~~~
snappy.rs:6:62: 6:62 help: add #![feature(libc)] to the crate attributes to enable
snappy.rs:6:67: 6:73 error: use of unstable library feature 'libc'
snappy.rs:6 fn snappy_max_compressed_length(source_length: size_t) -> size_t;
^~~~~~
snappy.rs:6:73: 6:73 help: add #![feature(libc)] to the crate attributes to enable
error: aborting due to 4 previous errors
[/tmp] rustc snappy.rs
snappy.rs:1:1: 1:18 error: unstable feature
snappy.rs:1 #![feature(libc)]
^~~~~~~~~~~~~~~~~
note: this feature may not be used in the beta release channel
error: aborting due to previous error Rust version: [/tmp] rustc --version
rustc 1.0.0-beta (9854143cb 2015-04-02) (built 2015-04-02) The code I used (snappy example in the docs with the extra addition on the first line: #![feature(libc)]
extern crate libc;
use libc::size_t;
#[link(name = "snappy")]
extern {
fn snappy_max_compressed_length(source_length: size_t) -> size_t;
}
fn main() {
let x = unsafe { snappy_max_compressed_length(100) };
println!("max compressed length of a 100 byte buffer: {}", x);
} |
This happened after Beta release. |
Whoops, I thought this made it in before beta. Thanks! |
@brson, are there plans to release updates to the beta channel within a given 6 weeks cycle? Either this one or in the future. |
I'm certain there will be updates; see discussion from last night here: https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2015-04-07.md#policy-for-prs-targeting-beta-vs-master |
So how does one fix this error? I'm a new user of the rust library and I can't seem to use the collections library during the beta due to this problem. Given this git issue is a top google result, it would be nice if there were a solution here. Edit: Looks like the solution is to switch to the rust nightly. Is the entire collections library off-limits in the beta? |
@Russell91 by design, you have access to the parts of |
Steps to reproduce:
The output of
rustc a.rs
is:b.rs
does as suggested by thehelp
message, but that fails too (as expected):Proposed fix: in the beta and stable channels (i.e. whenever
#![feature(…)]
is forbidden), thehelp
message that suggests adding#![feature(…)]
should not be shown.(Clean up the test case with
multirust remove-override; cd ..; rm -r foo
.)CC @brson
The text was updated successfully, but these errors were encountered: