namib-project / dcaf-rs

Implementation of the ACE-OAuth framework.
4 stars 1 forks source link

Using `dcaf` in a ` no_std` environment seems not to work #2

Closed JKRhb closed 2 years ago

JKRhb commented 2 years ago

When adding dcaf to a no_std project (with default-features set to false), the build process fails with the following error messages:

Terminal output of the error messages ``` Compiling dcaf v0.3.1 error[E0433]: failed to resolve: use of undeclared crate or module `std` --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_map/mod.rs:53:5 | 53 | use std::any::type_name; | ^^^ use of undeclared crate or module `std` error[E0433]: failed to resolve: use of undeclared crate or module `std` --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/error/mod.rs:16:5 | 16 | use std::marker::PhantomData; | ^^^ use of undeclared crate or module `std` error[E0433]: failed to resolve: use of undeclared crate or module `std` --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/error/mod.rs:17:5 | 17 | use std::num::TryFromIntError; | ^^^ use of undeclared crate or module `std` error: cannot find macro `vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_values/mod.rs:192:21 | 192 | vec![( | ^^^ | = note: consider importing this macro: alloc::vec error: cannot find macro `vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_values/mod.rs:199:21 | 199 | vec![( | ^^^ | = note: consider importing this macro: alloc::vec error: cannot find macro `vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_values/mod.rs:208:21 | 208 | vec![(x, Some(Box::new(Value::Bytes(kid.clone()))))] | ^^^ | = note: consider importing this macro: alloc::vec error: cannot find macro `format` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_values/mod.rs:226:63 | 226 | ... TryFromCborMapError::from_message(format!( | ^^^^^^ | = note: consider importing this macro: alloc::format error: cannot find macro `format` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_values/mod.rs:233:63 | 233 | ... TryFromCborMapError::from_message(format!( | ^^^^^^ | = note: consider importing this macro: alloc::format error: cannot find macro `vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:675:20 | 675 | Ok(vec![self.0.as_slice()]) | ^^^ | = note: consider importing this macro: alloc::vec error: cannot find macro `vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:770:26 | 770 | Value::Array(vec![ | ^^^ | = note: consider importing this macro: alloc::vec error: cannot find macro `vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:824:26 | 824 | Value::Array(vec![ | ^^^ | = note: consider importing this macro: alloc::vec error: cannot find macro `vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:918:13 | 918 | vec![self.element()] | ^^^ | = note: consider importing this macro: alloc::vec error: cannot find macro `vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:924:13 | 924 | vec![self.to_element()] | ^^^ | = note: consider importing this macro: alloc::vec error: cannot find macro `format` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/error/mod.rs:110:22 | 110 | message: format!("couldn't build {name}: {builder_error}"), | ^^^^^^ | = note: consider importing this macro: alloc::format error: cannot find macro `format` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/error/mod.rs:98:22 | 98 | message: format!("unknown field with key {key} encountered"), | ^^^^^^ | = note: consider importing this macro: alloc::format error: cannot find macro `vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_map/mod.rs:85:10 | 85 | vec![$( | ^^^ | ::: /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/creation_hint/mod.rs:138:20 | 138 | return cbor_map_vec! { | ____________________- 139 | | creation_hint::AS => self.auth_server.as_ref(), 140 | | creation_hint::KID => self.kid.as_ref(), 141 | | creation_hint::AUDIENCE => self.audience.as_ref(), 142 | | creation_hint::SCOPE => self.scope.as_ref(), 143 | | creation_hint::CNONCE => self.client_nonce.as_ref().map(|v| Value::Bytes(v.clone())) 144 | | }; | |_____________- in this macro invocation | = note: consider importing this macro: alloc::vec = note: this error originates in the macro `cbor_map_vec` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `format` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_map/mod.rs:320:43 | 320 | TryFromCborMapError::from_message(format!( | ^^^^^^ | = note: consider importing this macro: alloc::format error: cannot find macro `format` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_map/mod.rs:299:58 | 299 | return Err(TryFromCborMapError::from_message(format!( | ^^^^^^ | = note: consider importing this macro: alloc::format error: cannot find macro `format` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_map/mod.rs:285:56 | 285 | .map_err(|e| TryFromCborMapError::from_message(format!("couldn't decode scope: {e}"))) | ^^^^^^ | = note: consider importing this macro: alloc::format error: cannot find macro `vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_map/mod.rs:85:10 | 85 | vec![$( | ^^^ | ::: /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/token_req/mod.rs:838:13 | 838 | / cbor_map_vec! { 839 | | token::ERROR => Some(error), 840 | | token::ERROR_DESCRIPTION => self.description.as_ref(), 841 | | token::ERROR_URI => self.uri.as_ref() 842 | | } | |_____________- in this macro invocation | = note: consider importing this macro: alloc::vec = note: this error originates in the macro `cbor_map_vec` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_map/mod.rs:85:10 | 85 | vec![$( | ^^^ | ::: /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/token_req/mod.rs:777:13 | 777 | / ... cbor_map_vec! { 778 | | ... token::ACCESS_TOKEN => Some(Value::Bytes(self.access_token.clone())), 779 | | ... token::EXPIRES_IN => self.expires_in, 780 | | ... introspection::ISSUED_AT => self.issued_at.as_ref().map(|x| x.clone().to_cbor_value().expect("serialization of issued_at failed... ... | 786 | | ... token::RS_CNF => self.rs_cnf.as_ref().map(ToCborMap::to_ciborium_value) 787 | | ... } | |_______- in this macro invocation | = note: consider importing this macro: alloc::vec = note: this error originates in the macro `cbor_map_vec` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find macro `vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_map/mod.rs:85:10 | 85 | vec![$( | ^^^ | ::: /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/token_req/mod.rs:727:13 | 727 | / cbor_map_vec! { 728 | | introspection::ISSUER => self.issuer.as_ref(), 729 | | token::REQ_CNF => self.req_cnf.as_ref().map(ToCborMap::to_ciborium_value), 730 | | token::AUDIENCE => self.audience.as_ref(), ... | 736 | | token::CNONCE => self.client_nonce.as_ref().map(|v| Value::Bytes(v.clone())) 737 | | } | |_____________- in this macro invocation | = note: consider importing this macro: alloc::vec = note: this error originates in the macro `cbor_map_vec` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_map/mod.rs:404:30 | 404 | let map: Vec<(i128, Value)> = | ^^^ not found in this scope | help: consider importing one of these items | 367 | use alloc::vec::Vec; | 367 | use crate::common::cbor_map::Vec; | 367 | use serde::__private::Vec; | error[E0412]: cannot find type `Box` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/cbor_values/mod.rs:187:52 | 187 | fn to_cbor_map(&self) -> Vec<(i128, Option>)> { | ^^^ not found in this scope | help: consider importing this struct | 142 | use alloc::boxed::Box; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:390:28 | 390 | pub struct AifEncodedScope(Vec); | ^^^ not found in this scope | help: consider importing one of these items | 92 | use alloc::vec::Vec; | 92 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:588:18 | 588 | impl TryFrom> for TextEncodedScope { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:591:28 | 591 | fn try_from(value: Vec<&str>) -> Result { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:648:21 | 648 | ) -> Result, InvalidBinaryEncodedScopeError> { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:780:30 | 780 | pub fn new(elements: Vec) -> AifEncodedScope { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:797:36 | 797 | pub fn elements(&self) -> &Vec { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:814:37 | 814 | pub fn to_elements(self) -> Vec { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:832:18 | 832 | impl From)>> for AifEncodedScope | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:836:24 | 836 | fn from(value: Vec<(T, BitFlags)>) -> Self { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:846:18 | 846 | impl TryFrom> for AifEncodedScope { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:849:28 | 849 | fn try_from(value: Vec<(String, u64)>) -> Result { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:854:39 | 854 | .collect::, InvalidAifEncodedScopeError>>( | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:917:35 | 917 | pub fn elements(&self) -> Vec<&AifEncodedScopeElement> { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:923:37 | 923 | pub fn to_elements(self) -> Vec { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:952:18 | 952 | impl TryFrom> for Scope { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:955:28 | 955 | fn try_from(value: Vec<&str>) -> Result { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:968:18 | 968 | impl TryFrom> for Scope { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:971:28 | 971 | fn try_from(value: Vec<(String, u64)>) -> Result { | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:1086:47 | 1086 | ... .collect::, InvalidAifEncodedScopeError>>() | ^^^ not found in this scope | help: consider importing one of these items | 537 | use alloc::vec::Vec; | 537 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/creation_hint/mod.rs:96:30 | 96 | pub client_nonce: Option>, | ^^^ not found in this scope | help: consider importing one of these items | 18 | use alloc::vec::Vec; | 18 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/creation_hint/mod.rs:137:34 | 137 | fn to_cbor_map(&self) -> Vec<(i128, Option>)> { | ^^^ not found in this scope | help: consider importing one of these items | 127 | use alloc::vec::Vec; | 127 | use serde::__private::Vec; | error[E0412]: cannot find type `Box` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/creation_hint/mod.rs:137:52 | 137 | fn to_cbor_map(&self) -> Vec<(i128, Option>)> { | ^^^ not found in this scope | help: consider importing this struct | 127 | use alloc::boxed::Box; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/creation_hint/mod.rs:147:35 | 147 | fn try_from_cbor_map(map: Vec<(i128, Value)>) -> Result | ^^^ not found in this scope | help: consider importing one of these items | 127 | use alloc::vec::Vec; | 127 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/token_req/mod.rs:725:34 | 725 | fn to_cbor_map(&self) -> Vec<(i128, Option>)> { | ^^^ not found in this scope | help: consider importing one of these items | 614 | use alloc::vec::Vec; | 614 | use serde::__private::Vec; | error[E0412]: cannot find type `Box` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/token_req/mod.rs:725:52 | 725 | fn to_cbor_map(&self) -> Vec<(i128, Option>)> { | ^^^ not found in this scope | help: consider importing this struct | 614 | use alloc::boxed::Box; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/token_req/mod.rs:740:35 | 740 | fn try_from_cbor_map(map: Vec<(i128, Value)>) -> Result | ^^^ not found in this scope | help: consider importing one of these items | 614 | use alloc::vec::Vec; | 614 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/token_req/mod.rs:774:34 | 774 | fn to_cbor_map(&self) -> Vec<(i128, Option>)> { | ^^^ not found in this scope | help: consider importing one of these items | 614 | use alloc::vec::Vec; | 614 | use serde::__private::Vec; | error[E0412]: cannot find type `Box` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/token_req/mod.rs:774:52 | 774 | fn to_cbor_map(&self) -> Vec<(i128, Option>)> { | ^^^ not found in this scope | help: consider importing this struct | 614 | use alloc::boxed::Box; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/token_req/mod.rs:790:35 | 790 | fn try_from_cbor_map(map: Vec<(i128, Value)>) -> Result | ^^^ not found in this scope | help: consider importing one of these items | 614 | use alloc::vec::Vec; | 614 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/token_req/mod.rs:836:34 | 836 | fn to_cbor_map(&self) -> Vec<(i128, Option>)> { | ^^^ not found in this scope | help: consider importing one of these items | 614 | use alloc::vec::Vec; | 614 | use serde::__private::Vec; | error[E0412]: cannot find type `Box` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/token_req/mod.rs:836:52 | 836 | fn to_cbor_map(&self) -> Vec<(i128, Option>)> { | ^^^ not found in this scope | help: consider importing this struct | 614 | use alloc::boxed::Box; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/endpoints/token_req/mod.rs:845:35 | 845 | fn try_from_cbor_map(map: Vec<(i128, Value)>) -> Result | ^^^ not found in this scope | help: consider importing one of these items | 614 | use alloc::vec::Vec; | 614 | use serde::__private::Vec; | error[E0412]: cannot find type `String` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/error/mod.rs:72:14 | 72 | message: String, | ^^^^^^ not found in this scope | help: consider importing one of these items | 14 | use alloc::string::String; | 14 | use derive_builder::export::core::string::String; | error[E0412]: cannot find type `String` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/error/mod.rs:86:17 | 86 | T: Into, | ^^^^^^ not found in this scope | help: consider importing one of these items | 14 | use alloc::string::String; | 14 | use derive_builder::export::core::string::String; | error[E0412]: cannot find type `String` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/error/mod.rs:248:31 | 248 | existing_header_name: String, | ^^^^^^ not found in this scope | help: consider importing one of these items | 14 | use alloc::string::String; | 14 | use derive_builder::export::core::string::String; | error[E0412]: cannot find type `String` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/error/mod.rs:282:17 | 282 | S: Into, | ^^^^^^ not found in this scope | help: consider importing one of these items | 14 | use alloc::string::String; | 14 | use derive_builder::export::core::string::String; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/token/mod.rs:222:60 | 222 | fn encrypt(&mut self, plaintext: &[u8], aad: &[u8]) -> Vec; | ^^^ not found in this scope | help: consider importing one of these items | 86 | use alloc::vec::Vec; | 86 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/token/mod.rs:234:17 | 234 | ) -> Result, CoseCipherError>; | ^^^ not found in this scope | help: consider importing one of these items | 86 | use alloc::vec::Vec; | 86 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/token/mod.rs:285:56 | 285 | fn generate_signature(&mut self, target: &[u8]) -> Vec; | ^^^ not found in this scope | help: consider importing one of these items | 86 | use alloc::vec::Vec; | 86 | use serde::__private::Vec; | error[E0412]: cannot find type `Vec` in this scope --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/token/mod.rs:341:50 | 341 | fn generate_tag(&mut self, target: &[u8]) -> Vec; | ^^^ not found in this scope | help: consider importing one of these items | 86 | use alloc::vec::Vec; | 86 | use serde::__private::Vec; | error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates --> /home/janro/.cargo/registry/src/github.com-1ecc6299db9ec823/dcaf-0.3.1/src/common/scope/mod.rs:832:10 | 832 | impl From)>> for AifEncodedScope | ^ unconstrained type parameter Some errors have detailed explanations: E0207, E0412, E0433. For more information about an error, try `rustc --explain E0207`. error: could not compile `dcaf` due to 65 previous errors warning: build failed, waiting for other jobs to finish... make: *** [/home/janro/Dokumente/GitHub/RIOT/makefiles/cargo-targets.inc.mk:44: /home/janro/Dokumente/GitHub/RIOT/examples/rust-gcoap/bin/native/target/i686-unknown-linux-gnu/release/librust_gcoap.a] Fehler 101 ```
pulsastrix commented 2 years ago

Seems like most of these issues are a result of missing imports, as types like Vec or String are usually part of the std prelude, but have to be imported manually if the alloc crate is used.

PS: We should probably add tests to our CI pipeline that run with no-std to prevent these compile-time errors in the future.