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

Move Error trait into core #99917

Merged
merged 1 commit into from
Aug 23, 2022
Merged

Move Error trait into core #99917

merged 1 commit into from
Aug 23, 2022

Conversation

yaahc
Copy link
Member

@yaahc yaahc commented Jul 29, 2022

This PR moves the error trait from the standard library into a new unstable error module within the core library. The goal of this PR is to help unify error reporting across the std and no_std ecosystems, as well as open the door to integrating the error trait into the panic reporting system when reporting panics whose source is an errors (such as via expect).

This PR is a rewrite of #90328 using new compiler features that have been added to support error in core.

@rustbot rustbot added T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 29, 2022
@rustbot
Copy link
Collaborator

rustbot commented Jul 29, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive
Copy link
Collaborator

r? @thomcc

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 29, 2022
@yaahc yaahc changed the title Error in core move Move Error trait into core Jul 29, 2022
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Aug 2, 2022

☔ The latest upstream changes (presumably #99431) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@yaahc
Copy link
Member Author

yaahc commented Aug 12, 2022

@bors try

@bors
Copy link
Contributor

bors commented Aug 12, 2022

⌛ Trying commit ada65c2 with merge cc3bc286abf7599e6270f1e3b15ca478d68832e7...

@bors
Copy link
Contributor

bors commented Aug 12, 2022

☀️ Try build successful - checks-actions
Build commit: cc3bc286abf7599e6270f1e3b15ca478d68832e7 (cc3bc286abf7599e6270f1e3b15ca478d68832e7)

Copy link
Member

@thomcc thomcc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great and is super exciting to see. It seems the bulk of it is from other impls (which will be trimmed down once cfg(bootstrap) cleans up, so I don't really have any comments.

Sorry for the delay in reviewing it, it was fairly large!

@thomcc
Copy link
Member

thomcc commented Aug 16, 2022

r=me with nit addressed

@yaahc
Copy link
Member Author

yaahc commented Aug 17, 2022

Sorry for the delay in reviewing it, it was fairly large!

Entirely understandable, and thank you for slogging through it with me!

library/core/src/error.rs Outdated Show resolved Hide resolved
library/core/src/error.md Outdated Show resolved Hide resolved
@rust-log-analyzer

This comment has been minimized.

@yaahc
Copy link
Member Author

yaahc commented Aug 19, 2022

@bors r=thomcc

@bors
Copy link
Contributor

bors commented Aug 19, 2022

📌 Commit 03861e5 has been approved by thomcc

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 19, 2022
@jhpratt
Copy link
Member

jhpratt commented Aug 19, 2022

🎉 Long time coming! Great work Jane.

@c410-f3r
Copy link
Contributor

Looking forward for core::io::Write.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (060e47f): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.2% [1.5%, 7.7%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-2.6%, -2.6%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Footnotes

  1. the arithmetic mean of the percent change

  2. number of relevant changes

@jhpratt
Copy link
Member

jhpratt commented Sep 26, 2022

@yaahc Is there a tracking issue for this? I don't see any linked and there's not one in the error_in_core doc annotation.

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Oct 31, 2022
Add tracking issue to `error_in_core`

This was merged in rust-lang#99917 without a tracking issue, so I'm creating one now: rust-lang#103765
facebook-github-bot pushed a commit to facebook/SPARTA that referenced this pull request Nov 10, 2022
Summary:
Added `fbcode` symlinks for `platform010` & `platform010-aarch64` and addressed the following fixes:
* Account for stabilized [`#![feature(backtrace)]`](rust-lang/rust#99573) and [`#![feature(generic_associated_types)]`](rust-lang/rust#99573)
* Account for removal of [`#![feature(result_into_ok_or_err)]`](rust-lang/rust#100604)
* Account for migration of [`std::io::ReadBuf` to `std::io::BorrowBuf|BorrowCursor`](rust-lang/rust#97015)
* Account for [`Error` trait move into core](rust-lang/rust#99917)
* Account for `#[warn(non_camel_case_types)]`
* Various function signature, lifetime requirement changes and lint fixes

Reviewed By: zertosh

Differential Revision: D40923615

fbshipit-source-id: f7ac2828d74edeae39aae517172207b0ee998a59
facebook-github-bot pushed a commit to facebook/starlark-rust that referenced this pull request Nov 10, 2022
Summary:
Added `fbcode` symlinks for `platform010` & `platform010-aarch64` and addressed the following fixes:
* Account for stabilized [`#![feature(backtrace)]`](rust-lang/rust#99573) and [`#![feature(generic_associated_types)]`](rust-lang/rust#99573)
* Account for removal of [`#![feature(result_into_ok_or_err)]`](rust-lang/rust#100604)
* Account for migration of [`std::io::ReadBuf` to `std::io::BorrowBuf|BorrowCursor`](rust-lang/rust#97015)
* Account for [`Error` trait move into core](rust-lang/rust#99917)
* Account for `#[warn(non_camel_case_types)]`
* Various function signature, lifetime requirement changes and lint fixes

Reviewed By: zertosh

Differential Revision: D40923615

fbshipit-source-id: f7ac2828d74edeae39aae517172207b0ee998a59
facebook-github-bot pushed a commit to facebook/sapling that referenced this pull request Nov 10, 2022
Summary:
Added `fbcode` symlinks for `platform010` & `platform010-aarch64` and addressed the following fixes:
* Account for stabilized [`#![feature(backtrace)]`](rust-lang/rust#99573) and [`#![feature(generic_associated_types)]`](rust-lang/rust#99573)
* Account for removal of [`#![feature(result_into_ok_or_err)]`](rust-lang/rust#100604)
* Account for migration of [`std::io::ReadBuf` to `std::io::BorrowBuf|BorrowCursor`](rust-lang/rust#97015)
* Account for [`Error` trait move into core](rust-lang/rust#99917)
* Account for `#[warn(non_camel_case_types)]`
* Various function signature, lifetime requirement changes and lint fixes

Reviewed By: zertosh

Differential Revision: D40923615

fbshipit-source-id: f7ac2828d74edeae39aae517172207b0ee998a59
facebook-github-bot pushed a commit to facebookincubator/below that referenced this pull request Nov 10, 2022
Summary:
Added `fbcode` symlinks for `platform010` & `platform010-aarch64` and addressed the following fixes:
* Account for stabilized [`#![feature(backtrace)]`](rust-lang/rust#99573) and [`#![feature(generic_associated_types)]`](rust-lang/rust#99573)
* Account for removal of [`#![feature(result_into_ok_or_err)]`](rust-lang/rust#100604)
* Account for migration of [`std::io::ReadBuf` to `std::io::BorrowBuf|BorrowCursor`](rust-lang/rust#97015)
* Account for [`Error` trait move into core](rust-lang/rust#99917)
* Account for `#[warn(non_camel_case_types)]`
* Various function signature, lifetime requirement changes and lint fixes

Reviewed By: zertosh

Differential Revision: D40923615

fbshipit-source-id: f7ac2828d74edeae39aae517172207b0ee998a59
facebook-github-bot pushed a commit to facebookexperimental/rust-shed that referenced this pull request Nov 10, 2022
Summary:
Added `fbcode` symlinks for `platform010` & `platform010-aarch64` and addressed the following fixes:
* Account for stabilized [`#![feature(backtrace)]`](rust-lang/rust#99573) and [`#![feature(generic_associated_types)]`](rust-lang/rust#99573)
* Account for removal of [`#![feature(result_into_ok_or_err)]`](rust-lang/rust#100604)
* Account for migration of [`std::io::ReadBuf` to `std::io::BorrowBuf|BorrowCursor`](rust-lang/rust#97015)
* Account for [`Error` trait move into core](rust-lang/rust#99917)
* Account for `#[warn(non_camel_case_types)]`
* Various function signature, lifetime requirement changes and lint fixes

Reviewed By: zertosh

Differential Revision: D40923615

fbshipit-source-id: f7ac2828d74edeae39aae517172207b0ee998a59
facebook-github-bot pushed a commit to facebook/redex that referenced this pull request Nov 10, 2022
Summary:
Added `fbcode` symlinks for `platform010` & `platform010-aarch64` and addressed the following fixes:
* Account for stabilized [`#![feature(backtrace)]`](rust-lang/rust#99573) and [`#![feature(generic_associated_types)]`](rust-lang/rust#99573)
* Account for removal of [`#![feature(result_into_ok_or_err)]`](rust-lang/rust#100604)
* Account for migration of [`std::io::ReadBuf` to `std::io::BorrowBuf|BorrowCursor`](rust-lang/rust#97015)
* Account for [`Error` trait move into core](rust-lang/rust#99917)
* Account for `#[warn(non_camel_case_types)]`
* Various function signature, lifetime requirement changes and lint fixes

Reviewed By: zertosh

Differential Revision: D40923615

fbshipit-source-id: f7ac2828d74edeae39aae517172207b0ee998a59
facebook-github-bot pushed a commit to facebookexperimental/reverie that referenced this pull request Nov 10, 2022
Summary:
Added `fbcode` symlinks for `platform010` & `platform010-aarch64` and addressed the following fixes:
* Account for stabilized [`#![feature(backtrace)]`](rust-lang/rust#99573) and [`#![feature(generic_associated_types)]`](rust-lang/rust#99573)
* Account for removal of [`#![feature(result_into_ok_or_err)]`](rust-lang/rust#100604)
* Account for migration of [`std::io::ReadBuf` to `std::io::BorrowBuf|BorrowCursor`](rust-lang/rust#97015)
* Account for [`Error` trait move into core](rust-lang/rust#99917)
* Account for `#[warn(non_camel_case_types)]`
* Various function signature, lifetime requirement changes and lint fixes

Reviewed By: zertosh

Differential Revision: D40923615

fbshipit-source-id: f7ac2828d74edeae39aae517172207b0ee998a59
facebook-github-bot pushed a commit to facebookincubator/gazebo_lint that referenced this pull request Nov 10, 2022
Summary:
Added `fbcode` symlinks for `platform010` & `platform010-aarch64` and addressed the following fixes:
* Account for stabilized [`#![feature(backtrace)]`](rust-lang/rust#99573) and [`#![feature(generic_associated_types)]`](rust-lang/rust#99573)
* Account for removal of [`#![feature(result_into_ok_or_err)]`](rust-lang/rust#100604)
* Account for migration of [`std::io::ReadBuf` to `std::io::BorrowBuf|BorrowCursor`](rust-lang/rust#97015)
* Account for [`Error` trait move into core](rust-lang/rust#99917)
* Account for `#[warn(non_camel_case_types)]`
* Various function signature, lifetime requirement changes and lint fixes

Reviewed By: zertosh

Differential Revision: D40923615

fbshipit-source-id: f7ac2828d74edeae39aae517172207b0ee998a59
facebook-github-bot pushed a commit to facebook/buck2 that referenced this pull request Nov 10, 2022
Summary:
Added `fbcode` symlinks for `platform010` & `platform010-aarch64` and addressed the following fixes:
* Account for stabilized [`#![feature(backtrace)]`](rust-lang/rust#99573) and [`#![feature(generic_associated_types)]`](rust-lang/rust#99573)
* Account for removal of [`#![feature(result_into_ok_or_err)]`](rust-lang/rust#100604)
* Account for migration of [`std::io::ReadBuf` to `std::io::BorrowBuf|BorrowCursor`](rust-lang/rust#97015)
* Account for [`Error` trait move into core](rust-lang/rust#99917)
* Account for `#[warn(non_camel_case_types)]`
* Various function signature, lifetime requirement changes and lint fixes

Reviewed By: zertosh

Differential Revision: D40923615

fbshipit-source-id: f7ac2828d74edeae39aae517172207b0ee998a59
facebook-github-bot pushed a commit to facebook/redex that referenced this pull request Nov 10, 2022
Summary:
Added `fbcode` symlinks for `platform010` & `platform010-aarch64` and addressed the following fixes:
* Account for stabilized [`#![feature(backtrace)]`](rust-lang/rust#99573) and [`#![feature(generic_associated_types)]`](rust-lang/rust#99573)
* Account for removal of [`#![feature(result_into_ok_or_err)]`](rust-lang/rust#100604)
* Account for migration of [`std::io::ReadBuf` to `std::io::BorrowBuf|BorrowCursor`](rust-lang/rust#97015)
* Account for [`Error` trait move into core](rust-lang/rust#99917)
* Account for `#[warn(non_camel_case_types)]`
* Various function signature, lifetime requirement changes and lint fixes

Reviewed By: zertosh

Differential Revision: D40923615

fbshipit-source-id: f7ac2828d74edeae39aae517172207b0ee998a59
vmagro pushed a commit to facebookincubator/antlir that referenced this pull request Nov 14, 2022
Summary:
Added `fbcode` symlinks for `platform010` & `platform010-aarch64` and addressed the following fixes:
* Account for stabilized [`#![feature(backtrace)]`](rust-lang/rust#99573) and [`#![feature(generic_associated_types)]`](rust-lang/rust#99573)
* Account for removal of [`#![feature(result_into_ok_or_err)]`](rust-lang/rust#100604)
* Account for migration of [`std::io::ReadBuf` to `std::io::BorrowBuf|BorrowCursor`](rust-lang/rust#97015)
* Account for [`Error` trait move into core](rust-lang/rust#99917)
* Account for `#[warn(non_camel_case_types)]`
* Various function signature, lifetime requirement changes and lint fixes

Test Plan:
```
cd ~/fbcode
buckify_tp2
./common/rust/tools/scripts/check_all.sh fbcode -- --local-only
```

Reviewed By: zertosh

Differential Revision: D40923615

fbshipit-source-id: f7ac2828d74edeae39aae517172207b0ee998a59
thomcc pushed a commit to tcdi/postgrestd that referenced this pull request Feb 10, 2023
Add tracking issue to `error_in_core`

This was merged in rust-lang/rust#99917 without a tracking issue, so I'm creating one now: rust-lang/rust#103765
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet