this error appeared. doing a lot of rust. a lot such error message
Issue
The LLM did not conform to the edit format.
https://aider.chat/docs/troubleshooting/edit-errors.html
# 1 SEARCH/REPLACE block failed to match!
## SearchReplaceNoExactMatch: This SEARCH block failed to exactly match lines in src/cache.rs
<<<<<<< SEARCH
struct Shards {
len: u32,
arr_offset: u64,
}
impl Shards {
fn init(&mut self, all: &mut Allocator, shard_len: u32, max_len: u64) -> io::Result<()> {
=======
pub struct Shards {
len: u32,
arr_offset: u64,
}
impl Shards {
pub fn init(&mut self, all: &mut Allocator, shard_len: u32, max_len: u64) -> io::Result<()> {
>>>>>>> REPLACE
Did you mean to match some of these actual lines from src/cache.rs?
fn shard(&self, hash: u64) -> *mut Shard {
let index = hash % self.shards.len() as u64;
self.shards.shard(&self.allocator.lock().unwrap(), index as usize)
}
}
pub struct Shards { len: u32, arr_offset: u64, }
impl Shards { pub fn init(&mut self, all: &mut Allocator, shard_len: u32, max_len: u64) -> io::Result<()> { let size = shard_len as u64 * std::mem::size_of::<Shard>() as u64; let (_, offset) = all.alloc(size)?; self.arr_offset = offset; let pre_max_len = (max_len as f64 / shard_len as f64).ceil() as u64;
Are you sure you need this SEARCH/REPLACE block?
The REPLACE lines are already in src/cache.rs!
The SEARCH section must exactly match an existing block of lines including all white space, comments, indentation, docstrings, etc
Version and model info
latest aider + claude sonnet 3.5 api
Thanks for trying aider and filing this issue. This doc may be helpful:
https://aider.chat/docs/troubleshooting/edit-errors.html
I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.
having same issue The SEARCH section must exactly match an existing block of lines including all white space, comments, indentation, docstrings, etc please help me solve this