Skip to content

Commit c998b58

Browse files
committed
Fix typos and stderr test output for rustc 1.92.
Requires rustc 1.92
1 parent 0245d4c commit c998b58

File tree

10 files changed

+39
-65
lines changed

10 files changed

+39
-65
lines changed

src/luau/json.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ mod tests {
313313
fn test_error_cases() {
314314
assert!(parse("").is_err());
315315
assert!(parse("nul").is_err());
316-
assert!(parse("tru").is_err());
317-
assert!(parse("fals").is_err());
316+
assert!(parse("tru").is_err()); // spellchecker:disable-line
317+
assert!(parse("fals").is_err()); // spellchecker:disable-line
318318
assert!(parse(r#""unterminated"#).is_err());
319319
assert!(parse("[1,2,]").is_err());
320320
assert!(parse(r#"{"key""#).is_err());

src/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2098,7 +2098,7 @@ impl Lua {
20982098

20992099
/// Suspends the current async function, returning the provided arguments to caller.
21002100
///
2101-
/// This function is similar to [`coroutine.yield`] but allow yeilding Rust functions
2101+
/// This function is similar to [`coroutine.yield`] but allow yielding Rust functions
21022102
/// and passing values to the caller.
21032103
/// Please note that you cannot cross [`Thread`] boundaries (e.g. calling `yield_with` on one
21042104
/// thread and resuming on another).

tests/compile/lua_norefunwindsafe.stderr

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
error[E0277]: the type `UnsafeCell<*mut lua_State>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
1+
error[E0277]: the type `UnsafeCell<*mut lua_State>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary
22
--> tests/compile/lua_norefunwindsafe.rs:7:18
33
|
44
7 | catch_unwind(|| lua.create_table().unwrap());
5-
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<*mut lua_State>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
5+
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<*mut lua_State>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary
66
| |
77
| required by a bound introduced by this call
88
|
99
= help: within `mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<*mut lua_State>`
1010
note: required because it appears within the type `Cell<*mut lua_State>`
1111
--> $RUST/core/src/cell.rs
12-
|
13-
| pub struct Cell<T: ?Sized> {
14-
| ^^^^
1512
note: required because it appears within the type `mlua::state::raw::RawLua`
1613
--> src/state/raw.rs
1714
|
@@ -36,15 +33,12 @@ note: required because it's used within this closure
3633
| ^^
3734
note: required by a bound in `std::panic::catch_unwind`
3835
--> $RUST/std/src/panic.rs
39-
|
40-
| pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
41-
| ^^^^^^^^^^ required by this bound in `catch_unwind`
4236

43-
error[E0277]: the type `UnsafeCell<mlua::state::extra::ExtraData>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
37+
error[E0277]: the type `UnsafeCell<mlua::state::extra::ExtraData>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary
4438
--> tests/compile/lua_norefunwindsafe.rs:7:18
4539
|
4640
7 | catch_unwind(|| lua.create_table().unwrap());
47-
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<mlua::state::extra::ExtraData>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
41+
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<mlua::state::extra::ExtraData>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary
4842
| |
4943
| required by a bound introduced by this call
5044
|
@@ -74,6 +68,3 @@ note: required because it's used within this closure
7468
| ^^
7569
note: required by a bound in `std::panic::catch_unwind`
7670
--> $RUST/std/src/panic.rs
77-
|
78-
| pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
79-
| ^^^^^^^^^^ required by this bound in `catch_unwind`

tests/compile/ref_nounwindsafe.stderr

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
1-
error[E0277]: the type `UnsafeCell<usize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
1+
error[E0277]: the type `UnsafeCell<usize>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary
22
--> tests/compile/ref_nounwindsafe.rs:8:18
33
|
44
8 | catch_unwind(move || table.set("a", "b").unwrap());
5-
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<usize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
5+
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<usize>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary
66
| |
77
| required by a bound introduced by this call
88
|
99
= help: within `rc::RcInner<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<usize>`
1010
note: required because it appears within the type `Cell<usize>`
1111
--> $RUST/core/src/cell.rs
12-
|
13-
| pub struct Cell<T: ?Sized> {
14-
| ^^^^
1512
note: required because it appears within the type `rc::RcInner<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`
1613
--> $RUST/alloc/src/rc.rs
17-
|
18-
| struct RcInner<T: ?Sized> {
19-
| ^^^^^^^
2014
= note: required for `NonNull<rc::RcInner<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>>` to implement `UnwindSafe`
2115
note: required because it appears within the type `std::rc::Weak<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`
2216
--> $RUST/alloc/src/rc.rs
23-
|
24-
| pub struct Weak<
25-
| ^^^^
2617
note: required because it appears within the type `WeakLua`
2718
--> src/state.rs
2819
|
@@ -45,24 +36,18 @@ note: required because it's used within this closure
4536
| ^^^^^^^
4637
note: required by a bound in `std::panic::catch_unwind`
4738
--> $RUST/std/src/panic.rs
48-
|
49-
| pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
50-
| ^^^^^^^^^^ required by this bound in `catch_unwind`
5139

52-
error[E0277]: the type `UnsafeCell<*mut lua_State>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
40+
error[E0277]: the type `UnsafeCell<*mut lua_State>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary
5341
--> tests/compile/ref_nounwindsafe.rs:8:18
5442
|
5543
8 | catch_unwind(move || table.set("a", "b").unwrap());
56-
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<*mut lua_State>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
44+
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<*mut lua_State>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary
5745
| |
5846
| required by a bound introduced by this call
5947
|
6048
= help: within `rc::RcInner<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<*mut lua_State>`
6149
note: required because it appears within the type `Cell<*mut lua_State>`
6250
--> $RUST/core/src/cell.rs
63-
|
64-
| pub struct Cell<T: ?Sized> {
65-
| ^^^^
6651
note: required because it appears within the type `mlua::state::raw::RawLua`
6752
--> src/state/raw.rs
6853
|
@@ -75,15 +60,9 @@ note: required because it appears within the type `mlua::types::sync::inner::Ree
7560
| ^^^^^^^^^^^^^^
7661
note: required because it appears within the type `rc::RcInner<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`
7762
--> $RUST/alloc/src/rc.rs
78-
|
79-
| struct RcInner<T: ?Sized> {
80-
| ^^^^^^^
8163
= note: required for `NonNull<rc::RcInner<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>>` to implement `UnwindSafe`
8264
note: required because it appears within the type `std::rc::Weak<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`
8365
--> $RUST/alloc/src/rc.rs
84-
|
85-
| pub struct Weak<
86-
| ^^^^
8766
note: required because it appears within the type `WeakLua`
8867
--> src/state.rs
8968
|
@@ -106,15 +85,12 @@ note: required because it's used within this closure
10685
| ^^^^^^^
10786
note: required by a bound in `std::panic::catch_unwind`
10887
--> $RUST/std/src/panic.rs
109-
|
110-
| pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
111-
| ^^^^^^^^^^ required by this bound in `catch_unwind`
11288

113-
error[E0277]: the type `UnsafeCell<mlua::state::extra::ExtraData>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
89+
error[E0277]: the type `UnsafeCell<mlua::state::extra::ExtraData>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary
11490
--> tests/compile/ref_nounwindsafe.rs:8:18
11591
|
11692
8 | catch_unwind(move || table.set("a", "b").unwrap());
117-
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<mlua::state::extra::ExtraData>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
93+
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<mlua::state::extra::ExtraData>` may contain interior mutability and a reference may not be safely transferable across a catch_unwind boundary
11894
| |
11995
| required by a bound introduced by this call
12096
|
@@ -132,15 +108,9 @@ note: required because it appears within the type `mlua::types::sync::inner::Ree
132108
| ^^^^^^^^^^^^^^
133109
note: required because it appears within the type `rc::RcInner<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`
134110
--> $RUST/alloc/src/rc.rs
135-
|
136-
| struct RcInner<T: ?Sized> {
137-
| ^^^^^^^
138111
= note: required for `NonNull<rc::RcInner<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>>` to implement `UnwindSafe`
139112
note: required because it appears within the type `std::rc::Weak<mlua::types::sync::inner::ReentrantMutex<mlua::state::raw::RawLua>>`
140113
--> $RUST/alloc/src/rc.rs
141-
|
142-
| pub struct Weak<
143-
| ^^^^
144114
note: required because it appears within the type `WeakLua`
145115
--> src/state.rs
146116
|
@@ -163,6 +133,3 @@ note: required because it's used within this closure
163133
| ^^^^^^^
164134
note: required by a bound in `std::panic::catch_unwind`
165135
--> $RUST/std/src/panic.rs
166-
|
167-
| pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
168-
| ^^^^^^^^^^ required by this bound in `catch_unwind`
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
error[E0373]: closure may outlive the current function, but it borrows `inner`, which is owned by the current function
22
--> tests/compile/scope_callback_capture.rs:7:43
33
|
4-
5 | lua.scope(|scope| {
4+
5 | lua.scope(|scope| {
55
| ----- has type `&'1 mlua::Scope<'1, '_>`
6-
6 | let mut inner: Option<Table> = None;
7-
7 | let f = scope.create_function_mut(|_, t: Table| {
6+
6 | let mut inner: Option<Table> = None;
7+
7 | let f = scope.create_function_mut(|_, t: Table| {
88
| ^^^^^^^^^^^^^ may outlive borrowed value `inner`
9-
8 | inner = Some(t);
9+
8 | inner = Some(t);
1010
| ----- `inner` is borrowed here
1111
|
1212
note: function requires argument type to outlive `'1`
1313
--> tests/compile/scope_callback_capture.rs:7:17
1414
|
15-
7 | let f = scope.create_function_mut(|_, t: Table| {
15+
7 | let f = scope.create_function_mut(|_, t: Table| {
1616
| _________________^
17-
8 | | inner = Some(t);
18-
9 | | Ok(())
17+
8 | | inner = Some(t);
18+
9 | | Ok(())
1919
10 | | })?;
2020
| |__________^
2121
help: to force the closure to take ownership of `inner` (and any other referenced variables), use the `move` keyword
2222
|
23-
7 | let f = scope.create_function_mut(move |_, t: Table| {
23+
7 | let f = scope.create_function_mut(move |_, t: Table| {
2424
| ++++

tests/compile/scope_invariance.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0373]: closure may outlive the current function, but it borrows `test.field`, which is owned by the current function
22
--> tests/compile/scope_invariance.rs:13:39
33
|
4-
9 | lua.scope(|scope| {
4+
9 | lua.scope(|scope| {
55
| ----- has type `&'1 mlua::Scope<'1, '_>`
66
...
77
13 | scope.create_function_mut(|_, ()| {

tests/compile/scope_mutable_aliasing.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ error[E0499]: cannot borrow `i` as mutable more than once at a time
1010
| argument requires that `i` is borrowed for `'1`
1111
12 | let _b = scope.create_userdata(MyUserData(&mut i)).unwrap();
1212
| ^^^^^^ second mutable borrow occurs here
13+
|
14+
note: requirement that the value outlives `'1` introduced here
15+
--> src/scope.rs
16+
|
17+
| T: UserData + 'env,
18+
| ^^^^

tests/compile/scope_userdata_borrow.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ error[E0597]: `ibad` does not live long enough
1313
| argument requires that `ibad` is borrowed for `'1`
1414
16 | };
1515
| - `ibad` dropped here while still borrowed
16+
|
17+
note: requirement that the value outlives `'1` introduced here
18+
--> src/scope.rs
19+
|
20+
| T: UserData + 'env,
21+
| ^^^^

tests/luau.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ fn test_loadstring() -> Result<()> {
448448
assert_eq!(f.call::<i32>(())?, 123);
449449

450450
let err = lua
451-
.load(r#"loadstring("retur 123", "chunk")"#)
451+
.load(r#"loadstring("retur 123", "chunk")"#) // spellchecker:disable-line
452452
.exec()
453453
.err()
454454
.unwrap();

typos.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
[default]
22
extend-ignore-identifiers-re = ["2nd", "ser"]
3+
# Enable inline disable comments: // spellchecker:disable-line
4+
extend-ignore-re = [
5+
"(?Rm)^.*//\\s*spellchecker:disable-line$",
6+
]
37

48
[default.extend-words]
59
thr = "thr"

0 commit comments

Comments
 (0)