Stream: t-compiler/wg-rls-2.0

Topic: How to report this bug?


Aleš Katona (Jul 19 2020 at 23:58, on Zulip):

I have a rust-analyzer bug in my project where a position() method on a type is wrongly interpreted as belonging to Iterator causing RA to show a "expected 1 argument" error. The code is perfectly fine and compiles ok.

The method actually belongs to one of my types and has no arguments. RA seems to not be able to figure out the type due to how Legion returns values from their ::query() call.

I'm unable to create a simple example at least on short notice because I'd have to get the whole legion setup going first (world etc.).

NOTE: this seems a regression I had this code in place for some time and it only started to show as error in RA in the last stable release.

Laurențiu Nicola (Jul 20 2020 at 06:07, on Zulip):

The error is new (the diagnostic didn't exist until recently), but it stems from resolving position to the wrong method. Your issue is probably similar to https://github.com/rust-analyzer/rust-analyzer/issues/5441.

Laurențiu Nicola (Jul 20 2020 at 06:57, on Zulip):

Ah, I didn't notice the use.

Aleš Katona (Jul 20 2020 at 15:27, on Zulip):

Laurențiu Nicola said:

Ah, I didn't notice the use.

I still have this issue without the use in a function in my larger code where I do not explicitly do .deref() but the code looks like:

            if let Some((mut pos, mut dim, sub_sel)) = query.iter(world).next() {
                  let edit_box = sub_sel.initial_pos.area(state.cursor);
                  *pos = *edit_box.position();
            }

Where "edit_box" is a &Bounds which has the position() method. I'll see if I can reproduce more directly in a standalone exmple.

Aleš Katona (Jul 20 2020 at 15:43, on Zulip):

Laurențiu Nicola said:

The error is new (the diagnostic didn't exist until recently), but it stems from resolving position to the wrong method. Your issue is probably similar to https://github.com/rust-analyzer/rust-analyzer/issues/5441.

Reported here without the local use https://github.com/rust-analyzer/rust-analyzer/issues/5455

Last update: Sep 27 2020 at 14:15UTC