5 ms·
Well, as I usually do when a new Rust comes out, I tried recompiling some programs that used to work. So far, not so good: > cargo clean; cargo update; ca
by Animats 11y ago
Well, as I usually do when a new Rust comes out, I tried recompiling some programs that used to work. So far, not so good:
> cargo clean; cargo update; cargo build;
Updating registry `https://github.com/rust-lang/crates.io-index`
Compiling libc v0.1.8
Compiling regex-syntax v0.2.1
Compiling memchr v0.1.3
Compiling aho-corasick v0.3.0
Compiling regex v0.1.41
/home/john/.cargo/registry/src/github.com-0a35038f75765ae4/regex-0.1.41/src/lib.rs:394:34:
394:51 error: #[feature] may not be used on the stable release channel
/home/john/.cargo/registry/src/github.com-0a35038f75765ae4/regex-0.1.41/src/lib.rs:394
#![cfg_attr(feature = "pattern", feature(pattern))]
^~~~~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `regex`.
Looks like Rust 1.2 broke Rust's regular expression module. Somebody isn't running enough regression tests.
- steveklabnik 11y agoHm, this looks like a nightly vs stable issue, are you sure you weren't on nightly before? Or, maybe something has turned on the 'pattern' feature, which is nightly only, accidentally.
- dbaupp 11y agoThe `cfg_attr` explicitly means that the `feature(pattern)` (the problem here) only gets activated when someone opts into it by activating regex's `pattern` feature, and by activating it they're opting-in to being nightly-only, i.e. outside the core stability guarantees of the stable releases. Could you post your Cargo.toml?
- Animats 11y ago[package] name = "hello_world" version = "0.0.1" authors = [ "John Nagle <nagle@animats.com>" ] [[bin]] name = "hello_world"
- steveklabnik 11y agoThat doesn't have any dependencies listed, how is it pulling in regex and such? Adding a [dependencies] regex = "*" and building works fine here... hm. (also that [[bin]] section is just repeating the defaults, you don't strictly need it)
- Animats 11y agoI dunno. Probably Cargo had some previous state stored somewhere that 'clean' didn't clear. I don't have time to figure out the internals of yet another weirdo build system.
- steveklabnik 11y agoOkay! That's not consistent with how Cargo is supposed to work, so if you can share anything, please open an issue. Sorry about that.
- coldtea 11y agoBut you have time to condescendingly call it "weirdo". Besides it having a bug (perhaps, it could have been messed up as they say from previously running nightly), what exactly looks "weirdo" about it?
- deleted 11y ago[deleted]
- burntsushi 11y agoThis is error could have been caused by having `regex_macros` listed as a dependency. (Which has never worked on Rust stable.) (The failure mode is bad here. Instead of reporting a compiler error on `regex_macros`, it's trying to compile `regex` with the `pattern` feature enabled, as specified in `regex_macros` Cargo.toml.) `regex` has worked on Rust stable since 1.0.