From a7d1d02be022b6dd1e5170780b509057f150ca9d Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 3 Feb 2021 05:25:25 +0100 Subject: [PATCH] Remove use of feature(const_in_array_repeat_expressions) --- embassy-net/src/lib.rs | 1 - embassy-net/src/stack.rs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/embassy-net/src/lib.rs b/embassy-net/src/lib.rs index a2a320adf..fe1d529d8 100644 --- a/embassy-net/src/lib.rs +++ b/embassy-net/src/lib.rs @@ -1,6 +1,5 @@ #![cfg_attr(not(feature = "std"), no_std)] #![feature(const_fn)] -#![feature(const_in_array_repeat_expressions)] #![feature(const_generics)] #![feature(const_evaluatable_checked)] #![allow(incomplete_features)] diff --git a/embassy-net/src/stack.rs b/embassy-net/src/stack.rs index c353f1bb1..d1dcb3bc9 100644 --- a/embassy-net/src/stack.rs +++ b/embassy-net/src/stack.rs @@ -146,10 +146,11 @@ impl Stack { /// Initialize embassy_net. /// This function must be called from thread mode. pub fn init(device: &'static mut dyn Device, configurator: &'static mut dyn Configurator) { + const NONE_SOCKET: Option> = None; let res = STACK_RESOURCES.put(StackResources { addresses: [IpCidr::new(Ipv4Address::UNSPECIFIED.into(), 32)], neighbor_cache: [None; NEIGHBOR_CACHE_LEN], - sockets: [None; SOCKETS_LEN], + sockets: [NONE_SOCKET; SOCKETS_LEN], routes: [None; 1], });