Expand docs for fs::metadata and fs::symlink_metadata - #159804
Merged
rust-bors[bot] merged 1 commit intoJul 27, 2026
Conversation
Several changes: ## Link `symlink_metadata` from `metadata` Someone reading `metadata` likely wants easy/quick access to `symlink_metadata` as well. Since this explicitly documents that it does follow symlinks, it made sense to leave a note stating how to perform the same action without that behavior. ## Add symbolic link note to errors It's intuitive that you cannot return the `Metadata` of a resolved file if the file could not be resolved. But it's not always obvious. Since we're stating "the path does not exist" (also an obvious case). It will help to have this gentle reminder. ## Explicit behavior of directories and files in `symlink_metadata` Reading the documentation, it was unclear whether `symlink_metadata` would also work on files and directories. I guessed it would, but it's nice to call it out. The wording also gave me an opportunity to cross-link to `metadata` so someone can easily jump back and forth between them.
schneems
force-pushed
the
schneems/symlink_metadata_docs
branch
from
July 24, 2026 03:08
b613739 to
bb3fba0
Compare
schneems
marked this pull request as ready for review
July 24, 2026 03:09
Collaborator
|
r? @aapoalas rustbot has assigned @aapoalas. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
|
@bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jul 27, 2026
…_docs, r=joshtriplett Expand docs for fs::metadata and fs::symlink_metadata Several changes: ## Link `symlink_metadata` from `metadata` Someone reading `metadata` likely wants easy/quick access to `symlink_metadata` as well. Since this explicitly documents that it does follow symlinks, it made sense to leave a note stating how to perform the same action without that behavior. ## Add symbolic link note to errors It's intuitive that you cannot return the `Metadata` of a resolved file if the file could not be resolved. But it's not always obvious. Since we're stating "the path does not exist" (also an obvious case). It will help to have this gentle reminder. ## Explicit behavior of directories and files in `symlink_metadata` Reading the documentation, it was unclear whether `symlink_metadata` would also work on files and directories. I guessed it would, but it's nice to call it out. The wording also gave me an opportunity to cross-link to `metadata` so someone can easily jump back and forth between them.
This was referenced Jul 27, 2026
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 27, 2026
…uwer Rollup of 14 pull requests Successful merges: - #158417 (Avoid ICE when cfg_eval recovers no item from derive input) - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`) - #159554 (feat: Update method signature of int_from_ascii) - #159637 (Some place analysis tweaks) - #159649 (Normalize region obligations before regionck) - #159961 (sanitize_standard_fds: Miri supports poll now) - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs) - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static) - #159804 (Expand docs for fs::metadata and fs::symlink_metadata) - #159821 (Update expect message using the recommended style in binary_heap module) - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver) - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`) - #159991 (std: make send_process_group_signal unsupported on VxWorks) - #159996 (Detect when a macro without exclamation mark uses square brackets)
rust-timer
added a commit
that referenced
this pull request
Jul 27, 2026
Rollup merge of #159804 - schneems:schneems/symlink_metadata_docs, r=joshtriplett Expand docs for fs::metadata and fs::symlink_metadata Several changes: ## Link `symlink_metadata` from `metadata` Someone reading `metadata` likely wants easy/quick access to `symlink_metadata` as well. Since this explicitly documents that it does follow symlinks, it made sense to leave a note stating how to perform the same action without that behavior. ## Add symbolic link note to errors It's intuitive that you cannot return the `Metadata` of a resolved file if the file could not be resolved. But it's not always obvious. Since we're stating "the path does not exist" (also an obvious case). It will help to have this gentle reminder. ## Explicit behavior of directories and files in `symlink_metadata` Reading the documentation, it was unclear whether `symlink_metadata` would also work on files and directories. I guessed it would, but it's nice to call it out. The wording also gave me an opportunity to cross-link to `metadata` so someone can easily jump back and forth between them.
Contributor
Author
|
Thank you! |
pull Bot
pushed a commit
to xtqqczze/rust-lang-miri
that referenced
this pull request
Jul 28, 2026
…uwer Rollup of 14 pull requests Successful merges: - rust-lang/rust#158417 (Avoid ICE when cfg_eval recovers no item from derive input) - rust-lang/rust#159085 (Fix decoding attributes of `SyntheticCoroutineBody`) - rust-lang/rust#159554 (feat: Update method signature of int_from_ascii) - rust-lang/rust#159637 (Some place analysis tweaks) - rust-lang/rust#159649 (Normalize region obligations before regionck) - rust-lang/rust#159961 (sanitize_standard_fds: Miri supports poll now) - rust-lang/rust#159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs) - rust-lang/rust#159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static) - rust-lang/rust#159804 (Expand docs for fs::metadata and fs::symlink_metadata) - rust-lang/rust#159821 (Update expect message using the recommended style in binary_heap module) - rust-lang/rust#159840 (Fix opaque type ICE in late lints under the next-generation trait solver) - rust-lang/rust#159956 (Fix observable intermediate state in `thread::add_spawn_hook`) - rust-lang/rust#159991 (std: make send_process_group_signal unsupported on VxWorks) - rust-lang/rust#159996 (Detect when a macro without exclamation mark uses square brackets)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several changes:
Link
symlink_metadatafrommetadataSomeone reading
metadatalikely wants easy/quick access tosymlink_metadataas well. Since this explicitly documents that it does follow symlinks, it made sense to leave a note stating how to perform the same action without that behavior.Add symbolic link note to errors
It's intuitive that you cannot return the
Metadataof a resolved file if the file could not be resolved. But it's not always obvious. Since we're stating "the path does not exist" (also an obvious case). It will help to have this gentle reminder.Explicit behavior of directories and files in
symlink_metadataReading the documentation, it was unclear whether
symlink_metadatawould also work on files and directories. I guessed it would, but it's nice to call it out. The wording also gave me an opportunity to cross-link tometadataso someone can easily jump back and forth between them.