Skip to content

Instantly share code, notes, and snippets.

@Arzte
Created November 15, 2018 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arzte/05e2379b0b07e27f709bdf137d3da56f to your computer and use it in GitHub Desktop.
Save Arzte/05e2379b0b07e27f709bdf137d3da56f to your computer and use it in GitHub Desktop.
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> src\commands\owner.rs:44:19
|
44 | thread::spawn(move || -> Result<()> {
| ___________________^
45 | | if let Ok(mut message) = msg.channel_id.say("Now updating Arzte's Cute Bot, please wait....") {
46 | |
47 | | if let Ok(mut cmd_output) = msg.channel_id.say("**```\n \n```**") {
... |
91 | | Ok(())
92 | | });
| |_____^
|
note: first, the lifetime cannot outlive the anonymous lifetime #3 defined on the method body at 20:47...
--> src\commands\owner.rs:30:1
|
30 | / command!(update(ctx, msg, _args) {
31 | | msg.channel_id.broadcast_typing()?;
32 | |
33 | | let github_json: Github = reqwest::get("https://api.github.com/repos/Arzte/Arzte-bot/commits/master")?.json()?;
... |
92 | | });
93 | | });
| |___^
= note: ...so that the types are compatible:
expected &serenity::model::channel::Message
found &serenity::model::channel::Message
= note: but, the lifetime must be valid for the static lifetime...
note: ...so that the type `[closure@src\commands\owner.rs:44:19: 92:6 msg:&serenity::model::channel::Message, ctx:&mut serenity::prelude::Context]` will meet its required lifetime bounds
--> src\commands\owner.rs:44:5
|
44 | thread::spawn(move || -> Result<()> {
| ^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> src\commands\owner.rs:44:19
|
44 | thread::spawn(move || -> Result<()> {
| ___________________^
45 | | if let Ok(mut message) = msg.channel_id.say("Now updating Arzte's Cute Bot, please wait....") {
46 | |
47 | | if let Ok(mut cmd_output) = msg.channel_id.say("**```\n \n```**") {
... |
91 | | Ok(())
92 | | });
| |_____^
|
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 20:47...
--> src\commands\owner.rs:30:1
|
30 | / command!(update(ctx, msg, _args) {
31 | | msg.channel_id.broadcast_typing()?;
32 | |
33 | | let github_json: Github = reqwest::get("https://api.github.com/repos/Arzte/Arzte-bot/commits/master")?.json()?;
... |
92 | | });
93 | | });
| |___^
= note: ...so that the types are compatible:
expected &mut serenity::prelude::Context
found &mut serenity::prelude::Context
= note: but, the lifetime must be valid for the static lifetime...
note: ...so that the type `[closure@src\commands\owner.rs:44:19: 92:6 msg:&serenity::model::channel::Message, ctx:&mut serenity::prelude::Context]` will meet its required lifetime bounds
--> src\commands\owner.rs:44:5
|
44 | thread::spawn(move || -> Result<()> {
| ^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment