Remove explicit std::marker from Sized bound
Sized is always part of the prelude, and binding on std causes compilation issues for no-std crates.
This commit is contained in:
parent
41d9f293d4
commit
d7d49285d8
|
@ -166,7 +166,7 @@ impl Shr<u32> for Fr {
|
|||
}
|
||||
|
||||
impl Field for Fr {
|
||||
fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self {
|
||||
fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self {
|
||||
Fr(Wrapping(rng.next_u32()) % MODULUS_R)
|
||||
}
|
||||
|
||||
|
@ -358,7 +358,7 @@ impl CurveProjective for Fr {
|
|||
type Scalar = Fr;
|
||||
type Engine = DummyEngine;
|
||||
|
||||
fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self {
|
||||
fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self {
|
||||
<Fr as Field>::random(rng)
|
||||
}
|
||||
|
||||
|
|
|
@ -1188,7 +1188,7 @@ fn prime_field_impl(
|
|||
|
||||
impl ::ff::Field for #name {
|
||||
/// Computes a uniformly random element using rejection sampling.
|
||||
fn random<R: ::rand_core::RngCore + ?std::marker::Sized>(rng: &mut R) -> Self {
|
||||
fn random<R: ::rand_core::RngCore + ?Sized>(rng: &mut R) -> Self {
|
||||
loop {
|
||||
let mut tmp = {
|
||||
let mut repr = [0u64; #limbs];
|
||||
|
|
|
@ -50,7 +50,7 @@ pub trait Field:
|
|||
+ for<'a> SubAssign<&'a Self>
|
||||
{
|
||||
/// Returns an element chosen uniformly at random using a user-provided RNG.
|
||||
fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self;
|
||||
fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self;
|
||||
|
||||
/// Returns the zero element of the field, the additive identity.
|
||||
fn zero() -> Self;
|
||||
|
|
|
@ -52,7 +52,7 @@ pub trait CurveProjective:
|
|||
type Affine: CurveAffine<Projective = Self, Scalar = Self::Scalar>;
|
||||
|
||||
/// Returns an element chosen uniformly at random using a user-provided RNG.
|
||||
fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self;
|
||||
fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self;
|
||||
|
||||
/// Returns the additive identity.
|
||||
fn zero() -> Self;
|
||||
|
|
|
@ -515,7 +515,7 @@ macro_rules! curve_impl {
|
|||
type Base = $basefield;
|
||||
type Affine = $affine;
|
||||
|
||||
fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self {
|
||||
fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self {
|
||||
loop {
|
||||
let x = $basefield::random(rng);
|
||||
let greatest = rng.next_u32() % 2 != 0;
|
||||
|
|
|
@ -177,7 +177,7 @@ impl MulAssign for Fq12 {
|
|||
}
|
||||
|
||||
impl Field for Fq12 {
|
||||
fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self {
|
||||
fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self {
|
||||
Fq12 {
|
||||
c0: Fq6::random(rng),
|
||||
c1: Fq6::random(rng),
|
||||
|
|
|
@ -185,7 +185,7 @@ impl MulAssign for Fq2 {
|
|||
}
|
||||
|
||||
impl Field for Fq2 {
|
||||
fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self {
|
||||
fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self {
|
||||
Fq2 {
|
||||
c0: Fq::random(rng),
|
||||
c1: Fq::random(rng),
|
||||
|
|
|
@ -278,7 +278,7 @@ impl MulAssign for Fq6 {
|
|||
}
|
||||
|
||||
impl Field for Fq6 {
|
||||
fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self {
|
||||
fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self {
|
||||
Fq6 {
|
||||
c0: Fq2::random(rng),
|
||||
c1: Fq2::random(rng),
|
||||
|
|
|
@ -362,7 +362,7 @@ impl PrimeField for Fs {
|
|||
}
|
||||
|
||||
impl Field for Fs {
|
||||
fn random<R: RngCore + ?std::marker::Sized>(rng: &mut R) -> Self {
|
||||
fn random<R: RngCore + ?Sized>(rng: &mut R) -> Self {
|
||||
loop {
|
||||
let mut tmp = {
|
||||
let mut repr = [0u64; 4];
|
||||
|
|
Loading…
Reference in New Issue