]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/borrowck/issue-83309-ice-immut-in-for-loop.rs
1 // rust-lang/rust#83309: The compiler tries to suggest potential
2 // methods that return `&mut` items. However, when it doesn't
3 // find such methods, it still tries to add suggestions
4 // which then fails an assertion later because there was
5 // no suggestions to make.
9 for v
in Query
.iter_mut() {
10 //~^ NOTE this iterator yields `&` references
12 //~^ ERROR cannot assign to `*v`, which is behind a `&` reference
13 //~| NOTE `v` is a `&` reference, so the data it refers to cannot be written
18 pub struct QueryIter
<'a
>(&'a
i32);
21 pub fn iter_mut
<'a
>(&'a
mut self) -> QueryIter
<'a
> {
26 impl<'a
> Iterator
for QueryIter
<'a
> {
29 fn next(&mut self) -> Option
<Self::Item
> {