Skip to content

Commit

Permalink
Update AssociatedConstant example to refer to a const generic
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenesvk committed Oct 8, 2023
1 parent c0748bc commit e0ced16
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/rustdoc_schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -939,13 +939,13 @@ type AssociatedConstant implements Item {
```rust
const fn five() -> i32 { 5 };
struct Years(i32);
trait MyTrait<const MINT: usize> { // rustdocs default field
const MIN : usize = 16 ; // `"16"`
const MIN_SIZE: usize = MIN ; // `"MIN"`, referring to the other constant's name
const LOG_AS : &'static str = "batch" ; // `"\"batch\""`, including escaped quotes
const EXPR2_2 : i32 = 2+2 ; // `"_"`
const FN_FIVE : i32 = five() ; // `"_"`
const YEAR : Years = Years(42); // `"_"`
trait MyTrait<const MIN: usize> { // rustdocs default field
const NUM : i32 = 16 ; // 16
const MIN_SIZE: usize = MIN ; // "MIN", referring to the other constant's name
const LOG_AS : &'static str = "batch" ; // "\"batch\"", including escaped quotes
const EXPR2_2 : i32 = 2+2 ; // "_"
const FN_FIVE : i32 = five() ; // "_"
const YEAR : Years = Years(42); // "_"
}
```
Expand Down

0 comments on commit e0ced16

Please sign in to comment.