Skip to content

Commit 293aeba

Browse files
authored
Bump to Rust 1.84 (#2001)
1 parent 5b5a0a6 commit 293aeba

File tree

417 files changed

+687
-691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

417 files changed

+687
-691
lines changed

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ jobs:
183183
runs-on: ubuntu-latest
184184
timeout-minutes: 20 # on a successful run, runs in 8 minutes
185185
container:
186-
image: rust:1.78
186+
image: rust:1.83.0
187187
options: --privileged
188188
# filter for a comment containing 'benchmarks please'
189189
if: ${{ github.event_name != 'issue_comment' || (github.event.issue.pull_request && contains(github.event.comment.body, 'benchmarks please')) }}

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ members = [
4444
"tools/upgrade-version",
4545
]
4646
default-members = ["crates/cli"]
47-
# cargo feature graph resolver. v2 is default in edition2021 but workspace
47+
# cargo feature graph resolver. v3 is default in edition2024 but workspace
4848
# manifests don't have editions.
49-
resolver = "2"
49+
resolver = "3"
5050

5151
[profile.release]
5252
opt-level = 3
@@ -88,7 +88,7 @@ debug = true
8888
version = "1.0.0-rc4"
8989
edition = "2021"
9090
# update rust-toolchain.toml too!
91-
rust-version = "1.78.0"
91+
rust-version = "1.84.0"
9292

9393
[workspace.dependencies]
9494
spacetimedb = { path = "crates/bindings", version = "1.0.0-rc4" }
@@ -194,7 +194,7 @@ pretty_assertions = { version = "1.4", features = ["unstable"] }
194194
proc-macro2 = "1.0"
195195
prometheus = "0.13.0"
196196
proptest = "1.4"
197-
proptest-derive = "0.4"
197+
proptest-derive = "0.5"
198198
quick-junit = { version = "0.3.2" }
199199
quote = "1.0.8"
200200
rand = "0.8.5"

crates/bench/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# See the README for commands to run.
44

55
# sync with: ../../rust-toolchain.toml
6-
FROM rust:1.77.0
6+
FROM rust:1.84.0
77

88
RUN apt-get update && \
99
apt-get install -y valgrind bash && \

crates/bindings-macro/src/table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl IndexArg {
193193
Ok(IndexArg { kind, name })
194194
}
195195

196-
fn validate<'a>(&'a self, table_name: &str, cols: &'a [Column<'a>]) -> syn::Result<ValidatedIndex<'_>> {
196+
fn validate<'a>(&'a self, table_name: &str, cols: &'a [Column<'a>]) -> syn::Result<ValidatedIndex<'a>> {
197197
let find_column = |ident| find_column(cols, ident);
198198
let kind = match &self.kind {
199199
IndexType::BTree { columns } => {

crates/bindings-sys/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ pub mod raw {
108108
/// - `prefix = prefix_ptr[..prefix_len]`,
109109
/// - `rstart = rstart_ptr[..rstart_len]`,
110110
/// - `rend = rend_ptr[..rend_len]`,
111+
///
111112
/// in WASM memory.
112113
///
113114
/// The index itself has a schema/type.
@@ -182,6 +183,7 @@ pub mod raw {
182183
/// - `prefix = prefix_ptr[..prefix_len]`,
183184
/// - `rstart = rstart_ptr[..rstart_len]`,
184185
/// - `rend = rend_ptr[..rend_len]`,
186+
///
185187
/// in WASM memory.
186188
///
187189
/// This syscall will delete all the rows found by

crates/bindings/src/logger.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern "C" fn __preinit__00_panic_hook() {
1111
}
1212

1313
/// Our own panic hook logging to the console.
14-
fn panic_hook(info: &panic::PanicInfo) {
14+
fn panic_hook(info: &panic::PanicHookInfo) {
1515
// Try to look into some string types we know (`&'static str` and `String`).
1616
let msg = match info.payload().downcast_ref::<&'static str>() {
1717
Some(s) => *s,

crates/bindings/src/rt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl<E: fmt::Display> IntoReducerResult for Result<(), E> {
100100

101101
#[diagnostic::on_unimplemented(
102102
message = "the first argument of a reducer must be `&ReducerContext`",
103-
note = "all reducers must take `&ReducerContext` as their first argument"
103+
label = "first argument must be `&ReducerContext`"
104104
)]
105105
pub trait ReducerContextArg {
106106
// a little hack used in the macro to make error messages nicer. it generates <T as ReducerContextArg>::_ITEM

crates/bindings/tests/ui/reducers.stderr

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,19 @@ error[E0277]: the reducer argument `Test` does not implement `SpacetimeType`
6464
--> tests/ui/reducers.rs:6:40
6565
|
6666
6 | fn bad_type(_ctx: &ReducerContext, _a: Test) {}
67-
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`, which is required by `Test: ReducerArg`
67+
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`
6868
|
6969
= note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition
70+
= help: the following other types implement trait `SpacetimeType`:
71+
&T
72+
()
73+
Address
74+
AddressForUrl
75+
AlgebraicTypeRef
76+
Arc<T>
77+
ArrayType
78+
Box<T>
79+
and $N others
7080
= note: required for `Test` to implement `ReducerArg`
7181

7282
error[E0277]: invalid reducer signature
@@ -119,8 +129,8 @@ error[E0277]: `Test` is not a valid reducer return type
119129
|
120130
= note: reducers cannot return values -- you can only return `()` or `Result<(), impl Display>`
121131
= help: the following other types implement trait `IntoReducerResult`:
122-
Result<(), E>
123132
()
133+
Result<(), E>
124134

125135
error[E0277]: invalid reducer signature
126136
--> tests/ui/reducers.rs:9:4
@@ -168,9 +178,9 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext`
168178
--> tests/ui/reducers.rs:23:20
169179
|
170180
23 | fn missing_ctx(_a: u8) {}
171-
| ^^ the trait `ReducerContextArg` is not implemented for `u8`
181+
| ^^ first argument must be `&ReducerContext`
172182
|
173-
= note: all reducers must take `&ReducerContext` as their first argument
183+
= help: the trait `ReducerContextArg` is not implemented for `u8`
174184
= help: the trait `ReducerContextArg` is implemented for `&ReducerContext`
175185

176186
error[E0277]: invalid reducer signature
@@ -219,13 +229,9 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext`
219229
--> tests/ui/reducers.rs:26:21
220230
|
221231
26 | fn ctx_by_val(_ctx: ReducerContext, _a: u8) {}
222-
| ^^^^^^^^^^^^^^
223-
| |
224-
| the trait `ReducerContextArg` is not implemented for `ReducerContext`
225-
| the trait `ReducerContextArg` is not implemented for `ReducerContext`
232+
| ^^^^^^^^^^^^^^ first argument must be `&ReducerContext`
226233
|
227-
= note: the trait bound `ReducerContext: ReducerContextArg` is not satisfied
228-
= note: all reducers must take `&ReducerContext` as their first argument
234+
= help: the trait `ReducerContextArg` is not implemented for `ReducerContext`
229235
= help: the trait `ReducerContextArg` is implemented for `&ReducerContext`
230236

231237
error[E0277]: invalid reducer signature

crates/bindings/tests/ui/tables.stderr

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,20 @@ error[E0277]: the column type `Test` does not implement `SpacetimeType`
1414
--> tests/ui/tables.rs:5:8
1515
|
1616
5 | x: Test,
17-
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`, which is required by `Test: TableColumn`
17+
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`
1818
|
1919
= note: table column types all must implement `SpacetimeType`
2020
= note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition
21+
= help: the following other types implement trait `SpacetimeType`:
22+
&T
23+
()
24+
Address
25+
AddressForUrl
26+
AlgebraicTypeRef
27+
Arc<T>
28+
ArrayType
29+
Box<T>
30+
and $N others
2131
= note: required for `Test` to implement `TableColumn`
2232

2333
error[E0277]: the trait bound `Test: SpacetimeType` is not satisfied
@@ -28,14 +38,14 @@ error[E0277]: the trait bound `Test: SpacetimeType` is not satisfied
2838
|
2939
= note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition
3040
= help: the following other types implement trait `SpacetimeType`:
31-
bool
32-
i8
33-
i16
34-
i32
35-
i64
36-
i128
37-
u8
38-
u16
41+
&T
42+
()
43+
Address
44+
AddressForUrl
45+
AlgebraicTypeRef
46+
Arc<T>
47+
ArrayType
48+
Box<T>
3949
and $N others
4050

4151
error[E0277]: the trait bound `Test: Deserialize<'de>` is not satisfied
@@ -48,14 +58,14 @@ error[E0277]: the trait bound `Test: Deserialize<'de>` is not satisfied
4858
| ^^^^ the trait `Deserialize<'de>` is not implemented for `Test`
4959
|
5060
= help: the following other types implement trait `Deserialize<'de>`:
51-
bool
52-
i8
53-
i16
54-
i32
55-
i64
56-
i128
57-
u8
58-
u16
61+
&'de [u8]
62+
&'de str
63+
()
64+
Address
65+
AddressForUrl
66+
AlgebraicTypeRef
67+
Arc<[T]>
68+
ArrayType
5969
and $N others
6070
note: required by a bound in `spacetimedb::spacetimedb_lib::de::SeqProductAccess::next_element`
6171
--> $WORKSPACE/crates/sats/src/de.rs
@@ -70,14 +80,14 @@ error[E0277]: the trait bound `Test: Deserialize<'_>` is not satisfied
7080
| ^^^^ the trait `Deserialize<'_>` is not implemented for `Test`
7181
|
7282
= help: the following other types implement trait `Deserialize<'de>`:
73-
bool
74-
i8
75-
i16
76-
i32
77-
i64
78-
i128
79-
u8
80-
u16
83+
&'de [u8]
84+
&'de str
85+
()
86+
Address
87+
AddressForUrl
88+
AlgebraicTypeRef
89+
Arc<[T]>
90+
ArrayType
8191
and $N others
8292
note: required by a bound in `get_field_value`
8393
--> $WORKSPACE/crates/sats/src/de.rs
@@ -92,14 +102,14 @@ error[E0277]: the trait bound `Test: Serialize` is not satisfied
92102
| ^^^^ the trait `Serialize` is not implemented for `Test`
93103
|
94104
= help: the following other types implement trait `Serialize`:
95-
bool
96-
i8
97-
i16
98-
i32
99-
i64
100-
i128
101-
u8
102-
u16
105+
&T
106+
()
107+
Address
108+
AddressForUrl
109+
AlgebraicTypeRef
110+
Arc<T>
111+
ArrayType
112+
ArrayValue
103113
and $N others
104114
note: required by a bound in `spacetimedb::spacetimedb_lib::ser::SerializeNamedProduct::serialize_element`
105115
--> $WORKSPACE/crates/sats/src/ser.rs

crates/cli/src/config.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn read_table<'a>(table: &'a toml_edit::Table, key: &'a str) -> Result<Option<&'
7070
Err(CliError::ConfigType {
7171
key: key.to_string(),
7272
kind: "table array",
73-
found: value.clone(),
73+
found: Box::new(value.clone()),
7474
})
7575
}
7676
} else {
@@ -86,7 +86,7 @@ fn read_opt_str(table: &toml_edit::Table, key: &str) -> Result<Option<String>, C
8686
Err(CliError::ConfigType {
8787
key: key.to_string(),
8888
kind: "string",
89-
found: value.clone(),
89+
found: Box::new(value.clone()),
9090
})
9191
}
9292
} else {
@@ -1000,23 +1000,23 @@ default_server = "local"
10001000
CliError::ConfigType {
10011001
key: "default_server".to_string(),
10021002
kind: "string",
1003-
found: toml_edit::value(1),
1003+
found: Box::new(toml_edit::value(1)),
10041004
},
10051005
)?;
10061006
check_invalid(
10071007
r#"web_session_token =1"#,
10081008
CliError::ConfigType {
10091009
key: "web_session_token".to_string(),
10101010
kind: "string",
1011-
found: toml_edit::value(1),
1011+
found: Box::new(toml_edit::value(1)),
10121012
},
10131013
)?;
10141014
check_invalid(
10151015
r#"spacetimedb_token =1"#,
10161016
CliError::ConfigType {
10171017
key: "spacetimedb_token".to_string(),
10181018
kind: "string",
1019-
found: toml_edit::value(1),
1019+
found: Box::new(toml_edit::value(1)),
10201020
},
10211021
)?;
10221022
check_invalid(
@@ -1026,7 +1026,7 @@ default_server = "local"
10261026
CliError::ConfigType {
10271027
key: "server_configs".to_string(),
10281028
kind: "table array",
1029-
found: toml_edit::table(),
1029+
found: Box::new(toml_edit::table()),
10301030
},
10311031
)?;
10321032
check_invalid(
@@ -1037,7 +1037,7 @@ nickname =1
10371037
CliError::ConfigType {
10381038
key: "nickname".to_string(),
10391039
kind: "string",
1040-
found: toml_edit::value(1),
1040+
found: Box::new(toml_edit::value(1)),
10411041
},
10421042
)?;
10431043
check_invalid(
@@ -1048,7 +1048,7 @@ host =1
10481048
CliError::ConfigType {
10491049
key: "host".to_string(),
10501050
kind: "string",
1051-
found: toml_edit::value(1),
1051+
found: Box::new(toml_edit::value(1)),
10521052
},
10531053
)?;
10541054

@@ -1061,7 +1061,7 @@ protocol =1
10611061
CliError::ConfigType {
10621062
key: "protocol".to_string(),
10631063
kind: "string",
1064-
found: toml_edit::value(1),
1064+
found: Box::new(toml_edit::value(1)),
10651065
},
10661066
)?;
10671067
Ok(())

crates/cli/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub enum CliError {
2626
ConfigType {
2727
key: String,
2828
kind: &'static str,
29-
found: toml_edit::Item,
29+
found: Box<toml_edit::Item>,
3030
},
3131
}
3232

crates/cli/src/subcommands/generate/rust.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ pub fn type_name(module: &ModuleDef, ty: &AlgebraicTypeUse) -> String {
621621
s
622622
}
623623

624-
const ALLOW_UNUSED: &str = "#![allow(unused)]";
624+
const ALLOW_LINTS: &str = "#![allow(unused, clippy::all)]";
625625

626626
const SPACETIMEDB_IMPORTS: &[&str] = &[
627627
"use spacetimedb_sdk::__codegen::{",
@@ -639,7 +639,7 @@ fn print_spacetimedb_imports(output: &mut Indenter) {
639639

640640
fn print_file_header(output: &mut Indenter) {
641641
print_auto_generated_file_comment(output);
642-
write!(output, "{ALLOW_UNUSED}");
642+
writeln!(output, "{ALLOW_LINTS}");
643643
print_spacetimedb_imports(output);
644644
}
645645

0 commit comments

Comments
 (0)