update toolchain to nightly-2023-09-28

This commit is contained in:
Marcel Märtens 2023-09-28 16:51:32 +02:00
parent 63b001959e
commit 394c8892bb
27 changed files with 58 additions and 61 deletions

18
Cargo.lock generated
View File

@ -3250,12 +3250,6 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "libm"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
[[package]]
name = "libm"
version = "0.2.7"
@ -4005,7 +3999,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2"
dependencies = [
"autocfg",
"libm 0.2.7",
"libm",
]
[[package]]
@ -4254,13 +4248,13 @@ dependencies = [
]
[[package]]
name = "packed_simd_2"
version = "0.3.8"
name = "packed_simd"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282"
checksum = "1f9f08af0c877571712e2e3e686ad79efad9657dbf0f7c3c8ba943ff6c38932d"
dependencies = [
"cfg-if 1.0.0",
"libm 0.1.4",
"num-traits",
]
[[package]]
@ -7315,7 +7309,7 @@ dependencies = [
"num 0.4.1",
"num-traits",
"ordered-float 3.9.1",
"packed_simd_2",
"packed_simd",
"rand 0.8.5",
"rand_chacha 0.3.1",
"rayon",

View File

@ -1,6 +1,7 @@
cargo-features = ["named-profiles","profile-overrides"]
[workspace]
resolver = "2"
members = [
"common",
"common/assets",

View File

@ -517,7 +517,7 @@ impl SkillSet {
// Perform all mutation inside this branch, to avoid triggering a copy
// on write or flagged storage in cases where this matters.
let this_ = to_mut(this_);
let mut this = this_.borrow_mut();
let this = this_.borrow_mut();
// NOTE: Verified to exist previously when we accessed
// this.skill_groups (assuming a non-pathological implementation of
// ToOwned).

View File

@ -12,9 +12,9 @@
type_alias_impl_trait,
extend_one,
arbitrary_self_types,
int_roundings
int_roundings,
hash_extract_if
)]
#![feature(hash_drain_filter)]
pub use common_assets as assets;
pub use uuid;

View File

@ -1,4 +1,4 @@
#![feature(drain_filter, let_chains)]
#![feature(extract_if, let_chains)]
#![allow(clippy::option_map_unit_fn)]
mod aura;

View File

@ -61,7 +61,7 @@ impl<'a> System<'a> for Sys {
.map(|c| (
// Only take inputs and actions from the rider if the mount is not intelligent (TODO: expand the definition of 'intelligent').
if !matches!(body, Some(Body::Humanoid(_))) {
let actions = c.actions.drain_filter(|action| match action {
let actions = c.actions.extract_if(|action| match action {
ControlAction::StartInput { input: i, .. }
| ControlAction::CancelInput(i) => matches!(i, InputKind::Jump | InputKind::Fly | InputKind::Roll),
_ => false
@ -151,7 +151,7 @@ impl<'a> System<'a> for Sys {
let inputs = controllers.get_mut(entity).map(|c| {
let actions: Vec<_> = c
.actions
.drain_filter(|action| match action {
.extract_if(|action| match action {
ControlAction::StartInput { input: i, .. }
| ControlAction::CancelInput(i) => {
matches!(i, InputKind::Jump | InputKind::Fly | InputKind::Roll)

View File

@ -222,7 +222,7 @@ impl<'a> PhysicsData<'a> {
}
// Update PreviousPhysCache
for (_, vel, position, ori, mut phys_cache, collider, scale, cs) in (
for (_, vel, position, ori, phys_cache, collider, scale, cs) in (
&self.read.entities,
&self.write.velocities,
&self.write.positions,
@ -797,7 +797,7 @@ impl<'a> PhysicsData<'a> {
ori,
body,
character_state,
mut physics_state,
physics_state,
pos_vel_ori_defer,
previous_cache,
_,

View File

@ -74,7 +74,7 @@ impl<'a> System<'a> for Sys {
let mut rng = rand::thread_rng();
// Attacks
'projectile_loop: for (entity, pos, physics, vel, mut projectile) in (
'projectile_loop: for (entity, pos, physics, vel, projectile) in (
&read_data.entities,
&read_data.positions,
&read_data.physics_states,

View File

@ -1,4 +1,3 @@
#![feature(drain_filter)]
//! Network Protocol
//!
//! a I/O-Free protocol for the veloren network crate.

View File

@ -388,7 +388,8 @@ where
// try to order pending
let mut pending_violated = false;
let mut reliable = vec![];
self.pending_reliable_buffers.drain_filter(|(_, buffer)| {
self.pending_reliable_buffers.retain(|(_, buffer)| {
// try to get Sid without touching buffer
let mut testbuffer = buffer.clone();
match ITFrame::read_frame(&mut testbuffer) {
@ -398,13 +399,13 @@ where
length: _,
})) => {
reliable.push((sid, buffer.clone()));
true
false
},
Ok(Some(_)) | Err(_) => {
pending_violated = true;
true
false
},
Ok(None) => false,
Ok(None) => true,
}
});

View File

@ -1 +1 @@
nightly-2023-04-20
nightly-2023-09-28

View File

@ -3,13 +3,11 @@
#![deny(clippy::clone_on_ref_ptr)]
#![feature(
box_patterns,
drain_filter,
let_chains,
never_type,
option_zip,
unwrap_infallible
)]
#![feature(hash_drain_filter)]
pub mod automod;
mod character_creator;

View File

@ -267,8 +267,8 @@ impl CharacterUpdater {
}
pub fn process_batch_completion(&mut self, completed_batch_id: u64) {
self.pending_database_actions.drain_filter(|_, event| {
matches!(event, DatabaseAction::Submitted {
self.pending_database_actions.retain(|_, event| {
!matches!(event, DatabaseAction::Submitted {
batch_id,
} if completed_batch_id == *batch_id)
});

View File

@ -59,7 +59,7 @@ impl<'a> System<'a> for Sys {
for (pet_entity, owner_pos) in lost_pets.iter() {
let stay = agn.get(*pet_entity).and_then(|x| x.stay_pos).is_some();
if let Some(mut pet_pos) = positions.get_mut(*pet_entity) && !stay{
if let Some(pet_pos) = positions.get_mut(*pet_entity) && !stay{
// Move the pets to their owner's position
// TODO: Create a teleportation event to handle this instead of
// processing the entity position move here

View File

@ -71,7 +71,7 @@ impl<'a> System<'a> for Sys {
// 7. Determine list of regions that are in range and iterate through it
// - check if in hashset (hash calc) if not add it
let mut regions_to_remove = Vec::new();
for (mut subscription, pos, presence, client_entity, client) in (
for (subscription, pos, presence, client_entity, client) in (
&mut subscriptions,
&positions,
&presences,

View File

@ -68,7 +68,7 @@ impl<'a> System<'a> for Sys {
.as_mut()
.map(|t| *t += dt.0);
for mut floater in hp_floater_list.floaters.iter_mut() {
for floater in hp_floater_list.floaters.iter_mut() {
// Increment timer
floater.timer += dt.0;
floater.jump_timer += dt.0;

View File

@ -4,14 +4,15 @@
#![deny(clippy::clone_on_ref_ptr)]
#![feature(
array_methods,
array_zip,
drain_filter,
extract_if,
trait_alias,
option_get_or_insert_default,
map_try_insert,
slice_as_chunks,
let_chains,
generic_const_exprs
generic_const_exprs,
maybe_uninit_uninit_array,
maybe_uninit_array_assume_init
)]
#![recursion_limit = "2048"]

View File

@ -314,7 +314,7 @@ impl PlayState for MainMenuState {
password,
server_address,
} => {
let mut net_settings = &mut global_state.settings.networking;
let net_settings = &mut global_state.settings.networking;
let use_quic = net_settings.use_quic;
net_settings.username = username.clone();
net_settings.default_server = server_address.clone();

View File

@ -39,7 +39,7 @@ impl Add<Vertex> for Vertex {
fn add(self, other: Self) -> Self::Output {
Self {
pos: self.pos.zip(other.pos).map(|(a, b)| a + b),
pos: [self.pos[0] + other.pos[0], self.pos[1] + other.pos[1], self.pos[2] + other.pos[2]],
}
}
}

View File

@ -22,6 +22,11 @@ pub struct Locals {
pub postprocess_bind: postprocess::BindGroup,
}
fn arr_zip_map<const N: usize, A, B, C>(a: [A; N], b: [B; N], f: impl Fn(A, B) -> C) -> [C; N] {
let mut b = b.into_iter();
a.map(|a| f(a, b.next().unwrap()))
}
impl Locals {
pub(super) fn new(
device: &wgpu::Device,
@ -58,10 +63,9 @@ impl Locals {
);
let bloom_binds = bloom.map(|bloom| {
bloom
.src_views
.zip(bloom.locals) // zip arrays
.map(|(view, locals)| layouts.bloom.bind(device, view, sampler, locals))
arr_zip_map(bloom.src_views, bloom.locals, |view, locals| {
layouts.bloom.bind(device, view, sampler, locals)
})
});
Self {
@ -107,10 +111,9 @@ impl Locals {
&self.postprocess,
);
self.bloom_binds = bloom.map(|bloom| {
bloom
.src_views
.zip(bloom.locals) // zip arrays
.map(|(view, locals)| layouts.bloom.bind(device, view, sampler, locals))
arr_zip_map(bloom.src_views, bloom.locals, |view, locals| {
layouts.bloom.bind(device, view, sampler, locals)
})
});
}
}

View File

@ -648,7 +648,7 @@ impl FigureMgr {
}
let dt = ecs.fetch::<DeltaTime>().0;
let updater = ecs.read_resource::<LazyUpdate>();
for (entity, light_emitter_opt, interpolated, pos, body, mut light_anim) in (
for (entity, light_emitter_opt, interpolated, pos, body, light_anim) in (
&ecs.entities(),
ecs.read_storage::<LightEmitter>().maybe(),
ecs.read_storage::<Interpolated>().maybe(),

View File

@ -250,7 +250,7 @@ pub fn clip_object_by_plane<T: Float + MulAdd<T, T, Output = T> + core::fmt::Deb
tolerance: T,
) {
let mut intersection_points = Vec::new();
polys.drain_filter(|points| {
polys.retain_mut(|points| {
let len = intersection_points.len();
let outside_first = clip_points_by_plane(points, plane, &mut intersection_points);
// Only remember intersections that are not coplanar with this side; i.e. those
@ -273,7 +273,7 @@ pub fn clip_object_by_plane<T: Float + MulAdd<T, T, Output = T> + core::fmt::Deb
intersection_points.swap(len, len + 1);
}
// Remove polygon if it was clipped away
points.is_empty()
!points.is_empty()
});
// Add a polygon of all intersection points with the plane to close out the
// object.

View File

@ -763,9 +763,9 @@ impl Scene {
renderer.update_consts(&mut self.data.lights, lights);
// Update event lights
self.event_lights.drain_filter(|el| {
self.event_lights.retain_mut(|el| {
el.timeout -= dt;
el.timeout <= 0.0
el.timeout > 0.0
});
// Update shadow constants

View File

@ -216,7 +216,7 @@ settings_change_from!(Accessibility);
impl SettingsChange {
pub fn process(self, global_state: &mut GlobalState, session_state: &mut SessionState) {
let mut settings = &mut global_state.settings;
let settings = &mut global_state.settings;
match self {
SettingsChange::Audio(audio_change) => {
@ -366,7 +366,7 @@ impl SettingsChange {
},
SettingsChange::Gamepad(gamepad_change) => match gamepad_change {},
SettingsChange::Gameplay(gameplay_change) => {
let mut window = &mut global_state.window;
let window = &mut global_state.window;
match gameplay_change {
Gameplay::AdjustMousePan(sensitivity) => {
window.pan_sensitivity = sensitivity;

View File

@ -34,7 +34,7 @@ tracing = { workspace = true }
rand = { workspace = true }
rand_chacha = { workspace = true }
arr_macro = "0.2.1"
packed_simd = { package = "packed_simd_2", version = "0.3.8", optional = true }
packed_simd = { version = "0.3.9", optional = true }
rayon = { workspace = true }
serde = { workspace = true }
ron = { workspace = true }

View File

@ -741,7 +741,7 @@ impl Civs {
1 << ((to_next_idx as u8 + 4) % 8);
}
for loc in path.iter() {
let mut chunk = ctx.sim.get_mut(loc.0).unwrap();
let chunk = ctx.sim.get_mut(loc.0).unwrap();
let depth = loc.1 * 250.0 - 20.0;
chunk.cave.1.alt =
chunk.alt - depth + ctx.rng.gen_range(-4.0..4.0) * (depth > 10.0) as i32 as f32;
@ -1408,7 +1408,7 @@ impl Civs {
(1 << (to_prev_idx as u8)) | (1 << (to_next_idx as u8));
*/
if randomize_offset {
let mut chunk = ctx.sim.get_mut(locs[1]).unwrap();
let chunk = ctx.sim.get_mut(locs[1]).unwrap();
chunk.path.0.offset =
Vec2::new(ctx.rng.gen_range(-16..17), ctx.rng.gen_range(-16..17));
}

View File

@ -322,7 +322,7 @@ pub fn get_rivers<F: fmt::Debug + Float + Into<f64>, G: Float + Into<f64>>(
let pass_idx = (-indirection_idx) as usize;
// NOTE: Must exist since this lake had a downhill in the first place.
let neighbor_pass_idx = downhill[pass_idx] as usize/*downhill_idx*/;
let mut lake_neighbor_pass = &mut rivers[neighbor_pass_idx];
let lake_neighbor_pass = &mut rivers[neighbor_pass_idx];
// We definitely shouldn't have encountered this yet!
debug_assert!(lake_neighbor_pass.velocity == Vec3::zero());
// TODO: Rethink making the lake neighbor pass always a river or lake, no matter
@ -388,7 +388,7 @@ pub fn get_rivers<F: fmt::Debug + Float + Into<f64>, G: Float + Into<f64>>(
river_spline_derivative,
)
};
let mut lake = &mut rivers[chunk_idx];
let lake = &mut rivers[chunk_idx];
lake.spline_derivative = river_spline_derivative;
lake.river_kind = Some(RiverKind::Lake {
neighbor_pass_pos: neighbor_pass_pos
@ -495,7 +495,7 @@ pub fn get_rivers<F: fmt::Debug + Float + Into<f64>, G: Float + Into<f64>>(
// CONFIG.river_min_height.
let river = &rivers[chunk_idx];
let is_river = river.is_river() || width >= 0.5 && height >= CONFIG.river_min_height as f64;
let mut downhill_river = &mut rivers[downhill_idx];
let downhill_river = &mut rivers[downhill_idx];
if is_river {
// Provisionally make the downhill chunk a river as well.
@ -532,7 +532,7 @@ pub fn get_rivers<F: fmt::Debug + Float + Into<f64>, G: Float + Into<f64>>(
velocity.normalize();
velocity *= velocity_magnitude;
let mut river = &mut rivers[chunk_idx];
let river = &mut rivers[chunk_idx];
// NOTE: Not trying to do this more cleverly because we want to keep the river's
// neighbors. TODO: Actually put something in the neighbors.
river.velocity = velocity.map(|e| e as f32);