]> git.lizzy.rs Git - rust.git/blob - tests/ui/string-box-error.rs
Rollup merge of #106605 - notriddle:notriddle/outdated-rustbook, r=GuillaumeGomez
[rust.git] / tests / ui / string-box-error.rs
1 // run-pass
2 // Ensure that both `Box<dyn Error + Send + Sync>` and `Box<dyn Error>` can be
3 // obtained from `String`.
4
5 use std::error::Error;
6
7 fn main() {
8     let _err1: Box<dyn Error + Send + Sync> = From::from("test".to_string());
9     let _err2: Box<dyn Error> = From::from("test".to_string());
10     let _err3: Box<dyn Error + Send + Sync + 'static> = From::from("test");
11     let _err4: Box<dyn Error> = From::from("test");
12 }