mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-18 18:11:19 +00:00
40 lines
724 B
Rust
40 lines
724 B
Rust
#![allow(deprecated)]
|
|
|
|
mod util;
|
|
use schemars::JsonSchema;
|
|
use util::*;
|
|
|
|
#[allow(dead_code)]
|
|
#[derive(JsonSchema)]
|
|
#[deprecated]
|
|
struct DeprecatedStruct {
|
|
foo: i32,
|
|
#[deprecated]
|
|
deprecated_field: bool,
|
|
}
|
|
|
|
#[test]
|
|
fn deprecated_struct() -> TestResult {
|
|
test_default_generated_schema::<DeprecatedStruct>("deprecated-struct")
|
|
}
|
|
|
|
#[allow(dead_code)]
|
|
#[derive(JsonSchema)]
|
|
#[deprecated]
|
|
enum DeprecatedEnum {
|
|
Unit,
|
|
#[deprecated]
|
|
DeprecatedUnitVariant,
|
|
#[deprecated]
|
|
DeprecatedStructVariant {
|
|
foo: i32,
|
|
#[deprecated]
|
|
deprecated_field: bool,
|
|
},
|
|
}
|
|
|
|
#[test]
|
|
fn deprecated_enum() -> TestResult {
|
|
test_default_generated_schema::<DeprecatedEnum>("deprecated-enum")
|
|
}
|