Skip to content

Commit d3ada6f

Browse files
authored
[workerd-cxx] enable "expect" attribute (#47)
* [workerd-cxx] enable "expect" attribute It is relatively new.
1 parent 440afe9 commit d3ada6f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

kj-rs/tests/test_futures.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,7 @@ pub async fn new_layered_ready_future_void() -> Result<()> {
149149
}
150150

151151
// From example at https://doc.rust-lang.org/std/future/fn.poll_fn.html#capturing-a-pinned-state
152-
async fn naive_select<T>(
153-
a: impl Future<Output = T>,
154-
b: impl Future<Output = T>,
155-
) -> T {
152+
async fn naive_select<T>(a: impl Future<Output = T>, b: impl Future<Output = T>) -> T {
156153
let (mut a, mut b) = (pin!(a), pin!(b));
157154
future::poll_fn(move |cx| {
158155
if let Poll::Ready(r) = a.as_mut().poll(cx) {

syntax/attrs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ pub fn parse(cx: &mut Errors, attrs: Vec<Attribute>, mut parser: Parser) -> Othe
159159
|| attr_path.is_ident("forbid")
160160
|| attr_path.is_ident("deprecated")
161161
|| attr_path.is_ident("must_use")
162+
|| attr_path.is_ident("expect")
162163
{
163164
// https://doc.rust-lang.org/reference/attributes/diagnostics.html
164165
passthrough_attrs.push(attr);

0 commit comments

Comments
 (0)