Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RA reports missing trait item implementation for associated constant with default value: possibly a regression. #15909

Closed
nerditation opened this issue Nov 16, 2023 · 2 comments · Fixed by #15911
Assignees
Labels
C-bug Category: bug

Comments

@nerditation
Copy link

nerditation commented Nov 16, 2023

description

a trait has an associated constant with a default value, when a type implements the trait and omit the associated constant, RA will show error message:

"not all trait item implemented, missing: const XXXX"

while the same code compiles without any problem.

I can't remember exactly, but I think this error starts to show up from yesterday; in previous versions, no error is shown for the exact same code base.

minimal reproducible code:

trait Marker {
	const FLAG: bool = false;
}
struct Foo;
impl Marker for Foo {}  // <--- error message shows up here

screenshot

image

rust-analyzer version:

using vscode extension preview channel,

  • rust-analyzer 0.4.1735-standalone (58de0b1 2023-11-15)
  • Extension version: 0.4.1735
INFO [11/16/2023, 10:29:17 AM]: Starting language client
INFO [11/16/2023, 10:29:17 AM]: Using server binary at d:\Applications\scoop\apps\vscode\1.83.1\data\extensions\rust-lang.rust-analyzer-0.4.1735-win32-x64\server\rust-analyzer.exe
INFO [11/16/2023, 10:29:17 AM]: d:\Applications\scoop\apps\vscode\1.83.1\data\extensions\rust-lang.rust-analyzer-0.4.1735-win32-x64\server\rust-analyzer.exe --version: {
  status: 0,
  signal: null,
  output: [
    null,
    'rust-analyzer 0.4.1735-standalone (58de0b130 2023-11-15)\n',
    ''
  ],
  pid: 17980,
  stdout: 'rust-analyzer 0.4.1735-standalone (58de0b130 2023-11-15)\n',
  stderr: ''
}

rustc version:

rustc 1.76.0-nightly (dd430bc8c 2023-11-14)

relevant settings:

nothing special, just normal installation via rustup and vscode

@nerditation nerditation added the C-bug Category: bug label Nov 16, 2023
@Young-Flash
Copy link
Member

seems it is introduced in #15895, I'll take a look

@Young-Flash
Copy link
Member

Young-Flash commented Nov 16, 2023

got the problem, will make a patched PR soon

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
2 participants