Skip to content
Permalink
Browse files

x.py fmt after previous deignore

  • Loading branch information
Mark-Simulacrum committed Dec 24, 2019
1 parent 48291a9 commit 6891388e661c2bbf965a330ff73bf8c08a7dbf7d
Showing with 9,637 additions and 9,795 deletions.
  1. +456 −267 src/libcore/iter/adapters/mod.rs
  2. +257 −145 src/libcore/iter/traits/iterator.rs
  3. +0 −2 src/libcore/tests/pattern.rs
  4. +401 −582 src/librustc/hir/lowering.rs
  5. +61 −55 src/librustc/infer/error_reporting/nice_region_error/outlives_closure.rs
  6. +71 −57 src/librustc/lint/mod.rs
  7. +233 −384 src/librustc/middle/resolve_lifetime.rs
  8. +232 −221 src/librustc/traits/mod.rs
  9. +70 −66 src/librustc/ty/constness.rs
  10. +435 −593 src/librustc/ty/context.rs
  11. +241 −239 src/librustc/ty/wf.rs
  12. +251 −242 src/librustc_codegen_llvm/back/write.rs
  13. +59 −73 src/librustc_codegen_llvm/consts.rs
  14. +713 −733 src/librustc_codegen_llvm/debuginfo/metadata.rs
  15. +143 −133 src/librustc_codegen_ssa/base.rs
  16. +85 −124 src/librustc_codegen_ssa/mir/place.rs
  17. +52 −74 src/librustc_codegen_utils/symbol_names/v0.rs
  18. +310 −291 src/librustc_errors/emitter.rs
  19. +125 −173 src/librustc_mir/borrow_check/diagnostics/mutability_errors.rs
  20. +289 −394 src/librustc_mir/borrow_check/type_check/mod.rs
  21. +25 −77 src/librustc_mir/build/expr/as_rvalue.rs
  22. +169 −281 src/librustc_mir/build/matches/mod.rs
  23. +244 −264 src/librustc_mir/build/mod.rs
  24. +117 −169 src/librustc_mir/const_eval.rs
  25. +126 −145 src/librustc_mir/interpret/place.rs
  26. +214 −231 src/librustc_mir/monomorphize/collector.rs
  27. +183 −110 src/librustc_passes/ast_validation.rs
  28. +501 −384 src/librustc_resolve/lib.rs
  29. +497 −414 src/librustc_resolve/resolve_imports.rs
  30. +591 −571 src/librustc_typeck/astconv.rs
  31. +76 −61 src/librustc_typeck/check/_match.rs
  32. +217 −235 src/librustc_typeck/check/coercion.rs
  33. +152 −177 src/librustc_typeck/check/method/confirm.rs
  34. +1,023 −1,024 src/librustc_typeck/check/mod.rs
  35. +191 −225 src/librustc_typeck/check/wfcheck.rs
  36. +162 −71 src/librustdoc/html/markdown/tests.rs
  37. +3 −5 src/libstd/sys/sgx/abi/mem.rs
  38. +181 −132 src/libstd/sys/unix/os.rs
  39. +10 −28 src/libsyntax_expand/parse/lexer/tests.rs
  40. +106 −89 src/libsyntax_expand/parse/tests.rs
  41. +205 −144 src/libsyntax_ext/test.rs
  42. +160 −110 src/tools/build-manifest/src/main.rs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -42,8 +42,6 @@ impl From<Option<(usize, usize)>> for Step {
}
}

// ignore-tidy-linelength

// FIXME(Manishearth) these tests focus on single-character searching (CharSearcher)
// and on next()/next_match(), not next_reject(). This is because
// the memchr changes make next_match() for single chars complex, but next_reject()

Large diffs are not rendered by default.

@@ -1,13 +1,13 @@
//! Error Reporting for Anonymous Region Lifetime Errors
//! where both the regions are anonymous.

use crate::hir::Node;
use crate::hir::{Expr, ExprKind::Closure};
use crate::infer::error_reporting::nice_region_error::NiceRegionError;
use crate::infer::lexical_region_resolve::RegionResolutionError::SubSupConflict;
use crate::infer::SubregionOrigin;
use crate::ty::RegionKind;
use crate::hir::{Expr, ExprKind::Closure};
use crate::hir::Node;
use crate::util::common::ErrorReported;
use crate::infer::lexical_region_resolve::RegionResolutionError::SubSupConflict;

impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
/// Print the error message for lifetime errors when binding escapes a closure.
@@ -36,69 +36,75 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
/// ...because it cannot outlive this closure
/// ```
pub(super) fn try_report_outlives_closure(&self) -> Option<ErrorReported> {
if let Some(SubSupConflict(_,
origin,
ref sub_origin,
_,
ref sup_origin,
sup_region)) = self.error {

if let Some(SubSupConflict(_, origin, ref sub_origin, _, ref sup_origin, sup_region)) =
self.error
{
// #45983: when trying to assign the contents of an argument to a binding outside of a
// closure, provide a specific message pointing this out.
if let (&SubregionOrigin::BindingTypeIsNotValidAtDecl(ref external_span),
&RegionKind::ReFree(ref free_region)) = (&sub_origin, sup_region) {
if let (
&SubregionOrigin::BindingTypeIsNotValidAtDecl(ref external_span),
&RegionKind::ReFree(ref free_region),
) = (&sub_origin, sup_region)
{
let hir = &self.tcx().hir();
if let Some(hir_id) = hir.as_local_hir_id(free_region.scope) {
if let Node::Expr(Expr {
kind: Closure(_, _, _, closure_span, None),
..
}) = hir.get(hir_id) {
if let Node::Expr(Expr { kind: Closure(_, _, _, closure_span, None), .. }) =
hir.get(hir_id)
{
let sup_sp = sup_origin.span();
let origin_sp = origin.span();
let mut err = self.tcx().sess.struct_span_err(
sup_sp,
"borrowed data cannot be stored outside of its closure");
"borrowed data cannot be stored outside of its closure",
);
err.span_label(sup_sp, "cannot be stored outside of its closure");
if origin_sp == sup_sp || origin_sp.contains(sup_sp) {
// // sup_sp == origin.span():
//
// let mut x = None;
// ----- borrowed data cannot be stored into here...
// with_int(|y| x = Some(y));
// --- ^ cannot be stored outside of its closure
// |
// ...because it cannot outlive this closure
//
// // origin.contains(&sup_sp):
//
// let mut f: Option<&u32> = None;
// ----- borrowed data cannot be stored into here...
// closure_expecting_bound(|x: &'x u32| {
// ------------ ... because it cannot outlive this closure
// f = Some(x);
// ^ cannot be stored outside of its closure
err.span_label(*external_span,
"borrowed data cannot be stored into here...");
err.span_label(*closure_span,
"...because it cannot outlive this closure");
// // sup_sp == origin.span():
//
// let mut x = None;
// ----- borrowed data cannot be stored into here...
// with_int(|y| x = Some(y));
// --- ^ cannot be stored outside of its closure
// |
// ...because it cannot outlive this closure
//
// // origin.contains(&sup_sp):
//
// let mut f: Option<&u32> = None;
// ----- borrowed data cannot be stored into here...
// closure_expecting_bound(|x: &'x u32| {
// ------------ ... because it cannot outlive this closure
// f = Some(x);
// ^ cannot be stored outside of its closure
err.span_label(
*external_span,
"borrowed data cannot be stored into here...",
);
err.span_label(
*closure_span,
"...because it cannot outlive this closure",
);
} else {
// FIXME: the wording for this case could be much improved
//
// let mut lines_to_use: Vec<&CrateId> = Vec::new();
// - cannot infer an appropriate lifetime...
// let push_id = |installed_id: &CrateId| {
// ------- ------------------------ borrowed data cannot outlive this closure
// |
// ...so that variable is valid at time of its declaration
// lines_to_use.push(installed_id);
// ^^^^^^^^^^^^ cannot be stored outside of its closure
err.span_label(origin_sp,
"cannot infer an appropriate lifetime...");
err.span_label(*external_span,
"...so that variable is valid at time of its \
declaration");
err.span_label(*closure_span,
"borrowed data cannot outlive this closure");
// FIXME: the wording for this case could be much improved
//
// let mut lines_to_use: Vec<&CrateId> = Vec::new();
// - cannot infer an appropriate lifetime...
// let push_id = |installed_id: &CrateId| {
// ------- ------------------------ borrowed data cannot outlive this closure
// |
// ...so that variable is valid at time of its declaration
// lines_to_use.push(installed_id);
// ^^^^^^^^^^^^ cannot be stored outside of its closure
err.span_label(origin_sp, "cannot infer an appropriate lifetime...");
err.span_label(
*external_span,
"...so that variable is valid at time of its \
declaration",
);
err.span_label(
*closure_span,
"borrowed data cannot outlive this closure",
);
}
err.emit();
return Some(ErrorReported);

0 comments on commit 6891388

Please sign in to comment.
You can’t perform that action at this time.