Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ digraph "GET / - 0" {
}

digraph "GET / - 1" {
0 [ label = "0| app_e22d4bbe::character() -> app_e22d4bbe::CharConst<'a'>"]
1 [ label = "1| app_e22d4bbe::boolean() -> app_e22d4bbe::BoolConst<true>"]
2 [ label = "2| app_e22d4bbe::numeric() -> app_e22d4bbe::NumericConst<8>"]
3 [ label = "3| app_e22d4bbe::handler(app_e22d4bbe::NumericConst<8>, app_e22d4bbe::BoolConst<true>, app_e22d4bbe::CharConst<'a'>) -> pavex::Response"]
4 [ label = "4| <pavex::Response as pavex::IntoResponse>::into_response(pavex::Response) -> pavex::Response"]
0 -> 3 [ ]
1 -> 3 [ ]
2 -> 3 [ ]
0 [ label = "0| app_e22d4bbe::sized_array() -> app_e22d4bbe::SizedArray<4>"]
1 [ label = "1| app_e22d4bbe::character() -> app_e22d4bbe::CharConst<'a'>"]
2 [ label = "2| app_e22d4bbe::boolean() -> app_e22d4bbe::BoolConst<true>"]
3 [ label = "3| app_e22d4bbe::numeric() -> app_e22d4bbe::NumericConst<8>"]
4 [ label = "4| app_e22d4bbe::handler(app_e22d4bbe::NumericConst<8>, app_e22d4bbe::BoolConst<true>, app_e22d4bbe::CharConst<'a'>, app_e22d4bbe::SizedArray<4>) -> pavex::Response"]
5 [ label = "5| <pavex::Response as pavex::IntoResponse>::into_response(pavex::Response) -> pavex::Response"]
0 -> 4 [ ]
1 -> 4 [ ]
2 -> 4 [ ]
3 -> 4 [ ]
4 -> 5 [ ]
}

digraph app_state {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ pub mod route_1 {
<pavex::Response as pavex::IntoResponse>::into_response(v2)
}
async fn handler() -> pavex::Response {
let v0 = app::character();
let v1 = app::boolean();
let v2 = app::numeric();
let v3 = app::handler(v2, v1, v0);
<pavex::Response as pavex::IntoResponse>::into_response(v3)
let v0 = app::sized_array();
let v1 = app::character();
let v2 = app::boolean();
let v3 = app::numeric();
let v4 = app::handler(v3, v2, v1, v0);
<pavex::Response as pavex::IntoResponse>::into_response(v4)
}
struct Next0<T>
where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ digraph "GET / - 0" {
2 -> 3 [ ]
}
digraph "GET / - 1" {
0 [ label = "0| app::character() -> app::CharConst<'a'>"]
1 [ label = "1| app::boolean() -> app::BoolConst<true>"]
2 [ label = "2| app::numeric() -> app::NumericConst<8>"]
3 [ label = "3| app::handler(app::NumericConst<8>, app::BoolConst<true>, app::CharConst<'a'>) -> pavex::Response"]
4 [ label = "4| <pavex::Response as pavex::IntoResponse>::into_response(pavex::Response) -> pavex::Response"]
0 -> 3 [ ]
1 -> 3 [ ]
2 -> 3 [ ]
0 [ label = "0| app::sized_array() -> app::SizedArray<4>"]
1 [ label = "1| app::character() -> app::CharConst<'a'>"]
2 [ label = "2| app::boolean() -> app::BoolConst<true>"]
3 [ label = "3| app::numeric() -> app::NumericConst<8>"]
4 [ label = "4| app::handler(app::NumericConst<8>, app::BoolConst<true>, app::CharConst<'a'>, app::SizedArray<4>) -> pavex::Response"]
5 [ label = "5| <pavex::Response as pavex::IntoResponse>::into_response(pavex::Response) -> pavex::Response"]
0 -> 4 [ ]
1 -> 4 [ ]
2 -> 4 [ ]
3 -> 4 [ ]
4 -> 5 [ ]
}
digraph app_state {
0 [ label = "0| crate::ApplicationState() -> crate::ApplicationState"]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "application_e22d4bbe"
version = "0.1.0"
edition = "2021"

[package.metadata.px.generate]
generator_type = "cargo_workspace_binary"
generator_name = "app_e22d4bbe"
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ pub mod route_1 {
<pavex::Response as pavex::IntoResponse>::into_response(v2)
}
async fn handler() -> pavex::Response {
let v0 = app_e22d4bbe::character();
let v1 = app_e22d4bbe::boolean();
let v2 = app_e22d4bbe::numeric();
let v3 = app_e22d4bbe::handler(v2, v1, v0);
<pavex::Response as pavex::IntoResponse>::into_response(v3)
let v0 = app_e22d4bbe::sized_array();
let v1 = app_e22d4bbe::character();
let v2 = app_e22d4bbe::boolean();
let v3 = app_e22d4bbe::numeric();
let v4 = app_e22d4bbe::handler(v3, v2, v1, v0);
<pavex::Response as pavex::IntoResponse>::into_response(v4)
}
struct Next0<T>
where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use pavex::{blueprint::from, Blueprint};
pub struct NumericConst<const N: usize>;
pub struct BoolConst<const B: bool>;
pub struct CharConst<const C: char>;
pub struct SizedArray<const N: usize>(pub [u8; N]);

#[pavex::request_scoped]
pub fn numeric() -> NumericConst<8> {
Expand All @@ -19,11 +20,17 @@ pub fn character() -> CharConst<'a'> {
CharConst
}

#[pavex::request_scoped]
pub fn sized_array() -> SizedArray<4> {
SizedArray([0; 4])
}

#[pavex::get(path = "/")]
pub fn handler(
_n: NumericConst<8>,
_b: BoolConst<true>,
_c: CharConst<'a'>,
_s: SizedArray<4>,
) -> pavex::Response {
todo!()
}
Expand Down
7 changes: 6 additions & 1 deletion rustdoc/rustdoc_resolver/src/resolve_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,12 @@ fn _resolve_type<I: CrateIndexer>(
}))
}
RustdocType::Array { type_, len } => {
let len: usize = len.parse().map_err(|_| {
let resolved_len = generic_bindings
.consts
.get(len)
.map(|s| s.as_str())
.unwrap_or(len);
let len: usize = resolved_len.parse().map_err(|_| {
TypeResolutionErrorDetails::UnsupportedArrayLength(UnsupportedArrayLength {
len: len.clone(),
})
Expand Down
Loading