Skip to content

Commit ee62ea2

Browse files
committed
insta
1 parent c2f9ae7 commit ee62ea2

4 files changed

Lines changed: 72 additions & 1350 deletions

File tree

crates/bindings/tests/ui/views.stderr

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@ error: views must be `public`, e.g. `#[view(public)]`
22
--> tests/ui/views.rs:76:1
33
|
44
76 | #[view(accessor = view_def_no_public)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: this error originates in the attribute macro `view` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
error: `public` already specified
10-
--> tests/ui/views.rs:82:44
10+
--> tests/ui/views.rs:82:48
1111
|
1212
82 | #[view(accessor = view_def_dup_public, public, public)]
13-
| ^^^^^^
13+
| ^^^^^^
1414

15-
error: `name` already specified
16-
--> tests/ui/views.rs:88:34
15+
error: expected string literal
16+
--> tests/ui/views.rs:88:45
1717
|
1818
88 | #[view(accessor = view_def_dup_name, name = view_def_dup_name, public)]
19-
| ^^^^
19+
| ^^^^^^^^^^^^^^^^^
2020

21-
error: expected `name` or `public`
22-
--> tests/ui/views.rs:94:49
21+
error: expected one of: `name`, `public`, `accessor`
22+
--> tests/ui/views.rs:94:53
2323
|
2424
94 | #[view(accessor = view_def_unsupported_arg, public, anonymous)]
25-
| ^^^^^^^^^
25+
| ^^^^^^^^^
2626

2727
error: Views must always have a context parameter: `&ViewContext` or `&AnonymousViewContext`
2828
--> tests/ui/views.rs:101:1
@@ -81,7 +81,7 @@ error[E0277]: the trait bound `ViewKind<ReducerContext>: ViewKindTrait` is not s
8181
--> tests/ui/views.rs:106:1
8282
|
8383
106 | #[view(accessor = view_def_wrong_context, public)]
84-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `ViewKindTrait` is not implemented for `ViewKind<ReducerContext>`
84+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `ViewKindTrait` is not implemented for `ViewKind<ReducerContext>`
8585
|
8686
help: the following other types implement trait `ViewKindTrait`
8787
--> src/rt.rs
@@ -97,7 +97,7 @@ error[E0276]: impl has stricter requirements than trait
9797
--> tests/ui/views.rs:106:1
9898
|
9999
106 | #[view(accessor = view_def_wrong_context, public)]
100-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `ViewKind<ReducerContext>: ViewKindTrait`
100+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `ViewKind<ReducerContext>: ViewKindTrait`
101101
|
102102
= note: this error originates in the attribute macro `view` (in Nightly builds, run with -Z macro-backtrace for more info)
103103

@@ -199,7 +199,7 @@ error[E0599]: no function or associated item named `register` found for struct `
199199
--> tests/ui/views.rs:106:1
200200
|
201201
106 | #[view(accessor = view_def_wrong_context, public)]
202-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `ViewRegistrar<ReducerContext>`
202+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `ViewRegistrar<ReducerContext>`
203203
|
204204
= note: the function or associated item was found for
205205
- `ViewRegistrar<AnonymousViewContext>`
@@ -224,7 +224,7 @@ error[E0599]: no function or associated item named `invoke` found for struct `Vi
224224
--> tests/ui/views.rs:106:1
225225
|
226226
106 | #[view(accessor = view_def_wrong_context, public)]
227-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `ViewDispatcher<ReducerContext>`
227+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `ViewDispatcher<ReducerContext>`
228228
|
229229
= note: the function or associated item was found for
230230
- `ViewDispatcher<AnonymousViewContext>`
@@ -235,7 +235,7 @@ error[E0277]: invalid view signature
235235
--> tests/ui/views.rs:128:1
236236
|
237237
128 | #[view(accessor = view_def_wrong_return, public)]
238-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this view signature is not valid
238+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this view signature is not valid
239239
|
240240
= help: the trait `spacetimedb::rt::View<'_, _, _>` is not implemented for fn item `for<'a> fn(&'a ViewContext) -> Player {view_def_wrong_return}`
241241
= note:
@@ -280,7 +280,7 @@ error[E0277]: invalid view signature
280280
--> tests/ui/views.rs:128:1
281281
|
282282
128 | #[view(accessor = view_def_wrong_return, public)]
283-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this view signature is not valid
283+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this view signature is not valid
284284
|
285285
= help: the trait `spacetimedb::rt::View<'_, _, _>` is not implemented for fn item `for<'a> fn(&'a ViewContext) -> Player {view_def_wrong_return}`
286286
= note:
@@ -302,7 +302,7 @@ error[E0277]: invalid anonymous view signature
302302
--> tests/ui/views.rs:136:1
303303
|
304304
136 | #[view(accessor = view_def_returns_not_a_spacetime_type, public)]
305-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this view signature is not valid
305+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this view signature is not valid
306306
|
307307
= help: the trait `AnonymousView<'_, _, _>` is not implemented for fn item `for<'a> fn(&'a AnonymousViewContext) -> Option<NotSpacetimeType> {view_def_returns_not_a_spacetime_type}`
308308
= note:
@@ -371,7 +371,7 @@ error[E0277]: invalid anonymous view signature
371371
--> tests/ui/views.rs:136:1
372372
|
373373
136 | #[view(accessor = view_def_returns_not_a_spacetime_type, public)]
374-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this view signature is not valid
374+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this view signature is not valid
375375
|
376376
= help: the trait `AnonymousView<'_, _, _>` is not implemented for fn item `for<'a> fn(&'a AnonymousViewContext) -> Option<NotSpacetimeType> {view_def_returns_not_a_spacetime_type}`
377377
= note:

crates/codegen/tests/snapshots/codegen__codegen_csharp.snap

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,11 +1031,11 @@ namespace SpacetimeDB
10311031
{
10321032
[DataMember(Name = "arg")]
10331033
public TestA Arg;
1034-
[DataMember(Name = "arg2")]
1034+
[DataMember(Name = "arg_2")]
10351035
public TestB Arg2;
1036-
[DataMember(Name = "arg3")]
1036+
[DataMember(Name = "arg_3")]
10371037
public NamespaceTestC Arg3;
1038-
[DataMember(Name = "arg4")]
1038+
[DataMember(Name = "arg_4")]
10391039
public NamespaceTestF Arg4;
10401040

10411041
public Test(
@@ -1923,38 +1923,38 @@ namespace SpacetimeDB
19231923
{
19241924
protected override string RemoteTableName => "logged_out_player";
19251925

1926-
public sealed class IdentityUniqueIndex : UniqueIndexBase<SpacetimeDB.Identity>
1926+
public sealed class LoggedOutPlayerIdentityIdxBtreeUniqueIndex : UniqueIndexBase<SpacetimeDB.Identity>
19271927
{
19281928
protected override SpacetimeDB.Identity GetKey(Player row) => row.Identity;
19291929

1930-
public IdentityUniqueIndex(LoggedOutPlayerHandle table) : base(table) { }
1930+
public LoggedOutPlayerIdentityIdxBtreeUniqueIndex(LoggedOutPlayerHandle table) : base(table) { }
19311931
}
19321932

1933-
public readonly IdentityUniqueIndex Identity;
1933+
public readonly LoggedOutPlayerIdentityIdxBtreeUniqueIndex LoggedOutPlayerIdentityIdxBtree;
19341934

1935-
public sealed class NameUniqueIndex : UniqueIndexBase<string>
1935+
public sealed class LoggedOutPlayerNameIdxBtreeUniqueIndex : UniqueIndexBase<string>
19361936
{
19371937
protected override string GetKey(Player row) => row.Name;
19381938

1939-
public NameUniqueIndex(LoggedOutPlayerHandle table) : base(table) { }
1939+
public LoggedOutPlayerNameIdxBtreeUniqueIndex(LoggedOutPlayerHandle table) : base(table) { }
19401940
}
19411941

1942-
public readonly NameUniqueIndex Name;
1942+
public readonly LoggedOutPlayerNameIdxBtreeUniqueIndex LoggedOutPlayerNameIdxBtree;
19431943

1944-
public sealed class PlayerIdUniqueIndex : UniqueIndexBase<ulong>
1944+
public sealed class LoggedOutPlayerPlayerIdIdxBtreeUniqueIndex : UniqueIndexBase<ulong>
19451945
{
19461946
protected override ulong GetKey(Player row) => row.PlayerId;
19471947

1948-
public PlayerIdUniqueIndex(LoggedOutPlayerHandle table) : base(table) { }
1948+
public LoggedOutPlayerPlayerIdIdxBtreeUniqueIndex(LoggedOutPlayerHandle table) : base(table) { }
19491949
}
19501950

1951-
public readonly PlayerIdUniqueIndex PlayerId;
1951+
public readonly LoggedOutPlayerPlayerIdIdxBtreeUniqueIndex LoggedOutPlayerPlayerIdIdxBtree;
19521952

19531953
internal LoggedOutPlayerHandle(DbConnection conn) : base(conn)
19541954
{
1955-
Identity = new(this);
1956-
Name = new(this);
1957-
PlayerId = new(this);
1955+
LoggedOutPlayerIdentityIdxBtree = new(this);
1956+
LoggedOutPlayerNameIdxBtree = new(this);
1957+
LoggedOutPlayerPlayerIdIdxBtree = new(this);
19581958
}
19591959

19601960
protected override object GetPrimaryKey(Player row) => row.Identity;
@@ -2072,19 +2072,19 @@ namespace SpacetimeDB
20722072

20732073
public readonly AgeIndex Age;
20742074

2075-
public sealed class IdUniqueIndex : UniqueIndexBase<uint>
2075+
public sealed class PersonIdIdxBtreeUniqueIndex : UniqueIndexBase<uint>
20762076
{
20772077
protected override uint GetKey(Person row) => row.Id;
20782078

2079-
public IdUniqueIndex(PersonHandle table) : base(table) { }
2079+
public PersonIdIdxBtreeUniqueIndex(PersonHandle table) : base(table) { }
20802080
}
20812081

2082-
public readonly IdUniqueIndex Id;
2082+
public readonly PersonIdIdxBtreeUniqueIndex PersonIdIdxBtree;
20832083

20842084
internal PersonHandle(DbConnection conn) : base(conn)
20852085
{
20862086
Age = new(this);
2087-
Id = new(this);
2087+
PersonIdIdxBtree = new(this);
20882088
}
20892089

20902090
protected override object GetPrimaryKey(Person row) => row.Id;
@@ -2140,28 +2140,28 @@ namespace SpacetimeDB
21402140
{
21412141
protected override string RemoteTableName => "pk_multi_identity";
21422142

2143-
public sealed class IdUniqueIndex : UniqueIndexBase<uint>
2143+
public sealed class PkMultiIdentityIdIdxBtreeUniqueIndex : UniqueIndexBase<uint>
21442144
{
21452145
protected override uint GetKey(PkMultiIdentity row) => row.Id;
21462146

2147-
public IdUniqueIndex(PkMultiIdentityHandle table) : base(table) { }
2147+
public PkMultiIdentityIdIdxBtreeUniqueIndex(PkMultiIdentityHandle table) : base(table) { }
21482148
}
21492149

2150-
public readonly IdUniqueIndex Id;
2150+
public readonly PkMultiIdentityIdIdxBtreeUniqueIndex PkMultiIdentityIdIdxBtree;
21512151

2152-
public sealed class OtherUniqueIndex : UniqueIndexBase<uint>
2152+
public sealed class PkMultiIdentityOtherIdxBtreeUniqueIndex : UniqueIndexBase<uint>
21532153
{
21542154
protected override uint GetKey(PkMultiIdentity row) => row.Other;
21552155

2156-
public OtherUniqueIndex(PkMultiIdentityHandle table) : base(table) { }
2156+
public PkMultiIdentityOtherIdxBtreeUniqueIndex(PkMultiIdentityHandle table) : base(table) { }
21572157
}
21582158

2159-
public readonly OtherUniqueIndex Other;
2159+
public readonly PkMultiIdentityOtherIdxBtreeUniqueIndex PkMultiIdentityOtherIdxBtree;
21602160

21612161
internal PkMultiIdentityHandle(DbConnection conn) : base(conn)
21622162
{
2163-
Id = new(this);
2164-
Other = new(this);
2163+
PkMultiIdentityIdIdxBtree = new(this);
2164+
PkMultiIdentityOtherIdxBtree = new(this);
21652165
}
21662166

21672167
protected override object GetPrimaryKey(PkMultiIdentity row) => row.Id;
@@ -2215,38 +2215,38 @@ namespace SpacetimeDB
22152215
{
22162216
protected override string RemoteTableName => "player";
22172217

2218-
public sealed class IdentityUniqueIndex : UniqueIndexBase<SpacetimeDB.Identity>
2218+
public sealed class PlayerIdentityIdxBtreeUniqueIndex : UniqueIndexBase<SpacetimeDB.Identity>
22192219
{
22202220
protected override SpacetimeDB.Identity GetKey(Player row) => row.Identity;
22212221

2222-
public IdentityUniqueIndex(PlayerHandle table) : base(table) { }
2222+
public PlayerIdentityIdxBtreeUniqueIndex(PlayerHandle table) : base(table) { }
22232223
}
22242224

2225-
public readonly IdentityUniqueIndex Identity;
2225+
public readonly PlayerIdentityIdxBtreeUniqueIndex PlayerIdentityIdxBtree;
22262226

2227-
public sealed class NameUniqueIndex : UniqueIndexBase<string>
2227+
public sealed class PlayerNameIdxBtreeUniqueIndex : UniqueIndexBase<string>
22282228
{
22292229
protected override string GetKey(Player row) => row.Name;
22302230

2231-
public NameUniqueIndex(PlayerHandle table) : base(table) { }
2231+
public PlayerNameIdxBtreeUniqueIndex(PlayerHandle table) : base(table) { }
22322232
}
22332233

2234-
public readonly NameUniqueIndex Name;
2234+
public readonly PlayerNameIdxBtreeUniqueIndex PlayerNameIdxBtree;
22352235

2236-
public sealed class PlayerIdUniqueIndex : UniqueIndexBase<ulong>
2236+
public sealed class PlayerPlayerIdIdxBtreeUniqueIndex : UniqueIndexBase<ulong>
22372237
{
22382238
protected override ulong GetKey(Player row) => row.PlayerId;
22392239

2240-
public PlayerIdUniqueIndex(PlayerHandle table) : base(table) { }
2240+
public PlayerPlayerIdIdxBtreeUniqueIndex(PlayerHandle table) : base(table) { }
22412241
}
22422242

2243-
public readonly PlayerIdUniqueIndex PlayerId;
2243+
public readonly PlayerPlayerIdIdxBtreeUniqueIndex PlayerPlayerIdIdxBtree;
22442244

22452245
internal PlayerHandle(DbConnection conn) : base(conn)
22462246
{
2247-
Identity = new(this);
2248-
Name = new(this);
2249-
PlayerId = new(this);
2247+
PlayerIdentityIdxBtree = new(this);
2248+
PlayerNameIdxBtree = new(this);
2249+
PlayerPlayerIdIdxBtree = new(this);
22502250
}
22512251

22522252
protected override object GetPrimaryKey(Player row) => row.Identity;
@@ -2414,18 +2414,18 @@ namespace SpacetimeDB
24142414
{
24152415
protected override string RemoteTableName => "repeating_test_arg";
24162416

2417-
public sealed class ScheduledIdUniqueIndex : UniqueIndexBase<ulong>
2417+
public sealed class RepeatingTestArgScheduledIdIdxBtreeUniqueIndex : UniqueIndexBase<ulong>
24182418
{
24192419
protected override ulong GetKey(RepeatingTestArg row) => row.ScheduledId;
24202420

2421-
public ScheduledIdUniqueIndex(RepeatingTestArgHandle table) : base(table) { }
2421+
public RepeatingTestArgScheduledIdIdxBtreeUniqueIndex(RepeatingTestArgHandle table) : base(table) { }
24222422
}
24232423

2424-
public readonly ScheduledIdUniqueIndex ScheduledId;
2424+
public readonly RepeatingTestArgScheduledIdIdxBtreeUniqueIndex RepeatingTestArgScheduledIdIdxBtree;
24252425

24262426
internal RepeatingTestArgHandle(DbConnection conn) : base(conn)
24272427
{
2428-
ScheduledId = new(this);
2428+
RepeatingTestArgScheduledIdIdxBtree = new(this);
24292429
}
24302430

24312431
protected override object GetPrimaryKey(RepeatingTestArg row) => row.ScheduledId;
@@ -2636,28 +2636,28 @@ namespace SpacetimeDB
26362636
{
26372637
protected override string RemoteTableName => "test_e";
26382638

2639-
public sealed class IdUniqueIndex : UniqueIndexBase<ulong>
2639+
public sealed class TestEIdIdxBtreeUniqueIndex : UniqueIndexBase<ulong>
26402640
{
26412641
protected override ulong GetKey(TestE row) => row.Id;
26422642

2643-
public IdUniqueIndex(TestEHandle table) : base(table) { }
2643+
public TestEIdIdxBtreeUniqueIndex(TestEHandle table) : base(table) { }
26442644
}
26452645

2646-
public readonly IdUniqueIndex Id;
2646+
public readonly TestEIdIdxBtreeUniqueIndex TestEIdIdxBtree;
26472647

2648-
public sealed class NameIndex : BTreeIndexBase<string>
2648+
public sealed class TestENameIdxBtreeIndex : BTreeIndexBase<string>
26492649
{
26502650
protected override string GetKey(TestE row) => row.Name;
26512651

2652-
public NameIndex(TestEHandle table) : base(table) { }
2652+
public TestENameIdxBtreeIndex(TestEHandle table) : base(table) { }
26532653
}
26542654

2655-
public readonly NameIndex Name;
2655+
public readonly TestENameIdxBtreeIndex TestENameIdxBtree;
26562656

26572657
internal TestEHandle(DbConnection conn) : base(conn)
26582658
{
2659-
Id = new(this);
2660-
Name = new(this);
2659+
TestEIdIdxBtree = new(this);
2660+
TestENameIdxBtree = new(this);
26612661
}
26622662

26632663
protected override object GetPrimaryKey(TestE row) => row.Id;

0 commit comments

Comments
 (0)