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

Enabling Proc Attr Macros result in error called 'Option::unwrap()' on a 'None' value #10710

Closed
BlackDex opened this issue Nov 6, 2021 · 4 comments

Comments

@BlackDex
Copy link

BlackDex commented Nov 6, 2021

While coding on the Vaultwarden project and having Proc Attr Macros enabled i receive several errors. I receive these errors using a current open PR Macro recursion decrease and other optimizations, else i would receive a macro recursion error.

Is there something i can change or do, or can i provide some more information to help and solve this :).

[{
	"resource": "/vaultwarden/src/api/admin.rs",
	"owner": "rustc",
	"code": {
		"value": "macro-error",
		"target": {
			"$mid": 1,
			"external": "https://rust-analyzer.github.io/manual.html#macro-error",
			"path": "/manual.html",
			"scheme": "https",
			"authority": "rust-analyzer.github.io",
			"fragment": "macro-error"
		}
	},
	"severity": 8,
	"message": "not implemented",
	"source": "rust-analyzer",
	"startLineNumber": 72,
	"startColumn": 1,
	"endLineNumber": 75,
	"endColumn": 2
}]
[{
	"resource": "/vaultwarden/src/api/admin.rs",
	"owner": "rustc",
	"code": {
		"value": "macro-error",
		"target": {
			"$mid": 1,
			"external": "https://rust-analyzer.github.io/manual.html#macro-error",
			"path": "/manual.html",
			"scheme": "https",
			"authority": "rust-analyzer.github.io",
			"fragment": "macro-error"
		}
	},
	"severity": 8,
	"message": "called `Option::unwrap()` on a `None` value",
	"source": "rust-analyzer",
	"startLineNumber": 139,
	"startColumn": 1,
	"endLineNumber": 153,
	"endColumn": 2
}]
@Veykril
Copy link
Member

Veykril commented Nov 6, 2021

What is your current rustc version you are running? Might be that you have a recent nightly that changed the proc-macro abi again

@BlackDex
Copy link
Author

BlackDex commented Nov 6, 2021

I was using 2021-10-14, and i updated yesterday to the latest available. Both had the same message.

@lnicola
Copy link
Member

lnicola commented Nov 7, 2021

This crashes because we don't implement Span::source_file. As noted in #10378, this is unstable, but it doesn't help when using rocket.

I was surprised about this because rocket 0.5 is supposed to build on stable -- and it does --, but valutwarden is on a revision from July 2020.

@BlackDex
Copy link
Author

BlackDex commented Nov 8, 2021

Ok, we have created a new branch now which is using the 0.5rc version that indeed seems to solve it when using stable.
Though i now have a regression i think with some other stuff, i will need to create a new ticket for that.

Thanks for 'pushing' us to go and update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants