Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
c15f8ecd
Commit
c15f8ecd
authored
Dec 11, 2025
by
Benjamin Woodruff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix type bound on Default
parent
17719924
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
map.rs
turbopack/crates/turbo-frozenmap/src/map.rs
+8
-3
set.rs
turbopack/crates/turbo-frozenmap/src/set.rs
+8
-3
No files found.
turbopack/crates/turbo-frozenmap/src/map.rs
View file @
c15f8ecd
...
@@ -33,9 +33,7 @@ use serde::{Deserialize, Serialize};
...
@@ -33,9 +33,7 @@ use serde::{Deserialize, Serialize};
///
///
/// There are a variety of constructors provided that can be more efficient if you know that your
/// There are a variety of constructors provided that can be more efficient if you know that your
/// data is sorted and/or unique.
/// data is sorted and/or unique.
#[derive(
#[derive(Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Encode,
Decode,
Serialize,
Deserialize)]
Clone,
Default,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Encode,
Decode,
Serialize,
Deserialize,
)]
#[rustfmt
::
skip]
// rustfmt breaks bincode's proc macro string processing
#[rustfmt
::
skip]
// rustfmt breaks bincode's proc macro string processing
#[bincode(
#[bincode(
decode_bounds
=
"K: Decode<__Context> + 'static, V: Decode<__Context> + 'static"
,
decode_bounds
=
"K: Decode<__Context> + 'static, V: Decode<__Context> + 'static"
,
...
@@ -509,6 +507,13 @@ impl<K, V> FrozenMap<K, V> {
...
@@ -509,6 +507,13 @@ impl<K, V> FrozenMap<K, V> {
}
}
}
}
// Manual implementation because the derive would add unnecessary `K: Default, V: Default` bounds.
impl
<
K
,
V
>
Default
for
FrozenMap
<
K
,
V
>
{
fn
default
()
->
Self
{
Self
::
new
()
}
}
impl
<
K
:
Debug
,
V
:
Debug
>
Debug
for
FrozenMap
<
K
,
V
>
{
impl
<
K
:
Debug
,
V
:
Debug
>
Debug
for
FrozenMap
<
K
,
V
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
f
.debug_map
()
.entries
(
self
.iter
())
.finish
()
f
.debug_map
()
.entries
(
self
.iter
())
.finish
()
...
...
turbopack/crates/turbo-frozenmap/src/set.rs
View file @
c15f8ecd
...
@@ -38,9 +38,7 @@ use crate::map::{self, FrozenMap};
...
@@ -38,9 +38,7 @@ use crate::map::{self, FrozenMap};
/// [`Vec`] or boxed slice. Because of limitations of the internal representation and Rust's memory
/// [`Vec`] or boxed slice. Because of limitations of the internal representation and Rust's memory
/// layout rules, the most efficient way to convert from these data structures is via an
/// layout rules, the most efficient way to convert from these data structures is via an
/// [`Iterator`].
/// [`Iterator`].
#[derive(
#[derive(Clone,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Encode,
Decode,
Serialize,
Deserialize)]
Clone,
Default,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
Encode,
Decode,
Serialize,
Deserialize,
)]
#[bincode(
#[bincode(
decode_bounds
=
"T: Decode<__Context> + 'static"
,
decode_bounds
=
"T: Decode<__Context> + 'static"
,
borrow_decode_bounds
=
"T: BorrowDecode<'__de, __Context> + '__de"
borrow_decode_bounds
=
"T: BorrowDecode<'__de, __Context> + '__de"
...
@@ -308,6 +306,13 @@ impl<T> FrozenSet<T> {
...
@@ -308,6 +306,13 @@ impl<T> FrozenSet<T> {
}
}
}
}
// Manual implementation because the derive would add unnecessary `T: Default` bounds.
impl
<
T
>
Default
for
FrozenSet
<
T
>
{
fn
default
()
->
Self
{
Self
::
new
()
}
}
impl
<
T
:
Debug
>
Debug
for
FrozenSet
<
T
>
{
impl
<
T
:
Debug
>
Debug
for
FrozenSet
<
T
>
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
fn
fmt
(
&
self
,
f
:
&
mut
fmt
::
Formatter
<
'_
>
)
->
fmt
::
Result
{
f
.debug_set
()
.entries
(
self
.iter
())
.finish
()
f
.debug_set
()
.entries
(
self
.iter
())
.finish
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment