Skip to content

diesel tables have unresolved methods #14259

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

Closed
Veykril opened this issue Mar 6, 2023 · 16 comments
Closed

diesel tables have unresolved methods #14259

Veykril opened this issue Mar 6, 2023 · 16 comments
Labels
A-proc-macro proc macro A-ty type system / type inference / traits / method resolution C-bug Category: bug

Comments

@Veykril
Copy link
Member

Veykril commented Mar 6, 2023

          Hi! Just updated to the latest version of rust-analyzer and now all my diesel models are red

image

Originally posted by @lenstr in #14243 (comment)

@Veykril Veykril added C-bug Category: bug A-proc-macro proc macro labels Mar 6, 2023
@Elrendio
Copy link

Elrendio commented Mar 6, 2023

Hi!

I'm also impacted by a similar bug. All diesel table usage is broken, currently I see the error:

no method `inner_join` on type `<table as FindDsl<OrderLineId>>::Output`

Thanks 🙏

@Veykril
Copy link
Member Author

Veykril commented Mar 6, 2023

You can put unresolved-method in the rust-analyzer.diagnostics.disabled setting to silence the warning

@Elrendio
Copy link

Elrendio commented Mar 6, 2023

You can put unresolved-method in the rust-analyzer.diagnostics.disabled setting to silence the warning

Thanks for the temporary fix, do you know if rust-analyzer plans to provide a long term fix any time soon? Can we provide some help?

@krypt0nn
Copy link

krypt0nn commented Mar 6, 2023

Same issue happens for Relm4 library, and in addition to unresolved-method also requires unresolved-field. I think it can be related to this view! macro

image

@Veykril Veykril added the A-ty type system / type inference / traits / method resolution label Mar 6, 2023
@edwardlee4948
Copy link

edwardlee4948 commented Mar 6, 2023

You can put unresolved-method in the rust-analyzer.diagnostics.disabled setting to silence the warning

I understand that it may come across as demanding, but if it's okay with you, I would prefer to use this as the default. I just want to avoid any unexpected redlines.

@flodiebold
Copy link
Member

@Veykril maybe we should make these diagnostics experimental for now?

@Veykril
Copy link
Member Author

Veykril commented Mar 6, 2023

Judging from the feedback I think it would be better to do so yes, I didn't expect them to trigger incorrectly that often (and they don't trigger on r-a itself at all, feels like rust-analyzer is a bad testing bed for itself ...)

@Ten0
Copy link

Ten0 commented Mar 7, 2023

I understand that it may come across as demanding, but if it's okay with you, I would prefer to use this as the default.

That does not seem very reasonable (#6975) until all methods are properly resolved. (#9881 and possibly this with diesel if it's not the same issue? It seems that rust-lang/chalk#780 may fix this)

What are the upsides?

If the purpose is to get quicker feedback on a typo than rustc would give, personally I've been using:

	"editor.semanticTokenColorCustomizations": {
		"[Default Dark+]": {
			"enabled": true,
			"rules": {
				"unresolvedReference": {
					"foreground": "#fd5c5c"
				},

for more than a year, and that worked well for me. It's less intrusive but may help out as you're typing, and also highlights places where resolution doesn't work properly and a type annotation may help.

they don't trigger on r-a itself at all, feels like rust-analyzer is a bad testing bed for itself

Failure to resolve seems to largely happen when dealing with complex trait systems. I'm guessing Diesel would be a great testing bed for the general topic of #6975

@lukesneeringer
Copy link

I'm impacted by this too (I expect every Diesel user is), and I'm having trouble understanding the fix. Obviously I want rust-analyzer to tell me if there's an actual unresolved method; it just seems like it's a false positive here.

If I disable the warning, am I going to lose important feedback elsewhere?

@lnicola
Copy link
Member

lnicola commented Mar 9, 2023

The warning did not exist until the last release. You will still get compiler errors when you save a file, assuming you didn't disable that.

@defiled
Copy link

defiled commented Mar 10, 2023

You can use an earlier version of Rust Analyzer (v0.4.1405) as a temporary fix.

@lnicola
Copy link
Member

lnicola commented Mar 10, 2023

@defiled the 0.4 versions are nightlies, 0.3s are releases. You can run a nightly, but beware of #14305.

@lukesneeringer
Copy link

Okay great, thank you!

@matty-r
Copy link

matty-r commented Mar 11, 2023

I switched my rust-analyzer version to v0.4.1432 and this seems to have resolved it for me.

@Veykril
Copy link
Member Author

Veykril commented Mar 28, 2023

This is fixed on diesel master, the cause was the diesel proc-macro using 2015 edition name resolution rules which r-a just not supports atm.

@Veykril Veykril closed this as completed Mar 28, 2023
@Ten0
Copy link

Ten0 commented Mar 28, 2023

On the latest diesel master I still have quite a lot of type inference failing:
diesel-rs/diesel#3564 (comment)

image

I suspect #9881 may be the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-proc-macro proc macro A-ty type system / type inference / traits / method resolution C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

10 participants