1
Fork 0

[review comments] modify test and clean up code

Co-Authored-By: estebank <esteban@kuber.com.ar>
This commit is contained in:
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer 2018-10-19 10:43:43 -07:00 committed by Esteban Küber
parent d0bd69a2d5
commit dd91c8fc5a
3 changed files with 5 additions and 8 deletions

View file

@ -2252,7 +2252,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
fn suggest_lifetime(&self, db: &mut DiagnosticBuilder<'_>, span: Span, msg: &str) -> bool {
match self.tcx.sess.source_map().span_to_snippet(span) {
Ok(ref snippet) => {
let (sugg, applicability) = if &snippet[..] == "&" {
let (sugg, applicability) = if snippet == "&" {
("&'static ".to_owned(), Applicability::MachineApplicable)
} else if snippet == "'_" {
("'static".to_owned(), Applicability::MachineApplicable)

View file

@ -8,3 +8,5 @@ use std::error::Error;
fn foo() -> impl Future<Item=(), Error=Box<Error>> {
Ok(())
}
fn main() {}

View file

@ -1,7 +1,3 @@
error[E0601]: `main` function not found in crate `lifetime_elision_return_type_trait`
|
= note: consider adding a `main` function to `$DIR/lifetime-elision-return-type-trait.rs`
error[E0106]: missing lifetime specifier
--> $DIR/lifetime-elision-return-type-trait.rs:8:44
|
@ -10,7 +6,6 @@ LL | fn foo() -> impl Future<Item=(), Error=Box<Error>> {
|
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
error: aborting due to 2 previous errors
error: aborting due to previous error
Some errors occurred: E0106, E0601.
For more information about an error, try `rustc --explain E0106`.
For more information about this error, try `rustc --explain E0106`.