Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- struct Config<'a> { host: &'a str } fn takes_ownership<'a>(_: Config<'a>) {} fn foo() { let value = serde_json::Value::String("bar.example.".to_owned()); if let Some(string) = value.as_str() { let config = Config { host: string; }; takes_ownership(config); } }
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error: expected one of `!`, `,`, `.`, `::`, `?`, `{`, `}`, or an operator, found `;`
- --> src/main.rs:6:236
- |
- 6 | struct Config<'a> { host: &'a str } fn takes_ownership<'a>(_: Config<'a>) {} fn foo() { let value = serde_json::Value::String("bar.example.".to_owned()); if let Some(string) = value.as_str() { let config = Config { host: string; }; takes_ownership(config); } }
- | ------ ^ expected one of 8 possible tokens here
- | |
- | while parsing this struct
- error: aborting due to previous error
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement