David Tolnay
28a092261b
Work around test suite dead code warnings in nightly-2024-07-07
...
warning: struct `Cows` is never constructed
--> test_suite/tests/test_borrow.rs:165:12
|
165 | struct Cows<'a, 'b> {
| ^^^^
warning: struct `Wrap` is never constructed
--> test_suite/tests/test_borrow.rs:181:12
|
181 | struct Wrap<'a, 'b> {
| ^^^^
warning: struct `StructSkipDefaultGeneric` is never constructed
--> test_suite/tests/test_de.rs:96:8
|
96 | struct StructSkipDefaultGeneric<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: struct `NonAsciiIdents` is never constructed
--> test_suite/tests/test_gen.rs:290:12
|
290 | struct NonAsciiIdents {
| ^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> test_suite/tests/test_gen.rs:5:9
|
5 | #![deny(warnings)]
| ^^^^^^^^
= note: `#[warn(dead_code)]` implied by `#[warn(warnings)]`
warning: struct `EmptyBraced` is never constructed
--> test_suite/tests/test_gen.rs:295:12
|
295 | struct EmptyBraced {}
| ^^^^^^^^^^^
warning: struct `EmptyBracedDenyUnknown` is never constructed
--> test_suite/tests/test_gen.rs:299:12
|
299 | struct EmptyBracedDenyUnknown {}
| ^^^^^^^^^^^^^^^^^^^^^^
warning: struct `BracedSkipAll` is never constructed
--> test_suite/tests/test_gen.rs:302:12
|
302 | struct BracedSkipAll {
| ^^^^^^^^^^^^^
warning: struct `BracedSkipAllDenyUnknown` is never constructed
--> test_suite/tests/test_gen.rs:309:12
|
309 | struct BracedSkipAllDenyUnknown {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: struct `EmptyTuple` is never constructed
--> test_suite/tests/test_gen.rs:315:12
|
315 | struct EmptyTuple();
| ^^^^^^^^^^
warning: struct `EmptyTupleDenyUnknown` is never constructed
--> test_suite/tests/test_gen.rs:319:12
|
319 | struct EmptyTupleDenyUnknown();
| ^^^^^^^^^^^^^^^^^^^^^
warning: struct `TupleSkipAll` is never constructed
--> test_suite/tests/test_gen.rs:322:12
|
322 | struct TupleSkipAll(#[serde(skip_deserializing)] u8);
| ^^^^^^^^^^^^
warning: struct `TupleSkipAllDenyUnknown` is never constructed
--> test_suite/tests/test_gen.rs:326:12
|
326 | struct TupleSkipAllDenyUnknown(#[serde(skip_deserializing)] u8);
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: enum `EmptyEnum` is never used
--> test_suite/tests/test_gen.rs:329:10
|
329 | enum EmptyEnum {}
| ^^^^^^^^^
warning: enum `EmptyEnumDenyUnknown` is never used
--> test_suite/tests/test_gen.rs:333:10
|
333 | enum EmptyEnumDenyUnknown {}
| ^^^^^^^^^^^^^^^^^^^^
warning: enum `EnumSkipAll` is never used
--> test_suite/tests/test_gen.rs:336:10
|
336 | enum EnumSkipAll {
| ^^^^^^^^^^^
warning: enum `EmptyVariants` is never used
--> test_suite/tests/test_gen.rs:343:10
|
343 | enum EmptyVariants {
| ^^^^^^^^^^^^^
warning: enum `EmptyVariantsDenyUnknown` is never used
--> test_suite/tests/test_gen.rs:355:10
|
355 | enum EmptyVariantsDenyUnknown {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: struct `UnitDenyUnknown` is never constructed
--> test_suite/tests/test_gen.rs:367:12
|
367 | struct UnitDenyUnknown;
| ^^^^^^^^^^^^^^^
warning: struct `EmptyArray` is never constructed
--> test_suite/tests/test_gen.rs:370:12
|
370 | struct EmptyArray {
| ^^^^^^^^^^
warning: enum `Or` is never used
--> test_suite/tests/test_gen.rs:374:10
|
374 | enum Or<A, B> {
| ^^
warning: enum `OrDef` is never used
--> test_suite/tests/test_gen.rs:381:10
|
381 | enum OrDef<A, B> {
| ^^^^^
warning: struct `Str` is never constructed
--> test_suite/tests/test_gen.rs:386:12
|
386 | struct Str<'a>(&'a str);
| ^^^
warning: struct `StrDef` is never constructed
--> test_suite/tests/test_gen.rs:390:12
|
390 | struct StrDef<'a>(&'a str);
| ^^^^^^
warning: struct `Remote` is never constructed
--> test_suite/tests/test_gen.rs:393:12
|
393 | struct Remote<'a> {
| ^^^^^^
warning: enum `BorrowVariant` is never used
--> test_suite/tests/test_gen.rs:401:10
|
401 | enum BorrowVariant<'a> {
| ^^^^^^^^^^^^^
warning: struct `RemoteVisibility` is never constructed
--> test_suite/tests/test_gen.rs:418:12
|
418 | struct RemoteVisibility {
| ^^^^^^^^^^^^^^^^
warning: struct `FlattenDenyUnknown` is never constructed
--> test_suite/tests/test_gen.rs:551:12
|
551 | struct FlattenDenyUnknown<T> {
| ^^^^^^^^^^^^^^^^^^
warning: struct `StaticStrStruct` is never constructed
--> test_suite/tests/test_gen.rs:557:12
|
557 | struct StaticStrStruct<'a> {
| ^^^^^^^^^^^^^^^
warning: struct `StaticStrTupleStruct` is never constructed
--> test_suite/tests/test_gen.rs:563:12
|
563 | struct StaticStrTupleStruct<'a>(&'a str, &'static str);
| ^^^^^^^^^^^^^^^^^^^^
warning: struct `StaticStrNewtypeStruct` is never constructed
--> test_suite/tests/test_gen.rs:566:12
|
566 | struct StaticStrNewtypeStruct(&'static str);
| ^^^^^^^^^^^^^^^^^^^^^^
warning: enum `StaticStrEnum` is never used
--> test_suite/tests/test_gen.rs:569:10
|
569 | enum StaticStrEnum<'a> {
| ^^^^^^^^^^^^^
warning: enum `AdjacentlyTaggedVoid` is never used
--> test_suite/tests/test_gen.rs:652:10
|
652 | enum AdjacentlyTaggedVoid {}
| ^^^^^^^^^^^^^^^^^^^^
warning: struct `ImplicitlyBorrowedOption` is never constructed
--> test_suite/tests/test_gen.rs:665:12
|
665 | struct ImplicitlyBorrowedOption<'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: enum `UntaggedNewtypeVariantWith` is never used
--> test_suite/tests/test_gen.rs:672:10
|
672 | enum UntaggedNewtypeVariantWith {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: struct `TransparentWith` is never constructed
--> test_suite/tests/test_gen.rs:682:12
|
682 | struct TransparentWith {
| ^^^^^^^^^^^^^^^
warning: struct `FlattenSkipSerializing` is never constructed
--> test_suite/tests/test_gen.rs:712:12
|
712 | struct FlattenSkipSerializing<T> {
| ^^^^^^^^^^^^^^^^^^^^^^
warning: struct `FlattenSkipSerializingIf` is never constructed
--> test_suite/tests/test_gen.rs:719:12
|
719 | struct FlattenSkipSerializingIf<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: struct `FlattenSkipDeserializing` is never constructed
--> test_suite/tests/test_gen.rs:725:12
|
725 | struct FlattenSkipDeserializing<T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: enum `Message` is never used
--> test_suite/tests/test_gen.rs:732:10
|
732 | enum Message {
| ^^^^^^^
warning: struct `MacroRules` is never constructed
--> test_suite/tests/test_gen.rs:751:20
|
751 | struct MacroRules<'a> {
| ^^^^^^^^^^
...
758 | deriving!(&'a str);
| ------------------ in this macro invocation
|
= note: this warning originates in the macro `deriving` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: struct `BorrowLifetimeInsideMacro` is never constructed
--> test_suite/tests/test_gen.rs:767:12
|
767 | struct BorrowLifetimeInsideMacro<'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: struct `GenericUnitStruct` is never constructed
--> test_suite/tests/test_gen.rs:782:12
|
782 | struct GenericUnitStruct<const N: usize>;
| ^^^^^^^^^^^^^^^^^
warning: enum `InternallyTagged` is never used
--> test_suite/tests/test_gen.rs:869:6
|
869 | enum InternallyTagged {
| ^^^^^^^^^^^^^^^^
warning: function `deserialize_generic` is never used
--> test_suite/tests/test_gen.rs:880:4
|
880 | fn deserialize_generic<'de, T, D>(deserializer: D) -> StdResult<T, D::Error>
| ^^^^^^^^^^^^^^^^^^^
warning: struct `Restricted` is never constructed
--> test_suite/tests/test_gen.rs:643:20
|
643 | struct Restricted {
| ^^^^^^^^^^
warning: struct `Test` is never constructed
--> test_suite/tests/test_remote.rs:95:8
|
95 | struct Test {
| ^^^^
warning: struct `UnitDef` is never constructed
--> test_suite/tests/test_remote.rs:135:8
|
135 | struct UnitDef;
| ^^^^^^^
warning: struct `PrimitivePubDef` is never constructed
--> test_suite/tests/test_remote.rs:143:8
|
143 | struct PrimitivePubDef(u8);
| ^^^^^^^^^^^^^^^
warning: struct `NewtypePubDef` is never constructed
--> test_suite/tests/test_remote.rs:151:8
|
151 | struct NewtypePubDef(#[serde(with = "UnitDef")] remote::Unit);
| ^^^^^^^^^^^^^
warning: struct `TuplePubDef` is never constructed
--> test_suite/tests/test_remote.rs:162:8
|
162 | struct TuplePubDef(u8, #[serde(with = "UnitDef")] remote::Unit);
| ^^^^^^^^^^^
warning: struct `StructPubDef` is never constructed
--> test_suite/tests/test_remote.rs:177:8
|
177 | struct StructPubDef {
| ^^^^^^^^^^^^
warning: struct `StructConcrete` is never constructed
--> test_suite/tests/test_remote.rs:193:8
|
193 | struct StructConcrete {
| ^^^^^^^^^^^^^^
warning: enum `EnumConcrete` is never used
--> test_suite/tests/test_remote.rs:199:6
|
199 | enum EnumConcrete {
| ^^^^^^^^^^^^
warning: enum `ErrorKind` is never used
--> test_suite/tests/test_remote.rs:204:6
|
204 | enum ErrorKind {
| ^^^^^^^^^
warning: enum `ErrorKindDef` is never used
--> test_suite/tests/test_remote.rs:214:6
|
214 | enum ErrorKindDef {
| ^^^^^^^^^^^^
warning: struct `PrimitivePub` is never constructed
--> test_suite/tests/test_remote.rs:10:16
|
10 | pub struct PrimitivePub(pub u8);
| ^^^^^^^^^^^^
warning: struct `NewtypePub` is never constructed
--> test_suite/tests/test_remote.rs:14:16
|
14 | pub struct NewtypePub(pub Unit);
| ^^^^^^^^^^
warning: struct `TuplePub` is never constructed
--> test_suite/tests/test_remote.rs:18:16
|
18 | pub struct TuplePub(pub u8, pub Unit);
| ^^^^^^^^
warning: struct `StructPub` is never constructed
--> test_suite/tests/test_remote.rs:25:16
|
25 | pub struct StructPub {
| ^^^^^^^^^
warning: enum `EnumGeneric` is never used
--> test_suite/tests/test_remote.rs:89:14
|
89 | pub enum EnumGeneric<T> {
| ^^^^^^^^^^^
warning: struct `Tuple` is never constructed
--> test_suite/tests/test_self.rs:44:12
|
44 | struct Tuple(
| ^^^^^
warning: associated items `ASSOC` and `assoc` are never used
--> test_suite/tests/test_self.rs:52:15
|
51 | impl Tuple {
| ---------- associated items in this implementation
52 | const ASSOC: usize = 1;
| ^^^^^
53 | const fn assoc() -> usize {
| ^^^^^
warning: enum `Enum` is never used
--> test_suite/tests/test_self.rs:63:10
|
63 | enum Enum {
| ^^^^
warning: associated items `ASSOC` and `assoc` are never used
--> test_suite/tests/test_self.rs:79:15
|
78 | impl Enum {
| --------- associated items in this implementation
79 | const ASSOC: usize = 1;
| ^^^^^
80 | const fn assoc() -> usize {
| ^^^^^
warning: struct `Unit` is never constructed
--> test_suite/no_std/src/main.rs:26:8
|
26 | struct Unit;
| ^^^^
warning: struct `Newtype` is never constructed
--> test_suite/no_std/src/main.rs:29:8
|
29 | struct Newtype(u8);
| ^^^^^^^
warning: struct `Tuple` is never constructed
--> test_suite/no_std/src/main.rs:32:8
|
32 | struct Tuple(u8, u8);
| ^^^^^
warning: struct `Struct` is never constructed
--> test_suite/no_std/src/main.rs:35:8
|
35 | struct Struct {
| ^^^^^^
warning: enum `Enum` is never used
--> test_suite/no_std/src/main.rs:40:6
|
40 | enum Enum {
| ^^^^
2024-07-06 19:26:29 -07:00
David Tolnay
891ced598a
Update test suite to nightly-2023-08-05
...
error: the feature `lang_items` is internal to the compiler or standard library
--> src/main.rs:1:12
|
1 | #![feature(lang_items, start)]
| ^^^^^^^^^^
|
= note: using it is strongly discouraged
= note: `#[deny(internal_features)]` on by default
2023-08-04 19:09:00 -07:00
David Tolnay
2ef1cd4b35
Import macros exclusively through serde_derive in test suite
...
This makes it easier to execute tests against the precompiled serde_derive.
2023-07-19 09:08:05 -07:00
David Tolnay
fa0312ac45
More formatting of doc tests and example code
2023-07-06 15:56:47 -07:00
David Tolnay
c9cc8a8924
Add authors to Cargo.toml
2022-07-31 19:25:47 -07:00
David Tolnay
c5ccb995ad
Update no_std test to 2018 edition
2018-12-31 21:42:22 -05:00
David Tolnay
58b3af4c29
Copyright/license headers
...
The following changes are included:
- Delete per-file license notices at the top of each file.
- Delete the first paragraph of LICENSE-MIT (an inaccurate
pseudo-copyright line), leaving only the text of the MIT license.
Nothing about the license of Serde code has changed, only our
understanding of how to correctly communicate that license has changed.
This mirrors an equivalent change being applied in the rust-lang/rust
repository.
2018-11-24 15:53:09 -08:00
David Tolnay
778e516270
Feature panic_handler has been stabilized
2018-10-06 21:12:14 -07:00
David Tolnay
480f858fc3
Update panic_handler attribute name changed in nightly
2018-09-03 08:24:27 -07:00
David Tolnay
a1280c672a
Switch no-std panic to #[panic_implementation]
2018-06-04 10:13:29 -07:00
David Tolnay
a740f76772
Update no-std panic signature for nightly-2018-06-03
2018-06-03 23:15:16 -07:00
David Tolnay
5efb22ebee
Format no_std test code with rustfmt 0.4.1
2018-04-07 19:22:24 -07:00
David Tolnay
3e535325e1
Remove unused compiler_builtins_lib feature
2018-04-07 19:20:55 -07:00
David Tolnay
5653e5b15c
Remove eh_unwind_resume lang item
...
It appears this is no longer needed.
2018-04-07 19:20:07 -07:00
David Tolnay
8d85860064
Remove no longer needed compiler_builtins
...
The `compiler_builtins` crate is now automatically injected whenever the
`core` crate is injected.
2018-04-07 19:18:38 -07:00
David Tolnay
30361ac6d0
Clean up workaround that required too many parentheses
...
The issue has been fixed in the compiler and these extra call site parentheses
are no longer required.
2018-03-09 00:22:27 -08:00
David Tolnay
1bdf5ecec4
Ignore unused_parens warning on the proc macro workaround
2018-01-21 17:54:06 -08:00
David Tolnay
6b4625dcbb
Ignore warning in no_std test
2018-01-13 14:43:34 -08:00
David Tolnay
e198afb0c1
Add missing copyright notices
2017-10-22 16:01:19 -07:00
David Tolnay
4f2e8d5dbb
Workaround for "no bin target named serde_derive_tests_no_std"
2017-07-21 00:05:30 -07:00
David Tolnay
775e8154e7
Fix libc dependency in no_std test
2017-07-09 10:19:19 -07:00
Alex Crichton
ce687431f3
Implement Serialize/Deserialize for OsStr/OsString
...
This commit implements the two serde traits for the libstd `OsStr` and
`OsString` types. This came up as a use case during implementing sccache where
we're basically just doing IPC to communicate paths around. Additionally the
`Path` and `PathBuf` implementations have been updated to delegate to the os
string ones.
These types are platform-specific, however, so the serialization/deserialization
isn't trivial. Currently this "fakes" a newtype variant for Unix/Windows to
prevent cross-platform serialization/deserialization. This means if you're doing
IPC within the same OS (e.g. Windows to Windows) then serialization should be
infallible. If you're doing IPC across platforms (e.g. Unix to Windows) then
using `OsString` is guaranteed to fail as bytes from one OS won't deserialize on
the other (even if they're unicode).
2017-03-27 11:44:50 -07:00
Oliver Schneider
368784949e
move to cargo clippy instead of using the clippy plugin ( #733 )
...
* move to cargo clippy instead of using the clippy plugin
fixes #729
* non-exectable scripts must be run with `sh`
* don't build serde in the clippy travis job
* only run clippy tests if installing clippy succeeds
* why is travis so picky?
* no more serde_codegen
* serde_test_suite_deps has no features
* don't use empty loops, llvm optimizes them to undefined behaviour
* abort the clippy job when clippy lints are triggered
* use caches on travis to speed up builds
* why are we even using `travis-cargo`?
* need to reinstall clippy frequently due to nightly updates
* command line tools are hard
2017-01-31 09:09:37 -08:00
David Tolnay
8fb554e593
Rename no_std tests to underscores
2017-01-25 20:50:23 -08:00