Skip to content
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

Please consider adding some sort of compat shim for rustc < 1.36 #187

Closed
kentfredric opened this issue Dec 10, 2019 · 3 comments
Closed

Comments

@kentfredric
Copy link

See:
unicode-rs/unicode-normalization#50

As this breakage is now percolating into:

Failure Trace
/smallvec-1.0.0 $ cargo +1.35.0 test
   Compiling serde v1.0.103
   Compiling byteorder v1.3.2
   Compiling autocfg v0.1.7
   Compiling smallvec v1.0.0 (/home/kent/.cpanm/work/1575954646.3315/smallvec-1.0.0)
error[E0658]: use of unstable library feature 'alloc': this library is unlikely to be stabilized in its current form or name (see issue #27783)
  --> lib.rs:38:1
   |
38 | extern crate alloc;
   | ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
  --> lib.rs:51:5
   |
51 | use core::mem::MaybeUninit;
   |     ^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:298:12
    |
298 |     Inline(MaybeUninit<A>),
    |            ^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:319:28
    |
319 |     fn from_inline(inline: MaybeUninit<A>) -> SmallVecData<A> {
    |                            ^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:323:36
    |
323 |     unsafe fn into_inline(self) -> MaybeUninit<A> {
    |                                    ^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:398:45
    |
398 |             data: SmallVecData::from_inline(MaybeUninit::uninit()),
    |                                             ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:438:63
    |
438 |                 let mut data = SmallVecData::<A>::from_inline(MaybeUninit::uninit());
    |                                                               ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:474:45
    |
474 |             data: SmallVecData::from_inline(MaybeUninit::new(buf)),
    |                                             ^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:493:55
    |
493 |         unsafe { SmallVec::from_buf_and_len_unchecked(MaybeUninit::new(buf), len) }
    |                                                       ^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:512:51
    |
512 |     pub unsafe fn from_buf_and_len_unchecked(buf: MaybeUninit<A>, len: usize) -> SmallVec<A> {
    |                                                   ^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:674:55
    |
674 |                 self.data = SmallVecData::from_inline(MaybeUninit::uninit());
    |                                                       ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:741:55
    |
741 |                 self.data = SmallVecData::from_inline(MaybeUninit::uninit());
    |                                                       ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
    --> lib.rs:1074:52
     |
1074 |                     let mut data: MaybeUninit<A> = MaybeUninit::uninit();
     |                                                    ^^^^^^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
    --> lib.rs:1074:35
     |
1074 |                     let mut data: MaybeUninit<A> = MaybeUninit::uninit();
     |                                   ^^^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:307:42
    |
307 |             SmallVecData::Inline(a) => a.as_ptr() as *const A::Item,
    |                                          ^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:314:42
    |
314 |             SmallVecData::Inline(a) => a.as_mut_ptr() as *mut A::Item,
    |                                          ^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
   --> lib.rs:912:39
    |
912 |                 Ok(data.into_inline().assume_init())
    |                                       ^^^^^^^^^^^

error[E0658]: use of unstable library feature 'maybe_uninit' (see issue #53491)
    --> lib.rs:1077:30
     |
1077 |                         data.as_mut_ptr() as *mut A::Item,
     |                              ^^^^^^^^^^

error: aborting due to 18 previous errors

For more information about this error, try `rustc --explain E0658`.
error: Could not compile `smallvec`.
warning: build failed, waiting for other jobs to finish...
error: build failed
@mbrubeck
Copy link
Collaborator

smallvec 0.6.13 contains a compat shim for older rustc. We intentionally broke compatibility in the new major version 1.0.0. If we can't drop old version support as part of a new major release, then we can never drop it. :(

People who need to build on older Rust versions can use Cargo.lock to pin their dependencies to ones that work on those versions (for example using cargo update -p unicode-normalization --precise 0.1.9).

@kentfredric
Copy link
Author

Not trying to point fingers at any specific person here, but messes like this undermine the idea rust puts forward of:

A language empowering everyone to build reliable and efficient software.

It narrows the scope from "everyone" to "a privileged class", and everyone else gets incremental unreliability.

I guess its the kind of unreliable that fails to compile, but for a consumer, this is all terrible.

@stevenroose
Copy link

Came here for the same reason. To prevent randomly seeing our projects break on older Rust versions, we have the jsonrpc crate use an older version of hyper. However recently it somehow also broke through some downstream MSRV breakage without a proper semver major update.

This is the dep tree:

├── jsonrpc v0.11.0
│   ├── hyper v0.10.16
│   │   ├── base64 v0.9.3
│   │   │   ├── byteorder v1.3.2
│   │   │   └── safemem v0.3.3
│   │   ├── httparse v1.3.4
│   │   ├── language-tags v0.2.2
│   │   ├── log v0.3.9
│   │   │   └── log v0.4.8
│   │   │       └── cfg-if v0.1.10
│   │   ├── mime v0.2.6
│   │   │   └── log v0.3.9 (*)
│   │   ├── num_cpus v1.12.0
│   │   │   └── libc v0.2.66
│   │   ├── time v0.1.42
│   │   │   └── libc v0.2.66 (*)
│   │   │   [dev-dependencies]
│   │   │   └── winapi v0.3.8
│   │   ├── traitobject v0.1.0
│   │   ├── typeable v0.1.2
│   │   ├── unicase v1.4.2
│   │   │   [build-dependencies]
│   │   │   └── version_check v0.1.5
│   │   └── url v1.7.2
│   │       ├── idna v0.1.5
│   │       │   ├── matches v0.1.8
│   │       │   ├── unicode-bidi v0.3.4
│   │       │   │   └── matches v0.1.8 (*)
│   │       │   └── unicode-normalization v0.1.12
│   │       │       └── smallvec v1.2.0
│   │       ├── matches v0.1.8 (*)
│   │       └── percent-encoding v1.0.1
│   ├── serde v1.0.104 (*)
│   ├── serde_derive v1.0.104 (*)
│   └── serde_json v1.0.45 (*)

And now we're getting a bunch of these errors where it looks like smallvec semver violations are to blame:

error[E0432]: unresolved import `core::mem::MaybeUninit`
  --> /home/steven/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:49:5
   |
49 | use core::mem::MaybeUninit;
   |     ^^^^^^^^^^^^^^^^^^^^^^ no `MaybeUninit` in `mem`

error[E0432]: unresolved import `core::ops::RangeBounds`
  --> /home/steven/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:50:23
   |
50 | use core::ops::{self, RangeBounds};
   |                       ^^^^^^^^^^^ no `RangeBounds` in `ops`

error[E0432]: unresolved import `core::ptr::NonNull`
  --> /home/steven/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-1.2.0/lib.rs:51:23
   |
51 | use core::ptr::{self, NonNull};
   |                       ^^^^^^^ no `NonNull` in `ptr`

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