Skip to content

#6615 - Added a better error message for --ls #11544

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
wants to merge 1 commit into from
Closed

#6615 - Added a better error message for --ls #11544

wants to merge 1 commit into from

Conversation

robertg
Copy link

@robertg robertg commented Jan 14, 2014

My first pull request, made the error message better to close #6615.

@alexcrichton
Copy link
Member

Thanks for the contribution!

Looking at get_metadata_section, it looks like reading metadata could fail for multiple reasons (not just a missing file). I think a better fix might be returning Result<MetadataBlob, &'static str> and then in each error case you can describe what the error is.

For example the first one (where mb as int == 0) would be "file not found" and the second one would be "file not an object file" or something like that.

@robertg
Copy link
Author

robertg commented Jan 14, 2014

Alright I will get on it, and update my pull request.

@brson
Copy link
Contributor

brson commented Jan 15, 2014

Thanks, @rgawdzik!

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to reopen with a rebase! I'd love to get this fixed...

@robertg
Copy link
Author

robertg commented Jan 28, 2014

Yeah really busy, sorry. Will find time later.

bors added a commit that referenced this pull request Mar 9, 2014
Refactored get_metadata_section to return a Result<MetadataBlob,~str> instead of a Option<MetadataBlob>. This provides more clarity to the user through the debug output when using --ls.

This is kind of a continuation of my original closed pull request 2 months ago (#11544), but I think the time-span constitutes a new pull request.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 25, 2023
Remove most usage of `hir_ty_to_ty`

Removes the usages where there's a suitable query or the type was already available elsewhere. The remaining cases would all require more involved changes

changelog: none

r? `@Jarcho`
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

Successfully merging this pull request may close these issues.

rustc --ls gives 'could not find metadata' error for missing file
3 participants