Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Use Spans to report better error locations #612

Closed
wants to merge 9 commits into from
Closed

Use Spans to report better error locations #612

wants to merge 9 commits into from

Conversation

Kijewski
Copy link
Member

This PR might look huge and incomprehensible, but it actually shouldn't be too difficult to read. I hope.

Currently if the parsing fails, an error in #[derive(Template)] is reported, even though the library knows a more narrow location, e.g. at least that the error is actually in #[template(…)], or in the path = "…" argument if the file is absent.

This PR is also done in anticipation of rust-lang/rfcs#3200, which might make it possible to report an error location in the actual template file; and #600, which adds multiple files as possible template file source of an error.

@Kijewski Kijewski closed this Jul 20, 2022
@Kijewski Kijewski deleted the pr-compile-errors-with-spans branch July 20, 2022 13:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants