Skip to content
Myr

Organize on_unimplemented ui test into directory

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent 723fcac · Browse files · 4 files+88 added−88 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+88 added−88 removed

  • tests:+88 added−88 removed

4 files+88 added−88 removed

added:test_suite/tests/ui/unimplemented/required_locally.rs+23 added
1use serde::de::Deserialize;2use serde::ser::Serialize;34fn to_string<T>(_: &T) -> String5where6 T: Serialize,7{8 unimplemented!()9}1011fn from_str<'de, T>(_: &'de str) -> T12where13 T: Deserialize<'de>,14{15 unimplemented!()16}1718struct MyStruct;1920fn main() {21 to_string(&MyStruct);22 let _: MyStruct = from_str("");23}
added:test_suite/tests/ui/unimplemented/required_locally.stderr+65 added
1error[E0277]: the trait bound `MyStruct: Serialize` is not satisfied2 --> tests/ui/unimplemented/required_locally.rs:21:153 |421 | to_string(&MyStruct);5 | --------- ^^^^^^^^^ unsatisfied trait bound6 | |7 | required by a bound introduced by this call8 |9help: the trait `Serialize` is not implemented for `MyStruct`10 --> tests/ui/unimplemented/required_locally.rs:18:111 |1218 | struct MyStruct;13 | ^^^^^^^^^^^^^^^14 = note: for local types consider adding `#[derive(serde::Serialize)]` to your `MyStruct` type15 = note: for types from other crates check whether the crate offers a `serde` feature flag16 = help: the following other types implement trait `Serialize`:17 &'a T18 &'a mut T19 ()20 (T,)21 (T0, T1)22 (T0, T1, T2)23 (T0, T1, T2, T3)24 (T0, T1, T2, T3, T4)25 and $N others26note: required by a bound in `to_string`27 --> tests/ui/unimplemented/required_locally.rs:6:828 |29 4 | fn to_string<T>(_: &T) -> String30 | --------- required by a bound in this function31 5 | where32 6 | T: Serialize,33 | ^^^^^^^^^ required by this bound in `to_string`3435error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied36 --> tests/ui/unimplemented/required_locally.rs:22:2337 |3822 | let _: MyStruct = from_str("");39 | ^^^^^^^^^^^^ unsatisfied trait bound40 |41help: the trait `Deserialize<'_>` is not implemented for `MyStruct`42 --> tests/ui/unimplemented/required_locally.rs:18:143 |4418 | struct MyStruct;45 | ^^^^^^^^^^^^^^^46 = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `MyStruct` type47 = note: for types from other crates check whether the crate offers a `serde` feature flag48 = help: the following other types implement trait `Deserialize<'de>`:49 &'a Path50 &'a [u8]51 &'a str52 ()53 (T,)54 (T0, T1)55 (T0, T1, T2)56 (T0, T1, T2, T3)57 and $N others58note: required by a bound in `from_str`59 --> tests/ui/unimplemented/required_locally.rs:13:860 |6111 | fn from_str<'de, T>(_: &'de str) -> T62 | -------- required by a bound in this function6312 | where6413 | T: Deserialize<'de>,65 | ^^^^^^^^^^^^^^^^ required by this bound in `from_str`
deleted:test_suite/tests/ui/on_unimplemented.rs-23 removed
1use serde::de::Deserialize;2use serde::ser::Serialize;34fn to_string<T>(_: &T) -> String5where6 T: Serialize,7{8 unimplemented!()9}1011fn from_str<'de, T>(_: &'de str) -> T12where13 T: Deserialize<'de>,14{15 unimplemented!()16}1718struct MyStruct;1920fn main() {21 to_string(&MyStruct);22 let _: MyStruct = from_str("");23}
deleted:test_suite/tests/ui/on_unimplemented.stderr-65 removed
1error[E0277]: the trait bound `MyStruct: Serialize` is not satisfied2 --> tests/ui/on_unimplemented.rs:21:153 |421 | to_string(&MyStruct);5 | --------- ^^^^^^^^^ unsatisfied trait bound6 | |7 | required by a bound introduced by this call8 |9help: the trait `Serialize` is not implemented for `MyStruct`10 --> tests/ui/on_unimplemented.rs:18:111 |1218 | struct MyStruct;13 | ^^^^^^^^^^^^^^^14 = note: for local types consider adding `#[derive(serde::Serialize)]` to your `MyStruct` type15 = note: for types from other crates check whether the crate offers a `serde` feature flag16 = help: the following other types implement trait `Serialize`:17 &'a T18 &'a mut T19 ()20 (T,)21 (T0, T1)22 (T0, T1, T2)23 (T0, T1, T2, T3)24 (T0, T1, T2, T3, T4)25 and $N others26note: required by a bound in `to_string`27 --> tests/ui/on_unimplemented.rs:6:828 |29 4 | fn to_string<T>(_: &T) -> String30 | --------- required by a bound in this function31 5 | where32 6 | T: Serialize,33 | ^^^^^^^^^ required by this bound in `to_string`3435error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied36 --> tests/ui/on_unimplemented.rs:22:2337 |3822 | let _: MyStruct = from_str("");39 | ^^^^^^^^^^^^ unsatisfied trait bound40 |41help: the trait `Deserialize<'_>` is not implemented for `MyStruct`42 --> tests/ui/on_unimplemented.rs:18:143 |4418 | struct MyStruct;45 | ^^^^^^^^^^^^^^^46 = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `MyStruct` type47 = note: for types from other crates check whether the crate offers a `serde` feature flag48 = help: the following other types implement trait `Deserialize<'de>`:49 &'a Path50 &'a [u8]51 &'a str52 ()53 (T,)54 (T0, T1)55 (T0, T1, T2)56 (T0, T1, T2, T3)57 and $N others58note: required by a bound in `from_str`59 --> tests/ui/on_unimplemented.rs:13:860 |6111 | fn from_str<'de, T>(_: &'de str) -> T62 | -------- required by a bound in this function6312 | where6413 | T: Deserialize<'de>,65 | ^^^^^^^^^^^^^^^^ required by this bound in `from_str`