Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0660732
`std::path::absolute`
ChrisDenton Dec 8, 2021
60ec6a0
Tweak sentence in `transmute` docs
camelid Dec 27, 2021
7fd6ddf
Error when selected impl is not const in constck
fee1-dead Dec 30, 2021
2b70a3d
Display "private fields" instead of "fields omitted"
camelid Jan 9, 2022
8fd8db5
Extended the note on the use of `no_run` attribute
JohnScience Jan 10, 2022
680ebea
RELEASES.md: Add 1.58 release note for `File::options` stabilization
joshtriplett Jan 9, 2022
2ae616a
Fix doc formatting for time.rs
rosik Jan 10, 2022
55abf38
Add note about upstream commit musl-patch-configure.diff is derived from
wesleywiser Jan 10, 2022
881b427
Add missing suffix for sidebar-items script path
GuillaumeGomez Jan 10, 2022
5786bbd
Eliminate "boxed" wording in `std::error::Error` documentation
david-perez Jan 10, 2022
fc8af98
Document Box<T> FFI guarantee in 1.41.0 release notes
nico-abram Jan 3, 2022
c91ad5d
Improve documentation for File::options to give a more likely example
joshtriplett Jan 9, 2022
11bea26
Update AsmArgs field visibility for rustfmt
ytmimi Jan 11, 2022
22d4e97
:arrow_up: rust-analyzer
lnicola Jan 11, 2022
9234c0f
Fix style for rust logo
GuillaumeGomez Jan 11, 2022
24c6e96
Add GUI test for rust logo style in the sidebars
GuillaumeGomez Jan 11, 2022
bf5130b
Add test
fee1-dead Jan 11, 2022
ea9181b
fs: Use readdir() instead of readdir_r() on Linux
tavianator Jan 11, 2022
24b4c3f
Rollup merge of #91673 - ChrisDenton:path-absolute, r=Mark-Simulacrum
matthiaskrgr Jan 11, 2022
b1f52e5
Rollup merge of #92328 - camelid:sentence, r=scottmcm
matthiaskrgr Jan 11, 2022
c92b910
Rollup merge of #92432 - fee1-dead:constck-impl-constness, r=oli-obk
matthiaskrgr Jan 11, 2022
1d97d61
Rollup merge of #92506 - nico-abram:uwu, r=Mark-Simulacrum
matthiaskrgr Jan 11, 2022
f05cb54
Rollup merge of #92699 - camelid:private-fields, r=jsha
matthiaskrgr Jan 11, 2022
e0d69b6
Rollup merge of #92703 - joshtriplett:relnotes-file-options, r=pietro…
matthiaskrgr Jan 11, 2022
9e0243c
Rollup merge of #92707 - JohnScience:patch-1, r=GuillaumeGomez
matthiaskrgr Jan 11, 2022
12f4d1e
Rollup merge of #92709 - joshtriplett:file-options-docs, r=Mark-Simul…
matthiaskrgr Jan 11, 2022
a5b7409
Rollup merge of #92720 - rosik:patch-1, r=m-ou-se
matthiaskrgr Jan 11, 2022
717bde7
Rollup merge of #92732 - wesleywiser:note_musl_patch_info, r=Mark-Sim…
matthiaskrgr Jan 11, 2022
f4f5755
Rollup merge of #92742 - GuillaumeGomez:missing-suffix-sidebar-items,…
matthiaskrgr Jan 11, 2022
0746587
Rollup merge of #92748 - david-perez:eliminate-boxed-wording-std-erro…
matthiaskrgr Jan 11, 2022
a22e77f
Rollup merge of #92754 - ytmimi:AsmArgs-field-visibility, r=calebcart…
matthiaskrgr Jan 11, 2022
d0440de
Rollup merge of #92756 - lnicola:rust-analyzer-2022-01-11, r=lnicola
matthiaskrgr Jan 11, 2022
18fa47c
Rollup merge of #92764 - GuillaumeGomez:fix-rust-logo-style, r=jsha
matthiaskrgr Jan 11, 2022
efcc300
Rollup merge of #92778 - tavianator:linux-readdir-no-r, r=joshtriplett
matthiaskrgr Jan 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Eliminate "boxed" wording in std::error::Error documentation
In commit 29403ee, documentation for the methods on `std::any::Any` was
modified so that they referred to the concrete value behind the trait
object as the "inner" value. This is a more accurate wording than
"boxed": while putting trait objects inside boxes is arguably the most
common use, they can also be placed behind other pointer types like
`&mut` or `std::sync::Arc`.

This commit does the same documentation changes for `std::error::Error`.
  • Loading branch information
david-perez committed Jan 10, 2022
commit 5786bbddc670597af286381b27fbb9f563cf7dc7
12 changes: 6 additions & 6 deletions library/std/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,21 +606,21 @@ impl Error for time::FromSecsError {}

// Copied from `any.rs`.
impl dyn Error + 'static {
/// Returns `true` if the boxed type is the same as `T`
/// Returns `true` if the inner type is the same as `T`.
#[stable(feature = "error_downcast", since = "1.3.0")]
#[inline]
pub fn is<T: Error + 'static>(&self) -> bool {
// Get `TypeId` of the type this function is instantiated with.
let t = TypeId::of::<T>();

// Get `TypeId` of the type in the trait object.
let boxed = self.type_id(private::Internal);
// Get `TypeId` of the type in the trait object (`self`).
let concrete = self.type_id(private::Internal);

// Compare both `TypeId`s on equality.
t == boxed
t == concrete
}

/// Returns some reference to the boxed value if it is of type `T`, or
/// Returns some reference to the inner value if it is of type `T`, or
/// `None` if it isn't.
#[stable(feature = "error_downcast", since = "1.3.0")]
#[inline]
Expand All @@ -632,7 +632,7 @@ impl dyn Error + 'static {
}
}

/// Returns some mutable reference to the boxed value if it is of type `T`, or
/// Returns some mutable reference to the inner value if it is of type `T`, or
/// `None` if it isn't.
#[stable(feature = "error_downcast", since = "1.3.0")]
#[inline]
Expand Down