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

Rustdoc --test and error messages #16303

Closed
steveklabnik opened this issue Aug 6, 2014 · 2 comments
Closed

Rustdoc --test and error messages #16303

steveklabnik opened this issue Aug 6, 2014 · 2 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@steveklabnik
Copy link
Member

Often, when explaining something, I want to show some code that errors, and then show the error. Because it errors, I have to mark it ignore. It'd be nice if Rustdoc could understand that something is supposed to error, and then make sure the error message matches the one displayed.

@sfackler
Copy link
Member

sfackler commented Aug 6, 2014

cc #12335

@alexcrichton
Copy link
Member

I'm gonna close as a dupe of #12335 as the decision of that issue will decide if it's possible to test error messages from the compiler in general.

bors added a commit to rust-lang-ci/rust that referenced this issue Feb 25, 2024
…=Veykril

feat: add non-exhaustive-let diagnostic

I want this to have a quickfix to add an else branch but I couldn't figure out how to do that, so here's the diagnostic on its own. It pretends a `let` is a match with one arm, and asks the match checking whether that match would be exhaustive.

Previously the pattern was checked based on its own type, but that was causing a panic in `match_check` (while processing e.g. `crates/hir/src/lib.rs`) so I changed it to use the initialiser's type instead, to align with the checking of actual match expressions. I think the panic can still happen, but I hear that `match_check` is going to be updated to a new version from rustc, so I'm posting this now in the hopes that the panic will magically go away when that happens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants