Skip to content

Regression in rgb with as_mut_slice #152961

@JonathanBrouwer

Description

@JonathanBrouwer

Code

Cargo.toml

[package]
name = "rust-test"
version = "0.1.0"
edition = "2024"

[dependencies]
resvg = "=0.34.1"

main.rs

extern crate resvg;
fn main() { }

I'll try to make a smaller reproducer

Regression

This compiles on nightly 2026-02-21, but fails on nightly 2026-02-22.

error[E0308]: mismatched types
  --> /home/jonathan/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/resvg-0.34.1/src/filter/iir_blur.rs:63:22
   |
63 |     gaussian_channel(data, &d, 0, buf);
   |     ---------------- ^^^^ expected `&mut [u8]`, found `&mut [RGBA<u8>]`
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected mutable reference `&mut [u8]`
              found mutable reference `&mut [rgb::RGBA<u8>]`
note: function defined here
  --> /home/jonathan/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/resvg-0.34.1/src/filter/iir_blur.rs:69:4
   |
69 | fn gaussian_channel(data: &mut [u8], d: &BlurData, channel: usize, buf: &mut Vec<f64>) {
   |    ^^^^^^^^^^^^^^^^ ---------------

Cause

Found because rust-timer failed in #152934, so this has serious impact.
Locally bisected to PR #151603

CC @jhpratt @GrigorenkoPV

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.P-criticalCritical priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions