no_std
This commit is contained in:
parent
c0e915f1b4
commit
00261d95c1
9 changed files with 102 additions and 96 deletions
|
|
@ -8,9 +8,9 @@ use crate::san::*;
|
|||
use crate::setup::*;
|
||||
use crate::uci::*;
|
||||
|
||||
use std::convert::Infallible;
|
||||
use std::iter::{ExactSizeIterator, FusedIterator};
|
||||
use std::ops::ControlFlow;
|
||||
use core::convert::Infallible;
|
||||
use core::iter::{ExactSizeIterator, FusedIterator};
|
||||
use core::ops::ControlFlow;
|
||||
|
||||
/// **A chess position.**
|
||||
///
|
||||
|
|
@ -462,8 +462,8 @@ impl Position {
|
|||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Position {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
|
||||
impl core::fmt::Debug for Position {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> {
|
||||
f.debug_tuple("Position")
|
||||
.field(&TextRecord(self.as_setup()))
|
||||
.finish()
|
||||
|
|
@ -629,10 +629,10 @@ impl Position {
|
|||
.chain(theirs.bishop().map(|sq| lookup::bishop(sq, blockers)))
|
||||
.chain(theirs.rook().map(|sq| lookup::rook(sq, blockers)))
|
||||
.chain(theirs.knight().map(|sq| lookup::knight(sq)))
|
||||
.chain(std::iter::once(
|
||||
.chain(core::iter::once(
|
||||
theirs.pawn().trans(!forward).trans(Direction::East),
|
||||
))
|
||||
.chain(std::iter::once(
|
||||
.chain(core::iter::once(
|
||||
theirs.pawn().trans(!forward).trans(Direction::West),
|
||||
))
|
||||
.reduce_or()
|
||||
|
|
@ -659,7 +659,7 @@ impl Position {
|
|||
.trans_unchecked(Direction::East)
|
||||
};
|
||||
if global_mask_to.contains(to) {
|
||||
moves.extend(std::iter::once(RawMove {
|
||||
moves.extend(core::iter::once(RawMove {
|
||||
kind: MoveType::CastleShort,
|
||||
from,
|
||||
to,
|
||||
|
|
@ -680,7 +680,7 @@ impl Position {
|
|||
.trans_unchecked(Direction::West)
|
||||
};
|
||||
if global_mask_to.contains(to) {
|
||||
moves.extend(std::iter::once(RawMove {
|
||||
moves.extend(core::iter::once(RawMove {
|
||||
kind: MoveType::CastleLong,
|
||||
from,
|
||||
to,
|
||||
|
|
@ -823,7 +823,7 @@ impl Position {
|
|||
& (!pinned | lookup::segment(king_square, to))
|
||||
{
|
||||
moves.en_passant_is_legal()?;
|
||||
moves.extend(std::iter::once(RawMove {
|
||||
moves.extend(core::iter::once(RawMove {
|
||||
kind: MoveType::EnPassant,
|
||||
from,
|
||||
to,
|
||||
|
|
@ -1089,7 +1089,7 @@ impl MoveGen<Infallible> for MateMoveGenImpl {
|
|||
struct MoveAndPromote<I: Iterator<Item = RawMove> + ExactSizeIterator + FusedIterator> {
|
||||
role: u8,
|
||||
inner: I,
|
||||
cur: std::mem::MaybeUninit<RawMove>,
|
||||
cur: core::mem::MaybeUninit<RawMove>,
|
||||
}
|
||||
impl<I> MoveAndPromote<I>
|
||||
where
|
||||
|
|
@ -1100,7 +1100,7 @@ where
|
|||
Self {
|
||||
role: 1,
|
||||
inner,
|
||||
cur: std::mem::MaybeUninit::uninit(),
|
||||
cur: core::mem::MaybeUninit::uninit(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue