Skip to content

Commit

Permalink
Rollup merge of rust-lang#126531 - slanterns:error_provider, r=workin…
Browse files Browse the repository at this point in the history
…gjubilee

Add codegen test for `Request::provide_*`

Codegen before & after rust-lang#126242: https://gist.github.com/slanterns/3789ee36f59ed834e1a6bd4677b68ed4.

Also adjust an outdated comment since `tag_id` is no longer attached to `TaggedOption` via `Erased`, but stored next to it in `Tagged` under the new implementation.

My first time writing FileCheck xD. Correct me if there is anything that should be amended.

r? libs
  • Loading branch information
jieyouxu authored Jun 17, 2024
2 parents cd1c998 + 2388743 commit c1acd7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ pub(crate) mod tags {
/// An `Option` with a type tag `I`.
///
/// Since this struct implements `Erased`, the type can be erased to make a dynamically typed
/// option. The type can be checked dynamically using `Erased::tag_id` and since this is statically
/// option. The type can be checked dynamically using `Tagged::tag_id` and since this is statically
/// checked for the concrete type, there is some degree of type safety.
#[repr(transparent)]
pub(crate) struct TaggedOption<'a, I: tags::Type<'a>>(pub Option<I::Reified>);
Expand Down

0 comments on commit c1acd7a

Please sign in to comment.