]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #53607 - GuillaumeGomez:rollup, r=GuillaumeGomez
authorbors <bors@rust-lang.org>
Wed, 22 Aug 2018 19:59:52 +0000 (19:59 +0000)
committerbors <bors@rust-lang.org>
Wed, 22 Aug 2018 19:59:52 +0000 (19:59 +0000)
Rollup of 10 pull requests

Successful merges:

 - #53418 (Mark some suggestions as MachineApplicable)
 - #53431 (Moved some feature gate ui tests to correct location)
 - #53442 (Update version of rls-data used with save-analysis)
 - #53504 (Set applicability for more suggestions.)
 - #53541 (Fix missing impl trait display as ret type)
 - #53544 (Point at the trait argument when using unboxed closure)
 - #53558 (Normalize source line and column numbers.)
 - #53562 (Lament the invincibility of the Turbofish)
 - #53574 (Suggest direct raw-pointer dereference)
 - #53585 (Remove super old comment on function that parses items)

Failed merges:

 - #53472 (Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.)
 - #53563 (use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into())

r? @ghost

1  2 
src/librustc_borrowck/borrowck/gather_loans/move_error.rs
src/librustc_mir/borrow_check/mod.rs
src/librustc_typeck/check/callee.rs
src/librustc_typeck/check/demand.rs
src/librustc_typeck/check/method/suggest.rs
src/librustc_typeck/check/mod.rs
src/librustdoc/clean/mod.rs

Simple merge
Simple merge
index 7dc57c710bf26f34e0841f7bbfc34bc11b89ff32,9ca8686eb226f40b352f3c0146d596a37402d1a4..b0b2799c793b28957ff3a4b9c7fca6daceb9e86c
@@@ -542,65 -578,80 +578,80 @@@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, '
                      }
                      true
                  }
 -                (&ty::TyFloat(ref exp), &ty::TyFloat(ref found)) => {
 +                (&ty::Float(ref exp), &ty::Float(ref found)) => {
                      if found.bit_width() < exp.bit_width() {
-                         err.span_suggestion(expr.span,
-                                             &format!("{} in a lossless way",
-                                                      msg),
-                                             into_suggestion);
+                         err.span_suggestion_with_applicability(
+                             expr.span,
+                             &format!("{} in a lossless way", msg),
+                             into_suggestion,
+                             Applicability::MachineApplicable
+                         );
                      } else if can_cast {
-                         err.span_suggestion(expr.span,
-                                             &format!("{}, producing the closest possible value",
-                                                      msg),
-                                             cast_suggestion);
+                         err.span_suggestion_with_applicability(
+                             expr.span,
+                             &format!("{}, producing the closest possible value", msg),
+                             cast_suggestion,
+                             Applicability::MaybeIncorrect  // lossy conversion
+                         );
                      }
                      true
                  }
 -                (&ty::TyUint(_), &ty::TyFloat(_)) | (&ty::TyInt(_), &ty::TyFloat(_)) => {
 +                (&ty::Uint(_), &ty::Float(_)) | (&ty::Int(_), &ty::Float(_)) => {
                      if can_cast {
-                         err.span_suggestion(expr.span,
-                                             &format!("{}, rounding the float towards zero",
-                                                      msg),
-                                             cast_suggestion);
+                         err.span_suggestion_with_applicability(
+                             expr.span,
+                             &format!("{}, rounding the float towards zero", msg),
+                             cast_suggestion,
+                             Applicability::MaybeIncorrect  // lossy conversion
+                         );
                          err.warn("casting here will cause undefined behavior if the rounded value \
                                    cannot be represented by the target integer type, including \
                                    `Inf` and `NaN` (this is a bug and will be fixed)");
                      }
                      true
                  }
 -                (&ty::TyFloat(ref exp), &ty::TyUint(ref found)) => {
 +                (&ty::Float(ref exp), &ty::Uint(ref found)) => {
                      // if `found` is `None` (meaning found is `usize`), don't suggest `.into()`
                      if exp.bit_width() > found.bit_width().unwrap_or(256) {
-                         err.span_suggestion(expr.span,
-                                             &format!("{}, producing the floating point \
-                                                       representation of the integer",
-                                                       msg),
-                                             into_suggestion);
+                         err.span_suggestion_with_applicability(
+                             expr.span,
+                             &format!("{}, producing the floating point representation of the \
+                                       integer",
+                                       msg),
+                             into_suggestion,
+                             Applicability::MachineApplicable
+                         );
                      } else if can_cast {
-                         err.span_suggestion(expr.span,
-                                             &format!("{}, producing the floating point \
-                                                       representation of the integer, rounded if \
-                                                       necessary",
-                                                       msg),
-                                             cast_suggestion);
+                         err.span_suggestion_with_applicability(expr.span,
+                             &format!("{}, producing the floating point representation of the \
+                                       integer, rounded if necessary",
+                                       msg),
+                             cast_suggestion,
+                             Applicability::MaybeIncorrect  // lossy conversion
+                         );
                      }
                      true
                  }
 -                (&ty::TyFloat(ref exp), &ty::TyInt(ref found)) => {
 +                (&ty::Float(ref exp), &ty::Int(ref found)) => {
                      // if `found` is `None` (meaning found is `isize`), don't suggest `.into()`
                      if exp.bit_width() > found.bit_width().unwrap_or(256) {
-                         err.span_suggestion(expr.span,
-                                             &format!("{}, producing the floating point \
-                                                       representation of the integer",
-                                                       msg),
-                                             into_suggestion);
+                         err.span_suggestion_with_applicability(
+                             expr.span,
+                             &format!("{}, producing the floating point representation of the \
+                                       integer",
+                                       msg),
+                             into_suggestion,
+                             Applicability::MachineApplicable
+                         );
                      } else if can_cast {
-                         err.span_suggestion(expr.span,
-                                             &format!("{}, producing the floating point \
-                                                       representation of the integer, rounded if \
-                                                       necessary",
-                                                       msg),
-                                             cast_suggestion);
+                         err.span_suggestion_with_applicability(
+                             expr.span,
+                             &format!("{}, producing the floating point representation of the \
+                                       integer, rounded if necessary",
+                                       msg),
+                             cast_suggestion,
+                             Applicability::MaybeIncorrect  // lossy conversion
+                         );
                      }
                      true
                  }
Simple merge
Simple merge