Skip to content

Commit

Permalink
fix(core): in-libstd build attempting to use std
Browse files Browse the repository at this point in the history
Make sure core and not std is used when rustc-dep-of-std feature is enabled.
May or may not fix #97
  • Loading branch information
oyvindln committed Oct 4, 2020
1 parent 8085909 commit 5a5522d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Empty file modified miniz_oxide/build.rs
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions miniz_oxide/src/inflate/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! This module contains functionality for decompression.

use ::core::cmp::min;
use ::core::usize;
use crate::alloc::boxed::Box;
use crate::alloc::vec;
use crate::alloc::vec::Vec;
use ::core::cmp::min;
use ::core::usize;

pub mod core;
mod output_buffer;
Expand Down
7 changes: 4 additions & 3 deletions miniz_oxide/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@

#![allow(warnings)]
#![forbid(unsafe_code)]
#![cfg_attr(has_alloc, no_std)]
#![cfg_attr(any(has_alloc, feature = "rustc-dep-of-std"), no_std)]

#[cfg(has_alloc)]
// autocfg does not work when building in libstd, so manually enable this for that use case now.
#[cfg(any(has_alloc, feature = "rustc-dep-of-std"))]
extern crate alloc;
#[cfg(not(has_alloc))]
#[cfg(all(not(has_alloc), not(feature = "rustc-dep-of-std")))]
use std as alloc;

#[cfg(test)]
Expand Down

0 comments on commit 5a5522d

Please sign in to comment.