diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-07-22 11:53:43 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-22 11:53:43 +0530 |
| commit | 5df3b983218e136e995df5a7210535bddbdfca52 (patch) | |
| tree | f33a2c0b026c5ef7ac34d14e3453d729ea3dfbf3 /compiler/rustc_codegen_llvm/src | |
| parent | 92bebac0b93011212c48a12f068a16b19376b55a (diff) | |
| parent | 7ba0be832a0f9c7a22f4b9e2cb76b653d4010b30 (diff) | |
| download | rust-5df3b983218e136e995df5a7210535bddbdfca52.tar.gz rust-5df3b983218e136e995df5a7210535bddbdfca52.zip | |
Rollup merge of #99579 - CleanCut:expect-warning, r=joshtriplett
Add same warning to Result::expect as Result::unwrap I was reading a recent blog post by Jimmy Hartzell and [he noted](https://www.thecodedmessage.com/posts/2022-07-14-programming-unwrap/#context): > I will however note that the documentation of `unwrap` comes with [a warning not to use it](https://doc.rust-lang.org/std/result/enum.Result.html#method.unwrap). The warning is framed in terms of the fact that `unwrap` may panic, but the [documentation of `expect`](https://doc.rust-lang.org/std/result/enum.Result.html#method.expect), where this is equally true, does not come with such a warning. It _is_ equally true. Let's add the same warning to `expect`. This PR is a copy-and-paste of the warning text from the docstring for `unwrap`.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
