Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test of ParseStream in catch_unwind
Currently fails to build: error[E0277]: the type `UnsafeCell<syn::buffer::Cursor<'static>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary --> tests/test_parse_buffer.rs:98:49 | 98 | let thread_result = panic::catch_unwind(|| input.parse()); | ------------------- ^^^^^^^^^^^^^^^^ `UnsafeCell<syn::buffer::Cursor<'static>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | | | required by a bound introduced by this call | = help: within `ParseBuffer<'_>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<syn::buffer::Cursor<'static>>`, which is required by `{closure@tests/test_parse_buffer.rs:98:49: 98:51}: UnwindSafe` note: required because it appears within the type `Cell<syn::buffer::Cursor<'static>>` --> $RUST/library/core/src/cell.rs:293:12 | 293 | pub struct Cell<T: ?Sized> { | ^^^^ note: required because it appears within the type `ParseBuffer<'_>` --> src/parse.rs:245:12 | 245 | pub struct ParseBuffer<'a> { | ^^^^^^^^^^^ = note: required for `&ParseBuffer<'_>` to implement `UnwindSafe` note: required because it's used within this closure --> tests/test_parse_buffer.rs:98:49 | 98 | let thread_result = panic::catch_unwind(|| input.parse()); | ^^ note: required by a bound in `std::panic::catch_unwind` --> $RUST/library/std/src/panic.rs:148:40 | 148 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> { | ^^^^^^^^^^ required by this bound in `catch_unwind` error[E0277]: the type `UnsafeCell<Option<Rc<Cell<parse::Unexpected>>>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary --> tests/test_parse_buffer.rs:98:49 | 98 | let thread_result = panic::catch_unwind(|| input.parse()); | ------------------- ^^^^^^^^^^^^^^^^ `UnsafeCell<Option<Rc<Cell<parse::Unexpected>>>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | | | required by a bound introduced by this call | = help: within `ParseBuffer<'_>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<Option<Rc<Cell<parse::Unexpected>>>>`, which is required by `{closure@tests/test_parse_buffer.rs:98:49: 98:51}: UnwindSafe` note: required because it appears within the type `Cell<Option<Rc<Cell<parse::Unexpected>>>>` --> $RUST/library/core/src/cell.rs:293:12 | 293 | pub struct Cell<T: ?Sized> { | ^^^^ note: required because it appears within the type `ParseBuffer<'_>` --> src/parse.rs:245:12 | 245 | pub struct ParseBuffer<'a> { | ^^^^^^^^^^^ = note: required for `&ParseBuffer<'_>` to implement `UnwindSafe` note: required because it's used within this closure --> tests/test_parse_buffer.rs:98:49 | 98 | let thread_result = panic::catch_unwind(|| input.parse()); | ^^ note: required by a bound in `std::panic::catch_unwind` --> $RUST/library/std/src/panic.rs:148:40 | 148 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> { | ^^^^^^^^^^ required by this bound in `catch_unwind`
- Loading branch information