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
Provenance
- Commit
3e1cf11- Tree
5f2eefb- Author
David Tolnay <dtolnay@gmail.com>- Committer
David Tolnay <dtolnay@gmail.com>- Parent
723fcac
4 files changed+88 added−88 removed
added:test_suite/tests/ui/unimplemented/required_locally.rs+23 added
1+use serde::de::Deserialize;2+use serde::ser::Serialize;3+4+fn to_string<T>(_: &T) -> String5+where6+ T: Serialize,7+{8+ unimplemented!()9+}10+11+fn from_str<'de, T>(_: &'de str) -> T12+where13+ T: Deserialize<'de>,14+{15+ unimplemented!()16+}17+18+struct MyStruct;19+20+fn main() {21+ to_string(&MyStruct);22+ let _: MyStruct = from_str("");23+}added:test_suite/tests/ui/unimplemented/required_locally.stderr+65 added
1+error[E0277]: the trait bound `MyStruct: Serialize` is not satisfied2+ --> tests/ui/unimplemented/required_locally.rs:21:153+ |4+21 | to_string(&MyStruct);5+ | --------- ^^^^^^^^^ unsatisfied trait bound6+ | |7+ | required by a bound introduced by this call8+ |9+help: the trait `Serialize` is not implemented for `MyStruct`10+ --> tests/ui/unimplemented/required_locally.rs:18:111+ |12+18 | 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 others26+note: 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`34+35+error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied36+ --> tests/ui/unimplemented/required_locally.rs:22:2337+ |38+22 | let _: MyStruct = from_str("");39+ | ^^^^^^^^^^^^ unsatisfied trait bound40+ |41+help: the trait `Deserialize<'_>` is not implemented for `MyStruct`42+ --> tests/ui/unimplemented/required_locally.rs:18:143+ |44+18 | 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 others58+note: required by a bound in `from_str`59+ --> tests/ui/unimplemented/required_locally.rs:13:860+ |61+11 | fn from_str<'de, T>(_: &'de str) -> T62+ | -------- required by a bound in this function63+12 | where64+13 | T: Deserialize<'de>,65+ | ^^^^^^^^^^^^^^^^ required by this bound in `from_str`deleted:test_suite/tests/ui/on_unimplemented.rs-23 removed
1-use serde::de::Deserialize;2-use serde::ser::Serialize;3-4-fn to_string<T>(_: &T) -> String5-where6- T: Serialize,7-{8- unimplemented!()9-}10-11-fn from_str<'de, T>(_: &'de str) -> T12-where13- T: Deserialize<'de>,14-{15- unimplemented!()16-}17-18-struct MyStruct;19-20-fn main() {21- to_string(&MyStruct);22- let _: MyStruct = from_str("");23-}deleted:test_suite/tests/ui/on_unimplemented.stderr-65 removed
1-error[E0277]: the trait bound `MyStruct: Serialize` is not satisfied2- --> tests/ui/on_unimplemented.rs:21:153- |4-21 | to_string(&MyStruct);5- | --------- ^^^^^^^^^ unsatisfied trait bound6- | |7- | required by a bound introduced by this call8- |9-help: the trait `Serialize` is not implemented for `MyStruct`10- --> tests/ui/on_unimplemented.rs:18:111- |12-18 | 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 others26-note: 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`34-35-error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied36- --> tests/ui/on_unimplemented.rs:22:2337- |38-22 | let _: MyStruct = from_str("");39- | ^^^^^^^^^^^^ unsatisfied trait bound40- |41-help: the trait `Deserialize<'_>` is not implemented for `MyStruct`42- --> tests/ui/on_unimplemented.rs:18:143- |44-18 | 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 others58-note: required by a bound in `from_str`59- --> tests/ui/on_unimplemented.rs:13:860- |61-11 | fn from_str<'de, T>(_: &'de str) -> T62- | -------- required by a bound in this function63-12 | where64-13 | T: Deserialize<'de>,65- | ^^^^^^^^^^^^^^^^ required by this bound in `from_str`