1
Fork 0

Shorten span for closures.

This commit is contained in:
Camille GILLOT 2022-06-27 07:45:35 +02:00
parent e78e747f53
commit 8cc87250ef
167 changed files with 877 additions and 1306 deletions

View file

@ -861,7 +861,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
let arg_pos = args let arg_pos = args
.iter() .iter()
.enumerate() .enumerate()
.filter(|(_, arg)| arg.span == self.body.span) .filter(|(_, arg)| arg.hir_id == closure_id)
.map(|(pos, _)| pos) .map(|(pos, _)| pos)
.next(); .next();
let def_id = hir.local_def_id(item_id); let def_id = hir.local_def_id(item_id);

View file

@ -1020,6 +1020,7 @@ impl<'hir> Map<'hir> {
_ => named_span(item.span, item.ident, None), _ => named_span(item.span, item.ident, None),
}, },
Node::Ctor(_) => return self.opt_span(self.get_parent_node(hir_id)), Node::Ctor(_) => return self.opt_span(self.get_parent_node(hir_id)),
Node::Expr(Expr { kind: ExprKind::Closure { fn_decl_span, .. }, .. }) => *fn_decl_span,
_ => self.span_with_body(hir_id), _ => self.span_with_body(hir_id),
}; };
Some(span) Some(span)

View file

@ -747,10 +747,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let (migration_string, migrated_variables_concat) = let (migration_string, migrated_variables_concat) =
migration_suggestion_for_2229(self.tcx, &need_migrations); migration_suggestion_for_2229(self.tcx, &need_migrations);
let local_def_id = closure_def_id.expect_local(); let closure_hir_id =
let closure_hir_id = self.tcx.hir().local_def_id_to_hir_id(local_def_id); self.tcx.hir().local_def_id_to_hir_id(closure_def_id.expect_local());
let closure_span = self.tcx.hir().span(closure_hir_id); let closure_head_span = self.tcx.def_span(closure_def_id);
let closure_head_span = self.tcx.sess.source_map().guess_head_span(closure_span);
self.tcx.struct_span_lint_hir( self.tcx.struct_span_lint_hir(
lint::builtin::RUST_2021_INCOMPATIBLE_CLOSURE_CAPTURES, lint::builtin::RUST_2021_INCOMPATIBLE_CLOSURE_CAPTURES,
closure_hir_id, closure_hir_id,
@ -827,12 +826,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
migrated_variables_concat migrated_variables_concat
); );
let closure_span = self.tcx.hir().span_with_body(closure_hir_id);
let mut closure_body_span = { let mut closure_body_span = {
// If the body was entirely expanded from a macro // If the body was entirely expanded from a macro
// invocation, i.e. the body is not contained inside the // invocation, i.e. the body is not contained inside the
// closure span, then we walk up the expansion until we // closure span, then we walk up the expansion until we
// find the span before the expansion. // find the span before the expansion.
let s = self.tcx.hir().span(body_id.hir_id); let s = self.tcx.hir().span_with_body(body_id.hir_id);
s.find_ancestor_inside(closure_span).unwrap_or(s) s.find_ancestor_inside(closure_span).unwrap_or(s)
}; };

View file

@ -14,22 +14,22 @@
}, },
} */ } */
fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 13:6]) -> () { fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 10:17]) -> () {
let mut _0: (); // return place in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 let mut _0: (); // return place in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
let mut _2: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 let mut _2: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
let _3: std::string::String; // in scope 0 at $DIR/generator-drop-cleanup.rs:11:13: 11:15 let _3: std::string::String; // in scope 0 at $DIR/generator-drop-cleanup.rs:11:13: 11:15
let _4: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:12:9: 12:14 let _4: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:12:9: 12:14
let mut _5: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:12:9: 12:14 let mut _5: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:12:9: 12:14
let mut _6: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:10:18: 10:18 let mut _6: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:10:18: 10:18
let mut _7: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 let mut _7: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
let mut _8: u32; // in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 let mut _8: u32; // in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
scope 1 { scope 1 {
debug _s => (((*_1) as variant#3).0: std::string::String); // in scope 1 at $DIR/generator-drop-cleanup.rs:11:13: 11:15 debug _s => (((*_1) as variant#3).0: std::string::String); // in scope 1 at $DIR/generator-drop-cleanup.rs:11:13: 11:15
} }
bb0: { bb0: {
_8 = discriminant((*_1)); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 _8 = discriminant((*_1)); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
switchInt(move _8) -> [0_u32: bb7, 3_u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 switchInt(move _8) -> [0_u32: bb7, 3_u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
} }
bb1: { bb1: {
@ -44,11 +44,11 @@ fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 1
} }
bb3: { bb3: {
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
} }
bb4 (cleanup): { bb4 (cleanup): {
resume; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 resume; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
} }
bb5 (cleanup): { bb5 (cleanup): {
@ -57,11 +57,11 @@ fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 1
} }
bb6: { bb6: {
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
} }
bb7: { bb7: {
goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
} }
bb8: { bb8: {
@ -69,16 +69,16 @@ fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 1
} }
bb9: { bb9: {
goto -> bb6; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 goto -> bb6; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
} }
bb10: { bb10: {
StorageLive(_4); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 StorageLive(_4); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
StorageLive(_5); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 StorageLive(_5); // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
} }
bb11: { bb11: {
return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6 return; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 10:17
} }
} }

View file

@ -1,6 +1,6 @@
// MIR for `main::{closure#0}` before StateTransform // MIR for `main::{closure#0}` before StateTransform
fn main::{closure#0}(_1: [generator@$DIR/generator-storage-dead-unwind.rs:22:16: 28:6], _2: ()) -> () fn main::{closure#0}(_1: [generator@$DIR/generator-storage-dead-unwind.rs:22:16: 22:18], _2: ()) -> ()
yields () yields ()
{ {
let mut _0: (); // return place in scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 22:19 let mut _0: (); // return place in scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 22:19
@ -66,7 +66,7 @@ yields ()
} }
bb4: { bb4: {
return; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:6: 28:6 return; // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:18: 22:18
} }
bb5: { bb5: {
@ -82,7 +82,7 @@ yields ()
} }
bb7: { bb7: {
generator_drop; // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6 generator_drop; // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 22:18
} }
bb8 (cleanup): { bb8 (cleanup): {
@ -104,7 +104,7 @@ yields ()
} }
bb11 (cleanup): { bb11 (cleanup): {
resume; // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6 resume; // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 22:18
} }
bb12 (cleanup): { bb12 (cleanup): {

View file

@ -14,31 +14,31 @@
}, },
} */ } */
fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator-tiny.rs:19:16: 25:6]>, _2: u8) -> GeneratorState<(), ()> { fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator-tiny.rs:19:16: 19:24]>, _2: u8) -> GeneratorState<(), ()> {
debug _x => _10; // in scope 0 at $DIR/generator-tiny.rs:19:17: 19:19 debug _x => _10; // in scope 0 at $DIR/generator-tiny.rs:19:17: 19:19
let mut _0: std::ops::GeneratorState<(), ()>; // return place in scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 let mut _0: std::ops::GeneratorState<(), ()>; // return place in scope 0 at $DIR/generator-tiny.rs:19:16: 19:24
let _3: HasDrop; // in scope 0 at $DIR/generator-tiny.rs:20:13: 20:15 let _3: HasDrop; // in scope 0 at $DIR/generator-tiny.rs:20:13: 20:15
let mut _4: !; // in scope 0 at $DIR/generator-tiny.rs:21:9: 24:10 let mut _4: !; // in scope 0 at $DIR/generator-tiny.rs:21:9: 24:10
let mut _5: (); // in scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 let mut _5: (); // in scope 0 at $DIR/generator-tiny.rs:19:16: 19:24
let _6: u8; // in scope 0 at $DIR/generator-tiny.rs:22:13: 22:18 let _6: u8; // in scope 0 at $DIR/generator-tiny.rs:22:13: 22:18
let mut _7: (); // in scope 0 at $DIR/generator-tiny.rs:22:13: 22:18 let mut _7: (); // in scope 0 at $DIR/generator-tiny.rs:22:13: 22:18
let _8: (); // in scope 0 at $DIR/generator-tiny.rs:23:13: 23:21 let _8: (); // in scope 0 at $DIR/generator-tiny.rs:23:13: 23:21
let mut _9: (); // in scope 0 at $DIR/generator-tiny.rs:19:25: 19:25 let mut _9: (); // in scope 0 at $DIR/generator-tiny.rs:19:25: 19:25
let _10: u8; // in scope 0 at $DIR/generator-tiny.rs:19:17: 19:19 let _10: u8; // in scope 0 at $DIR/generator-tiny.rs:19:17: 19:19
let mut _11: u32; // in scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 let mut _11: u32; // in scope 0 at $DIR/generator-tiny.rs:19:16: 19:24
scope 1 { scope 1 {
debug _d => (((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 25:6])) as variant#3).0: HasDrop); // in scope 1 at $DIR/generator-tiny.rs:20:13: 20:15 debug _d => (((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop); // in scope 1 at $DIR/generator-tiny.rs:20:13: 20:15
} }
bb0: { bb0: {
_11 = discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 25:6]))); // scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 _11 = discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24]))); // scope 0 at $DIR/generator-tiny.rs:19:16: 19:24
switchInt(move _11) -> [0_u32: bb1, 3_u32: bb5, otherwise: bb6]; // scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 switchInt(move _11) -> [0_u32: bb1, 3_u32: bb5, otherwise: bb6]; // scope 0 at $DIR/generator-tiny.rs:19:16: 19:24
} }
bb1: { bb1: {
_10 = move _2; // scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 _10 = move _2; // scope 0 at $DIR/generator-tiny.rs:19:16: 19:24
nop; // scope 0 at $DIR/generator-tiny.rs:20:13: 20:15 nop; // scope 0 at $DIR/generator-tiny.rs:20:13: 20:15
Deinit((((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 25:6])) as variant#3).0: HasDrop)); // scope 0 at $DIR/generator-tiny.rs:20:18: 20:25 Deinit((((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop)); // scope 0 at $DIR/generator-tiny.rs:20:18: 20:25
StorageLive(_4); // scope 1 at $DIR/generator-tiny.rs:21:9: 24:10 StorageLive(_4); // scope 1 at $DIR/generator-tiny.rs:21:9: 24:10
goto -> bb2; // scope 1 at $DIR/generator-tiny.rs:21:9: 24:10 goto -> bb2; // scope 1 at $DIR/generator-tiny.rs:21:9: 24:10
} }
@ -50,7 +50,7 @@ fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator-tiny.rs:19:16: 25:6]
Deinit(_0); // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18 Deinit(_0); // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
((_0 as Yielded).0: ()) = move _7; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18 ((_0 as Yielded).0: ()) = move _7; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
discriminant(_0) = 0; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18 discriminant(_0) = 0; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 25:6]))) = 3; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18 discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24]))) = 3; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
return; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18 return; // scope 1 at $DIR/generator-tiny.rs:22:13: 22:18
} }
@ -71,14 +71,14 @@ fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator-tiny.rs:19:16: 25:6]
} }
bb5: { bb5: {
StorageLive(_4); // scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 StorageLive(_4); // scope 0 at $DIR/generator-tiny.rs:19:16: 19:24
StorageLive(_6); // scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 StorageLive(_6); // scope 0 at $DIR/generator-tiny.rs:19:16: 19:24
StorageLive(_7); // scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 StorageLive(_7); // scope 0 at $DIR/generator-tiny.rs:19:16: 19:24
_6 = move _2; // scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 _6 = move _2; // scope 0 at $DIR/generator-tiny.rs:19:16: 19:24
goto -> bb3; // scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 goto -> bb3; // scope 0 at $DIR/generator-tiny.rs:19:16: 19:24
} }
bb6: { bb6: {
unreachable; // scope 0 at $DIR/generator-tiny.rs:19:16: 25:6 unreachable; // scope 0 at $DIR/generator-tiny.rs:19:16: 19:24
} }
} }

View file

@ -19,8 +19,8 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
debug t => (*((*_6).1: &T)); // in scope 2 at $DIR/inline-closure-captures.rs:10:17: 10:18 debug t => (*((*_6).1: &T)); // in scope 2 at $DIR/inline-closure-captures.rs:10:17: 10:18
let mut _10: i32; // in scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20 let mut _10: i32; // in scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20
let mut _11: T; // in scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23 let mut _11: T; // in scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23
let mut _12: &i32; // in scope 2 at $DIR/inline-closure-captures.rs:11:13: 11:24 let mut _12: &i32; // in scope 2 at $DIR/inline-closure-captures.rs:11:13: 11:17
let mut _13: &T; // in scope 2 at $DIR/inline-closure-captures.rs:11:13: 11:24 let mut _13: &T; // in scope 2 at $DIR/inline-closure-captures.rs:11:13: 11:17
} }
} }
@ -33,8 +33,8 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
Deinit(_3); // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 Deinit(_3); // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
(_3.0: &i32) = move _4; // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 (_3.0: &i32) = move _4; // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
(_3.1: &T) = move _5; // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24 (_3.1: &T) = move _5; // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
StorageDead(_5); // scope 0 at $DIR/inline-closure-captures.rs:11:23: 11:24 StorageDead(_5); // scope 0 at $DIR/inline-closure-captures.rs:11:16: 11:17
StorageDead(_4); // scope 0 at $DIR/inline-closure-captures.rs:11:23: 11:24 StorageDead(_4); // scope 0 at $DIR/inline-closure-captures.rs:11:16: 11:17
StorageLive(_6); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6 StorageLive(_6); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6
_6 = &_3; // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6 _6 = &_3; // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6
StorageLive(_7); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9 StorageLive(_7); // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9

View file

@ -4,22 +4,22 @@
fn main() -> () { fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/inline-generator.rs:8:11: 8:11 let mut _0: (); // return place in scope 0 at $DIR/inline-generator.rs:8:11: 8:11
let _1: std::ops::GeneratorState<i32, bool>; // in scope 0 at $DIR/inline-generator.rs:9:9: 9:11 let _1: std::ops::GeneratorState<i32, bool>; // in scope 0 at $DIR/inline-generator.rs:9:9: 9:11
let mut _2: std::pin::Pin<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>; // in scope 0 at $DIR/inline-generator.rs:9:14: 9:32 let mut _2: std::pin::Pin<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>; // in scope 0 at $DIR/inline-generator.rs:9:14: 9:32
let mut _3: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 0 at $DIR/inline-generator.rs:9:23: 9:31 let mut _3: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 0 at $DIR/inline-generator.rs:9:23: 9:31
let mut _4: [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 0 at $DIR/inline-generator.rs:9:28: 9:31 let mut _4: [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 0 at $DIR/inline-generator.rs:9:28: 9:31
+ let mut _7: bool; // in scope 0 at $DIR/inline-generator.rs:9:14: 9:46 + let mut _7: bool; // in scope 0 at $DIR/inline-generator.rs:9:14: 9:46
scope 1 { scope 1 {
debug _r => _1; // in scope 1 at $DIR/inline-generator.rs:9:9: 9:11 debug _r => _1; // in scope 1 at $DIR/inline-generator.rs:9:9: 9:11
} }
+ scope 2 (inlined g) { // at $DIR/inline-generator.rs:9:28: 9:31 + scope 2 (inlined g) { // at $DIR/inline-generator.rs:9:28: 9:31
+ } + }
+ scope 3 (inlined Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>::new) { // at $DIR/inline-generator.rs:9:14: 9:32 + scope 3 (inlined Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>::new) { // at $DIR/inline-generator.rs:9:14: 9:32
+ debug pointer => _3; // in scope 3 at $SRC_DIR/core/src/pin.rs:LL:COL + debug pointer => _3; // in scope 3 at $SRC_DIR/core/src/pin.rs:LL:COL
+ let mut _5: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 3 at $SRC_DIR/core/src/pin.rs:LL:COL + let mut _5: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 3 at $SRC_DIR/core/src/pin.rs:LL:COL
+ scope 4 { + scope 4 {
+ scope 5 (inlined Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>::new_unchecked) { // at $SRC_DIR/core/src/pin.rs:LL:COL + scope 5 (inlined Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>::new_unchecked) { // at $SRC_DIR/core/src/pin.rs:LL:COL
+ debug pointer => _5; // in scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL + debug pointer => _5; // in scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
+ let mut _6: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL + let mut _6: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
+ } + }
+ } + }
+ } + }
@ -29,10 +29,10 @@
+ let mut _9: bool; // in scope 6 at $DIR/inline-generator.rs:15:20: 15:21 + let mut _9: bool; // in scope 6 at $DIR/inline-generator.rs:15:20: 15:21
+ let mut _10: bool; // in scope 6 at $DIR/inline-generator.rs:15:9: 15:9 + let mut _10: bool; // in scope 6 at $DIR/inline-generator.rs:15:9: 15:9
+ let _11: bool; // in scope 6 at $DIR/inline-generator.rs:15:6: 15:7 + let _11: bool; // in scope 6 at $DIR/inline-generator.rs:15:6: 15:7
+ let mut _12: u32; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + let mut _12: u32; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ let mut _13: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + let mut _13: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ let mut _14: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + let mut _14: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ let mut _15: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + let mut _15: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ } + }
bb0: { bb0: {
@ -50,11 +50,11 @@
+ Deinit(_4); // scope 2 at $DIR/inline-generator.rs:15:5: 15:41 + Deinit(_4); // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
+ discriminant(_4) = 0; // scope 2 at $DIR/inline-generator.rs:15:5: 15:41 + discriminant(_4) = 0; // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
_3 = &mut _4; // scope 0 at $DIR/inline-generator.rs:9:23: 9:31 _3 = &mut _4; // scope 0 at $DIR/inline-generator.rs:9:23: 9:31
- _2 = Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>::new(move _3) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:9:14: 9:32 - _2 = Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>::new(move _3) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:9:14: 9:32
- // mir::Constant - // mir::Constant
- // + span: $DIR/inline-generator.rs:9:14: 9:22 - // + span: $DIR/inline-generator.rs:9:14: 9:22
- // + user_ty: UserType(0) - // + user_ty: UserType(0)
- // + literal: Const { ty: fn(&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]) -> Pin<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]> {Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>::new}, val: Value(Scalar(<ZST>)) } - // + literal: Const { ty: fn(&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]) -> Pin<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]> {Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>::new}, val: Value(Scalar(<ZST>)) }
- } - }
- -
- bb2: { - bb2: {
@ -63,24 +63,24 @@
+ StorageLive(_6); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL + StorageLive(_6); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
+ _6 = move _5; // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL + _6 = move _5; // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
+ Deinit(_2); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL + Deinit(_2); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
+ (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]) = move _6; // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL + (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]) = move _6; // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
+ StorageDead(_6); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL + StorageDead(_6); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
+ StorageDead(_5); // scope 4 at $SRC_DIR/core/src/pin.rs:LL:COL + StorageDead(_5); // scope 4 at $SRC_DIR/core/src/pin.rs:LL:COL
StorageDead(_3); // scope 0 at $DIR/inline-generator.rs:9:31: 9:32 StorageDead(_3); // scope 0 at $DIR/inline-generator.rs:9:31: 9:32
- _1 = <[generator@$DIR/inline-generator.rs:15:5: 15:41] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 - _1 = <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
- // mir::Constant - // mir::Constant
- // + span: $DIR/inline-generator.rs:9:33: 9:39 - // + span: $DIR/inline-generator.rs:9:33: 9:39
- // + literal: Const { ty: for<'r> fn(Pin<&'r mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>, bool) -> GeneratorState<<[generator@$DIR/inline-generator.rs:15:5: 15:41] as Generator<bool>>::Yield, <[generator@$DIR/inline-generator.rs:15:5: 15:41] as Generator<bool>>::Return> {<[generator@$DIR/inline-generator.rs:15:5: 15:41] as Generator<bool>>::resume}, val: Value(Scalar(<ZST>)) } - // + literal: Const { ty: for<'r> fn(Pin<&'r mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>, bool) -> GeneratorState<<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::Yield, <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::Return> {<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume}, val: Value(Scalar(<ZST>)) }
+ StorageLive(_7); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 + StorageLive(_7); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ _7 = const false; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 + _7 = const false; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_10); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 + StorageLive(_10); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_11); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 + StorageLive(_11); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_12); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46 + StorageLive(_12); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
+ StorageLive(_13); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + StorageLive(_13); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ _13 = move (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + _13 = move (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ _12 = discriminant((*_13)); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + _12 = discriminant((*_13)); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ StorageDead(_13); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + StorageDead(_13); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
} }
- bb3: { - bb3: {
@ -102,7 +102,7 @@
+ } + }
+ +
+ bb3: { + bb3: {
+ _11 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + _11 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:17: 15:39 + StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
+ StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:15:20: 15:21 + StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
+ _9 = _11; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21 + _9 = _11; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
@ -125,32 +125,32 @@
+ ((_1 as Yielded).0: i32) = move _8; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39 + ((_1 as Yielded).0: i32) = move _8; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
+ discriminant(_1) = 0; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39 + discriminant(_1) = 0; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
+ StorageLive(_14); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39 + StorageLive(_14); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
+ _14 = move (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39 + _14 = move (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
+ discriminant((*_14)) = 3; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39 + discriminant((*_14)) = 3; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
+ StorageDead(_14); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39 + StorageDead(_14); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:11: 15:39 + goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:11: 15:39
+ } + }
+ +
+ bb7: { + bb7: {
+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ _10 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + _10 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ StorageDead(_8); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39 + StorageDead(_8); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39
+ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41 + Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:8: 15:8
+ ((_1 as Complete).0: bool) = move _10; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41 + ((_1 as Complete).0: bool) = move _10; // scope 6 at $DIR/inline-generator.rs:15:8: 15:8
+ discriminant(_1) = 1; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41 + discriminant(_1) = 1; // scope 6 at $DIR/inline-generator.rs:15:8: 15:8
+ StorageLive(_15); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41 + StorageLive(_15); // scope 6 at $DIR/inline-generator.rs:15:8: 15:8
+ _15 = move (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41 + _15 = move (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:8: 15:8
+ discriminant((*_15)) = 1; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41 + discriminant((*_15)) = 1; // scope 6 at $DIR/inline-generator.rs:15:8: 15:8
+ StorageDead(_15); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41 + StorageDead(_15); // scope 6 at $DIR/inline-generator.rs:15:8: 15:8
+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:41: 15:41 + goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:8: 15:8
+ } + }
+ +
+ bb8: { + bb8: {
+ assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
+ } + }
+ +
+ bb9: { + bb9: {
+ unreachable; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41 + unreachable; // scope 6 at $DIR/inline-generator.rs:15:5: 15:8
} }
} }

View file

@ -2,8 +2,8 @@
fn main() -> () { fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:4:11: 4:11 let mut _0: (); // return place in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:4:11: 4:11
let _1: [closure@$DIR/issue-76997-inline-scopes-parenting.rs:5:13: 5:33]; // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:5:9: 5:10 let _1: [closure@$DIR/issue-76997-inline-scopes-parenting.rs:5:13: 5:16]; // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:5:9: 5:10
let mut _2: &[closure@$DIR/issue-76997-inline-scopes-parenting.rs:5:13: 5:33]; // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:6 let mut _2: &[closure@$DIR/issue-76997-inline-scopes-parenting.rs:5:13: 5:16]; // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:6
let mut _3: ((),); // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10 let mut _3: ((),); // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10
let mut _4: (); // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:6:7: 6:9 let mut _4: (); // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:6:7: 6:9
let mut _5: (); // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10 let mut _5: (); // in scope 0 at $DIR/issue-76997-inline-scopes-parenting.rs:6:5: 6:10

View file

@ -9,14 +9,14 @@ fn main::{closure#0}(_1: &[closure@main::{closure#0}], _2: &i32) -> &i32 {
} }
bb0: { bb0: {
Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:40:31: 43:6 Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:40:31: 40:48
Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:40:31: 43:6 Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:40:31: 40:48
StorageLive(_3); // scope 0 at $DIR/retag.rs:41:13: 41:15 StorageLive(_3); // scope 0 at $DIR/retag.rs:41:13: 41:15
_3 = _2; // scope 0 at $DIR/retag.rs:41:18: 41:19 _3 = _2; // scope 0 at $DIR/retag.rs:41:18: 41:19
Retag(_3); // scope 0 at $DIR/retag.rs:41:18: 41:19 Retag(_3); // scope 0 at $DIR/retag.rs:41:18: 41:19
_0 = _2; // scope 1 at $DIR/retag.rs:42:9: 42:10 _0 = _2; // scope 1 at $DIR/retag.rs:42:9: 42:10
Retag(_0); // scope 1 at $DIR/retag.rs:42:9: 42:10 Retag(_0); // scope 1 at $DIR/retag.rs:42:9: 42:10
StorageDead(_3); // scope 0 at $DIR/retag.rs:43:5: 43:6 StorageDead(_3); // scope 0 at $DIR/retag.rs:43:5: 43:6
return; // scope 0 at $DIR/retag.rs:43:6: 43:6 return; // scope 0 at $DIR/retag.rs:40:48: 40:48
} }
} }

View file

@ -121,7 +121,7 @@ fn main() -> () {
// ] // ]
Retag(_14); // scope 1 at $DIR/retag.rs:40:31: 43:6 Retag(_14); // scope 1 at $DIR/retag.rs:40:31: 43:6
_13 = move _14 as for<'r> fn(&'r i32) -> &'r i32 (Pointer(ClosureFnPointer(Normal))); // scope 1 at $DIR/retag.rs:40:31: 43:6 _13 = move _14 as for<'r> fn(&'r i32) -> &'r i32 (Pointer(ClosureFnPointer(Normal))); // scope 1 at $DIR/retag.rs:40:31: 43:6
StorageDead(_14); // scope 1 at $DIR/retag.rs:43:5: 43:6 StorageDead(_14); // scope 1 at $DIR/retag.rs:40:47: 40:48
StorageLive(_15); // scope 6 at $DIR/retag.rs:44:9: 44:11 StorageLive(_15); // scope 6 at $DIR/retag.rs:44:9: 44:11
StorageLive(_16); // scope 6 at $DIR/retag.rs:44:14: 44:15 StorageLive(_16); // scope 6 at $DIR/retag.rs:44:14: 44:15
_16 = _13; // scope 6 at $DIR/retag.rs:44:14: 44:15 _16 = _13; // scope 6 at $DIR/retag.rs:44:14: 44:15

View file

@ -30,7 +30,7 @@ LL | asm!("{}", in(xmm_reg) SimdNonCopy(0.0, 0.0, 0.0, 0.0));
| |
= note: `SimdNonCopy` does not implement the Copy trait = note: `SimdNonCopy` does not implement the Copy trait
error: cannot use value of type `[closure@$DIR/type-check-2.rs:52:28: 52:38]` for inline assembly error: cannot use value of type `[closure@$DIR/type-check-2.rs:52:28: 52:36]` for inline assembly
--> $DIR/type-check-2.rs:52:28 --> $DIR/type-check-2.rs:52:28
| |
LL | asm!("{}", in(reg) |x: i32| x); LL | asm!("{}", in(reg) |x: i32| x);

View file

@ -10,10 +10,7 @@ note: required because it's used within this closure
--> $DIR/issue-70935-complex-spans.rs:25:13 --> $DIR/issue-70935-complex-spans.rs:25:13
| |
LL | baz(|| async{ LL | baz(|| async{
| _____________^ | ^^
LL | | foo(tx.clone());
LL | | }).await;
| |_________^
note: required because it's used within this `async fn` body note: required because it's used within this `async fn` body
--> $DIR/issue-70935-complex-spans.rs:9:67 --> $DIR/issue-70935-complex-spans.rs:9:67
| |

View file

@ -14,7 +14,7 @@ LL | | foo(tx.clone());
LL | | }).await; LL | | }).await;
| | - ^^^^^^ await occurs here, with the value maybe used later | | - ^^^^^^ await occurs here, with the value maybe used later
| |_________| | |_________|
| has type `[closure@$DIR/issue-70935-complex-spans.rs:25:13: 27:10]` which is not `Send` | has type `[closure@$DIR/issue-70935-complex-spans.rs:25:13: 25:15]` which is not `Send`
note: the value is later dropped here note: the value is later dropped here
--> $DIR/issue-70935-complex-spans.rs:27:17 --> $DIR/issue-70935-complex-spans.rs:27:17
| |

View file

@ -24,15 +24,15 @@ LL | fn main() {
LL | (|_| 2333).await; LL | (|_| 2333).await;
| ^^^^^^ only allowed inside `async` functions and blocks | ^^^^^^ only allowed inside `async` functions and blocks
error[E0277]: `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future error[E0277]: `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]` is not a future
--> $DIR/issue-62009-1.rs:12:15 --> $DIR/issue-62009-1.rs:12:15
| |
LL | (|_| 2333).await; LL | (|_| 2333).await;
| ^^^^^^ `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` is not a future | ^^^^^^ `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]` is not a future
| |
= help: the trait `Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` = help: the trait `Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]`
= note: [closure@$DIR/issue-62009-1.rs:12:5: 12:15] must be a future or must implement `IntoFuture` to be awaited = note: [closure@$DIR/issue-62009-1.rs:12:6: 12:9] must be a future or must implement `IntoFuture` to be awaited
= note: required because of the requirements on the impl of `IntoFuture` for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` = note: required because of the requirements on the impl of `IntoFuture` for `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]`
help: remove the `.await` help: remove the `.await`
| |
LL - (|_| 2333).await; LL - (|_| 2333).await;

View file

@ -7,7 +7,7 @@ LL | |y| x + y
| ^^^^^^^^^ expected `()`, found closure | ^^^^^^^^^ expected `()`, found closure
| |
= note: expected unit type `()` = note: expected unit type `()`
found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14]` found closure `[closure@$DIR/issue-20862.rs:2:5: 2:8]`
error[E0618]: expected function, found `()` error[E0618]: expected function, found `()`
--> $DIR/issue-20862.rs:7:13 --> $DIR/issue-20862.rs:7:13

View file

@ -4,12 +4,10 @@ error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closu
LL | fn bar() -> impl Fn() -> usize { LL | fn bar() -> impl Fn() -> usize {
| --- ------------------ change this to return `FnMut` instead of `Fn` | --- ------------------ change this to return `FnMut` instead of `Fn`
LL | let mut x = 0; LL | let mut x = 0;
LL | / move || { LL | move || {
LL | | x += 1; | ------- in this closure
| | ^^^^^^ cannot assign LL | x += 1;
LL | | x | ^^^^^^ cannot assign
LL | | }
| |_____- in this closure
error: aborting due to previous error error: aborting due to previous error

View file

@ -71,12 +71,9 @@ LL | fn foo() -> Box<dyn Fn() -> usize> {
| --- ---------------------- change this to return `FnMut` instead of `Fn` | --- ---------------------- change this to return `FnMut` instead of `Fn`
LL | let mut x = 0; LL | let mut x = 0;
LL | Box::new(move || { LL | Box::new(move || {
| ______________- | ------- in this closure
LL | | x += 1; LL | x += 1;
| | ^^^^^^ cannot assign | ^^^^^^ cannot assign
LL | | x
LL | | })
| |_____- in this closure
error: aborting due to 7 previous errors error: aborting due to 7 previous errors

View file

@ -33,13 +33,9 @@ LL | fn make_fn<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | let f = make_fn(|| { LL | let f = make_fn(|| {
| _____________-------_- | ------- expects `Fn` instead of `FnMut`
| | | LL | let y = &raw mut x;
| | expects `Fn` instead of `FnMut` | ^^^^^^^^^^ cannot borrow as mutable
LL | | let y = &raw mut x;
| | ^^^^^^^^^^ cannot borrow as mutable
LL | | });
| |_____- in this closure
error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
--> $DIR/borrow-raw-address-of-mutability.rs:37:17 --> $DIR/borrow-raw-address-of-mutability.rs:37:17
@ -48,13 +44,9 @@ LL | fn make_fn<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | let f = make_fn(move || { LL | let f = make_fn(move || {
| _____________-------_- | ------- expects `Fn` instead of `FnMut`
| | | LL | let y = &raw mut x;
| | expects `Fn` instead of `FnMut` | ^^^^^^^^^^ cannot borrow as mutable
LL | | let y = &raw mut x;
| | ^^^^^^^^^^ cannot borrow as mutable
LL | | });
| |_____- in this closure
error: aborting due to 5 previous errors error: aborting due to 5 previous errors

View file

@ -4,9 +4,8 @@ error[E0507]: cannot move out of `x`, a captured variable in an `Fn` closure
LL | let x = Box::new(0); LL | let x = Box::new(0);
| - captured outer variable | - captured outer variable
LL | Box::new(|| x) LL | Box::new(|| x)
| ---^ | -- ^ move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait
| | | | |
| | move occurs because `x` has type `Box<i32>`, which does not implement the `Copy` trait
| captured by this `Fn` closure | captured by this `Fn` closure
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,15 +4,13 @@ error[E0507]: cannot move out of `bar`, a captured variable in an `FnMut` closur
LL | let bar: Box<_> = Box::new(3); LL | let bar: Box<_> = Box::new(3);
| --- captured outer variable | --- captured outer variable
LL | let _g = to_fn_mut(|| { LL | let _g = to_fn_mut(|| {
| ________________________- | -- captured by this `FnMut` closure
LL | | let _h = to_fn_once(move || -> isize { *bar }); LL | let _h = to_fn_once(move || -> isize { *bar });
| | ^^^^^^^^^^^^^^^^ ---- | ^^^^^^^^^^^^^^^^ ----
| | | | | | |
| | | variable moved due to use in closure | | variable moved due to use in closure
| | | move occurs because `bar` has type `Box<isize>`, which does not implement the `Copy` trait | | move occurs because `bar` has type `Box<isize>`, which does not implement the `Copy` trait
| | move out of `bar` occurs here | move out of `bar` occurs here
LL | | });
| |_____- captured by this `FnMut` closure
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,7 +4,7 @@ error: lifetime may not live long enough
LL | let _action = move || { LL | let _action = move || {
| ------- | -------
| | | | | |
| | return type of closure `[closure@$DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:4:9: 4:15]` contains a lifetime `'2` | | return type of closure `[closure@$DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:4:9: 4:11]` contains a lifetime `'2`
| lifetime `'1` represents this closure's body | lifetime `'1` represents this closure's body
LL | || f() // The `nested` closure LL | || f() // The `nested` closure
| ^^^^^^ returning this value requires that `'1` must outlive `'2` | ^^^^^^ returning this value requires that `'1` must outlive `'2`

View file

@ -8,7 +8,7 @@ LL | panic!()
| ^^^^^^^^ | ^^^^^^^^
| | | |
| the evaluated program panicked at 'explicit panic', $DIR/issue-81899.rs:12:5 | the evaluated program panicked at 'explicit panic', $DIR/issue-81899.rs:12:5
| inside `f::<[closure@$DIR/issue-81899.rs:4:31: 4:37]>` at $SRC_DIR/std/src/panic.rs:LL:COL | inside `f::<[closure@$DIR/issue-81899.rs:4:31: 4:34]>` at $SRC_DIR/std/src/panic.rs:LL:COL
| |
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -5,17 +5,13 @@ LL | let val = String::new();
| --- captured outer variable | --- captured outer variable
LL | LL |
LL | take_mut(|| { LL | take_mut(|| {
| ______________- | -- captured by this `FnMut` closure
LL | | LL |
LL | | let _foo: String = val; LL | let _foo: String = val;
| | ^^^ | ^^^
| | | | |
| | move occurs because `val` has type `String`, which does not implement the `Copy` trait | move occurs because `val` has type `String`, which does not implement the `Copy` trait
| | help: consider borrowing here: `&val` | help: consider borrowing here: `&val`
LL | |
LL | |
LL | | })
| |_____- captured by this `FnMut` closure
error: aborting due to previous error error: aborting due to previous error

View file

@ -8,7 +8,7 @@ LL | panic!()
| ^^^^^^^^ | ^^^^^^^^
| | | |
| the evaluated program panicked at 'explicit panic', $DIR/issue-88434-minimal-example.rs:11:5 | the evaluated program panicked at 'explicit panic', $DIR/issue-88434-minimal-example.rs:11:5
| inside `f::<[closure@$DIR/issue-88434-minimal-example.rs:3:25: 3:31]>` at $SRC_DIR/std/src/panic.rs:LL:COL | inside `f::<[closure@$DIR/issue-88434-minimal-example.rs:3:25: 3:28]>` at $SRC_DIR/std/src/panic.rs:LL:COL
| |
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -8,7 +8,7 @@ LL | panic!()
| ^^^^^^^^ | ^^^^^^^^
| | | |
| the evaluated program panicked at 'explicit panic', $DIR/issue-88434-removal-index-should-be-less.rs:11:5 | the evaluated program panicked at 'explicit panic', $DIR/issue-88434-removal-index-should-be-less.rs:11:5
| inside `f::<[closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:37]>` at $SRC_DIR/std/src/panic.rs:LL:COL | inside `f::<[closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34]>` at $SRC_DIR/std/src/panic.rs:LL:COL
| |
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -123,16 +123,9 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(|| { LL | fn_ref(|| {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | LL | x = (1,);
| | expects `Fn` instead of `FnMut` | ^^^^^^^^ cannot assign
LL | | x = (1,);
| | ^^^^^^^^ cannot assign
LL | | x.0 = 1;
LL | | &mut x;
LL | | &mut x.0;
LL | | });
| |_____- in this closure
error[E0594]: cannot assign to `x.0`, as `Fn` closures cannot mutate their captured variables error[E0594]: cannot assign to `x.0`, as `Fn` closures cannot mutate their captured variables
--> $DIR/mutability-errors.rs:41:9 --> $DIR/mutability-errors.rs:41:9
@ -141,16 +134,10 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(|| { LL | fn_ref(|| {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | LL | x = (1,);
| | expects `Fn` instead of `FnMut` LL | x.0 = 1;
LL | | x = (1,); | ^^^^^^^ cannot assign
LL | | x.0 = 1;
| | ^^^^^^^ cannot assign
LL | | &mut x;
LL | | &mut x.0;
LL | | });
| |_____- in this closure
error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
--> $DIR/mutability-errors.rs:42:9 --> $DIR/mutability-errors.rs:42:9
@ -159,16 +146,10 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(|| { LL | fn_ref(|| {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | ...
| | expects `Fn` instead of `FnMut` LL | &mut x;
LL | | x = (1,); | ^^^^^^ cannot borrow as mutable
LL | | x.0 = 1;
LL | | &mut x;
| | ^^^^^^ cannot borrow as mutable
LL | | &mut x.0;
LL | | });
| |_____- in this closure
error[E0596]: cannot borrow `x.0` as mutable, as `Fn` closures cannot mutate their captured variables error[E0596]: cannot borrow `x.0` as mutable, as `Fn` closures cannot mutate their captured variables
--> $DIR/mutability-errors.rs:43:9 --> $DIR/mutability-errors.rs:43:9
@ -177,16 +158,10 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(|| { LL | fn_ref(|| {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | ...
| | expects `Fn` instead of `FnMut` LL | &mut x.0;
LL | | x = (1,); | ^^^^^^^^ cannot borrow as mutable
LL | | x.0 = 1;
LL | | &mut x;
LL | | &mut x.0;
| | ^^^^^^^^ cannot borrow as mutable
LL | | });
| |_____- in this closure
error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure
--> $DIR/mutability-errors.rs:46:9 --> $DIR/mutability-errors.rs:46:9
@ -195,16 +170,9 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(move || { LL | fn_ref(move || {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | LL | x = (1,);
| | expects `Fn` instead of `FnMut` | ^^^^^^^^ cannot assign
LL | | x = (1,);
| | ^^^^^^^^ cannot assign
LL | | x.0 = 1;
LL | | &mut x;
LL | | &mut x.0;
LL | | });
| |_____- in this closure
error[E0594]: cannot assign to `x.0`, as `Fn` closures cannot mutate their captured variables error[E0594]: cannot assign to `x.0`, as `Fn` closures cannot mutate their captured variables
--> $DIR/mutability-errors.rs:47:9 --> $DIR/mutability-errors.rs:47:9
@ -213,16 +181,10 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(move || { LL | fn_ref(move || {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | LL | x = (1,);
| | expects `Fn` instead of `FnMut` LL | x.0 = 1;
LL | | x = (1,); | ^^^^^^^ cannot assign
LL | | x.0 = 1;
| | ^^^^^^^ cannot assign
LL | | &mut x;
LL | | &mut x.0;
LL | | });
| |_____- in this closure
error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
--> $DIR/mutability-errors.rs:48:9 --> $DIR/mutability-errors.rs:48:9
@ -231,16 +193,10 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(move || { LL | fn_ref(move || {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | ...
| | expects `Fn` instead of `FnMut` LL | &mut x;
LL | | x = (1,); | ^^^^^^ cannot borrow as mutable
LL | | x.0 = 1;
LL | | &mut x;
| | ^^^^^^ cannot borrow as mutable
LL | | &mut x.0;
LL | | });
| |_____- in this closure
error[E0596]: cannot borrow `x.0` as mutable, as `Fn` closures cannot mutate their captured variables error[E0596]: cannot borrow `x.0` as mutable, as `Fn` closures cannot mutate their captured variables
--> $DIR/mutability-errors.rs:49:9 --> $DIR/mutability-errors.rs:49:9
@ -249,16 +205,10 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(move || { LL | fn_ref(move || {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | ...
| | expects `Fn` instead of `FnMut` LL | &mut x.0;
LL | | x = (1,); | ^^^^^^^^ cannot borrow as mutable
LL | | x.0 = 1;
LL | | &mut x;
LL | | &mut x.0;
| | ^^^^^^^^ cannot borrow as mutable
LL | | });
| |_____- in this closure
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/mutability-errors.rs:54:5 --> $DIR/mutability-errors.rs:54:5

View file

@ -4,14 +4,11 @@ error[E0507]: cannot move out of `y`, a captured variable in an `Fn` closure
LL | let y = vec![format!("World")]; LL | let y = vec![format!("World")];
| - captured outer variable | - captured outer variable
LL | call(|| { LL | call(|| {
| __________- | -- captured by this `Fn` closure
LL | | y.into_iter(); LL | y.into_iter();
| | ^ ----------- `y` moved due to this method call | ^ ----------- `y` moved due to this method call
| | | | |
| | move occurs because `y` has type `Vec<String>`, which does not implement the `Copy` trait | move occurs because `y` has type `Vec<String>`, which does not implement the `Copy` trait
LL | |
LL | | });
| |_____- captured by this `Fn` closure
| |
note: this function takes ownership of the receiver `self`, which moves `y` note: this function takes ownership of the receiver `self`, which moves `y`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL

View file

@ -2,7 +2,7 @@ error: changes to closure capture in Rust 2021 will affect which traits the clos
--> $DIR/auto_traits.rs:22:19 --> $DIR/auto_traits.rs:22:19
| |
LL | thread::spawn(move || unsafe { LL | thread::spawn(move || unsafe {
| ^^^^^^^^^^^^^^ in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr` is not fully captured and `fptr.0` does not implement `Send` | ^^^^^^^ in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr` is not fully captured and `fptr.0` does not implement `Send`
... ...
LL | *fptr.0 = 20; LL | *fptr.0 = 20;
| ------- in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0` | ------- in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0`
@ -26,7 +26,7 @@ error: changes to closure capture in Rust 2021 will affect which traits the clos
--> $DIR/auto_traits.rs:42:19 --> $DIR/auto_traits.rs:42:19
| |
LL | thread::spawn(move || unsafe { LL | thread::spawn(move || unsafe {
| ^^^^^^^^^^^^^^ | ^^^^^^^
| | | |
| in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr` is not fully captured and `fptr.0.0` does not implement `Send` | in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr` is not fully captured and `fptr.0.0` does not implement `Send`
| in Rust 2018, this closure implements `Sync` as `fptr` implements `Sync`, but in Rust 2021, this closure will no longer implement `Sync` because `fptr` is not fully captured and `fptr.0.0` does not implement `Sync` | in Rust 2018, this closure implements `Sync` as `fptr` implements `Sync`, but in Rust 2021, this closure will no longer implement `Sync` because `fptr` is not fully captured and `fptr.0.0` does not implement `Sync`

View file

@ -2,14 +2,10 @@ warning: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/closure-body-macro-fragment.rs:16:17 --> $DIR/closure-body-macro-fragment.rs:16:17
| |
LL | let f = || $body; LL | let f = || $body;
| _________________^ | ^^
LL | | ...
LL | | f(); LL | }};
LL | | }}; | - in Rust 2018, `a` is dropped here, but in Rust 2021, only `a.0` will be dropped here as part of the closure
| | - in Rust 2018, `a` is dropped here, but in Rust 2021, only `a.0` will be dropped here as part of the closure
LL | | ($body:block) => {{
LL | | m!(@ $body);
| |__________________^
... ...
LL | / m!({ LL | / m!({
LL | | LL | |

View file

@ -2,9 +2,7 @@ error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/macro.rs:19:13 --> $DIR/macro.rs:19:13
| |
LL | let _ = || dbg!(a.0); LL | let _ = || dbg!(a.0);
| ^^^^^^^^---^ | ^^ --- in Rust 2018, this closure captures all of `a`, but in Rust 2021, it will only capture `a.0`
| |
| in Rust 2018, this closure captures all of `a`, but in Rust 2021, it will only capture `a.0`
... ...
LL | } LL | }
| - in Rust 2018, `a` is dropped here, but in Rust 2021, only `a.0` will be dropped here as part of the closure | - in Rust 2018, `a` is dropped here, but in Rust 2021, only `a.0` will be dropped here as part of the closure

View file

@ -26,9 +26,7 @@ error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/migrations_rustfix.rs:33:13 --> $DIR/migrations_rustfix.rs:33:13
| |
LL | let c = || t.0; LL | let c = || t.0;
| ^^^--- | ^^ --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
| |
| in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
... ...
LL | } LL | }
| - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure

View file

@ -92,7 +92,7 @@ error: changes to closure capture in Rust 2021 will affect which traits the clos
--> $DIR/multi_diagnostics.rs:133:19 --> $DIR/multi_diagnostics.rs:133:19
| |
LL | thread::spawn(move || unsafe { LL | thread::spawn(move || unsafe {
| ^^^^^^^^^^^^^^ | ^^^^^^^
| | | |
| in Rust 2018, this closure implements `Send` as `fptr1` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr1` is not fully captured and `fptr1.0.0` does not implement `Send` | in Rust 2018, this closure implements `Send` as `fptr1` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` because `fptr1` is not fully captured and `fptr1.0.0` does not implement `Send`
| in Rust 2018, this closure implements `Sync` as `fptr1` implements `Sync`, but in Rust 2021, this closure will no longer implement `Sync` because `fptr1` is not fully captured and `fptr1.0.0` does not implement `Sync` | in Rust 2018, this closure implements `Sync` as `fptr1` implements `Sync`, but in Rust 2021, this closure will no longer implement `Sync` because `fptr1` is not fully captured and `fptr1.0.0` does not implement `Sync`

View file

@ -199,9 +199,7 @@ error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:201:18 --> $DIR/significant_drop.rs:201:18
| |
LL | let _c = || tup.0; LL | let _c = || tup.0;
| ^^^----- | ^^ ----- in Rust 2018, this closure captures all of `tup`, but in Rust 2021, it will only capture `tup.0`
| |
| in Rust 2018, this closure captures all of `tup`, but in Rust 2021, it will only capture `tup.0`
... ...
LL | } LL | }
| - in Rust 2018, `tup` is dropped here, but in Rust 2021, only `tup.0` will be dropped here as part of the closure | - in Rust 2018, `tup` is dropped here, but in Rust 2021, only `tup.0` will be dropped here as part of the closure

View file

@ -10,11 +10,7 @@ note: required because it's used within this closure
--> $DIR/closure-move-sync.rs:6:27 --> $DIR/closure-move-sync.rs:6:27
| |
LL | let t = thread::spawn(|| { LL | let t = thread::spawn(|| {
| ___________________________^ | ^^
LL | | recv.recv().unwrap();
LL | |
LL | | });
| |_____^
note: required by a bound in `spawn` note: required by a bound in `spawn`
--> $SRC_DIR/std/src/thread/mod.rs:LL:COL --> $SRC_DIR/std/src/thread/mod.rs:LL:COL
| |
@ -33,7 +29,7 @@ note: required because it's used within this closure
--> $DIR/closure-move-sync.rs:18:19 --> $DIR/closure-move-sync.rs:18:19
| |
LL | thread::spawn(|| tx.send(()).unwrap()); LL | thread::spawn(|| tx.send(()).unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^ | ^^
note: required by a bound in `spawn` note: required by a bound in `spawn`
--> $SRC_DIR/std/src/thread/mod.rs:LL:COL --> $SRC_DIR/std/src/thread/mod.rs:LL:COL
| |

View file

@ -7,7 +7,7 @@ LL | let foo: fn(u8) -> u8 = |v: u8| { a += v; a };
| expected due to this | expected due to this
| |
= note: expected fn pointer `fn(u8) -> u8` = note: expected fn pointer `fn(u8) -> u8`
found closure `[closure@$DIR/closure-no-fn-1.rs:6:29: 6:50]` found closure `[closure@$DIR/closure-no-fn-1.rs:6:29: 6:36]`
note: closures can only be coerced to `fn` types if they do not capture any variables note: closures can only be coerced to `fn` types if they do not capture any variables
--> $DIR/closure-no-fn-1.rs:6:39 --> $DIR/closure-no-fn-1.rs:6:39
| |

View file

@ -7,7 +7,7 @@ LL | let bar: fn() -> u8 = || { b };
| expected due to this | expected due to this
| |
= note: expected fn pointer `fn() -> u8` = note: expected fn pointer `fn() -> u8`
found closure `[closure@$DIR/closure-no-fn-2.rs:6:27: 6:35]` found closure `[closure@$DIR/closure-no-fn-2.rs:6:27: 6:29]`
note: closures can only be coerced to `fn` types if they do not capture any variables note: closures can only be coerced to `fn` types if they do not capture any variables
--> $DIR/closure-no-fn-2.rs:6:32 --> $DIR/closure-no-fn-2.rs:6:32
| |

View file

@ -1,4 +1,4 @@
error[E0605]: non-primitive cast: `[closure@$DIR/closure-no-fn-3.rs:6:27: 6:37]` as `fn() -> u8` error[E0605]: non-primitive cast: `[closure@$DIR/closure-no-fn-3.rs:6:28: 6:30]` as `fn() -> u8`
--> $DIR/closure-no-fn-3.rs:6:27 --> $DIR/closure-no-fn-3.rs:6:27
| |
LL | let baz: fn() -> u8 = (|| { b }) as fn() -> u8; LL | let baz: fn() -> u8 = (|| { b }) as fn() -> u8;

View file

@ -12,7 +12,7 @@ LL | | };
| |_____- `match` arms have incompatible types | |_____- `match` arms have incompatible types
| |
= note: expected fn pointer `fn(usize) -> usize` = note: expected fn pointer `fn(usize) -> usize`
found closure `[closure@$DIR/closure-no-fn-4.rs:5:18: 5:27]` found closure `[closure@$DIR/closure-no-fn-4.rs:5:18: 5:21]`
note: closures can only be coerced to `fn` types if they do not capture any variables note: closures can only be coerced to `fn` types if they do not capture any variables
--> $DIR/closure-no-fn-4.rs:5:26 --> $DIR/closure-no-fn-4.rs:5:26
| |

View file

@ -7,7 +7,7 @@ LL | let bar: fn() -> u8 = || { a; b; c; d; e };
| expected due to this | expected due to this
| |
= note: expected fn pointer `fn() -> u8` = note: expected fn pointer `fn() -> u8`
found closure `[closure@$DIR/closure-no-fn-5.rs:10:27: 10:47]` found closure `[closure@$DIR/closure-no-fn-5.rs:10:27: 10:29]`
note: closures can only be coerced to `fn` types if they do not capture any variables note: closures can only be coerced to `fn` types if they do not capture any variables
--> $DIR/closure-no-fn-5.rs:10:32 --> $DIR/closure-no-fn-5.rs:10:32
| |

View file

@ -2,14 +2,14 @@ error[E0308]: mismatched types
--> $DIR/closure-reform-bad.rs:11:15 --> $DIR/closure-reform-bad.rs:11:15
| |
LL | let f = |s: &str| println!("{}{}", s, string); LL | let f = |s: &str| println!("{}{}", s, string);
| ------------------------------------- the found closure | --------- the found closure
LL | call_bare(f) LL | call_bare(f)
| --------- ^ expected fn pointer, found closure | --------- ^ expected fn pointer, found closure
| | | |
| arguments to this function are incorrect | arguments to this function are incorrect
| |
= note: expected fn pointer `for<'r> fn(&'r str)` = note: expected fn pointer `for<'r> fn(&'r str)`
found closure `[closure@$DIR/closure-reform-bad.rs:10:13: 10:50]` found closure `[closure@$DIR/closure-reform-bad.rs:10:13: 10:22]`
note: closures can only be coerced to `fn` types if they do not capture any variables note: closures can only be coerced to `fn` types if they do not capture any variables
--> $DIR/closure-reform-bad.rs:10:43 --> $DIR/closure-reform-bad.rs:10:43
| |

View file

@ -2,9 +2,8 @@ error[E0525]: expected a closure that implements the `Fn` trait, but this closur
--> $DIR/closure-wrong-kind.rs:10:19 --> $DIR/closure-wrong-kind.rs:10:19
| |
LL | let closure = |_| foo(x); LL | let closure = |_| foo(x);
| ^^^^^^^^-^ | ^^^ - closure is `FnOnce` because it moves the variable `x` out of its environment
| | | | |
| | closure is `FnOnce` because it moves the variable `x` out of its environment
| this closure implements `FnOnce`, not `Fn` | this closure implements `FnOnce`, not `Fn`
LL | bar(closure); LL | bar(closure);
| --- the requirement to implement `Fn` derives from here | --- the requirement to implement `Fn` derives from here

View file

@ -12,7 +12,7 @@ LL | | };
| |_____- `match` arms have incompatible types | |_____- `match` arms have incompatible types
| |
= note: expected fn item `fn(i32, i32) -> i32 {add}` = note: expected fn item `fn(i32, i32) -> i32 {add}`
found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:9:16: 9:43]` found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:9:16: 9:22]`
error[E0308]: `match` arms have incompatible types error[E0308]: `match` arms have incompatible types
--> $DIR/closure_cap_coerce_many_fail.rs:18:16 --> $DIR/closure_cap_coerce_many_fail.rs:18:16
@ -23,15 +23,15 @@ LL | | "+" => |a, b| (a + b) as i32,
| | --------------------- | | ---------------------
| | | | | |
| | the expected closure | | the expected closure
| | this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:17:16: 17:37]` | | this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:17:16: 17:22]`
LL | | "-" => |a, b| (a - b + cap) as i32, LL | | "-" => |a, b| (a - b + cap) as i32,
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
LL | | _ => unimplemented!(), LL | | _ => unimplemented!(),
LL | | }; LL | | };
| |_____- `match` arms have incompatible types | |_____- `match` arms have incompatible types
| |
= note: expected closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:17:16: 17:37]` = note: expected closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:17:16: 17:22]`
found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:18:16: 18:43]` found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:18:16: 18:22]`
= note: no two closures, even if identical, have the same type = note: no two closures, even if identical, have the same type
= help: consider boxing your closure and/or using it as a trait object = help: consider boxing your closure and/or using it as a trait object
@ -44,15 +44,15 @@ LL | | "+" => |a, b| (a + b + cap) as i32,
| | --------------------------- | | ---------------------------
| | | | | |
| | the expected closure | | the expected closure
| | this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:43]` | | this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:22]`
LL | | "-" => |a, b| (a - b) as i32, LL | | "-" => |a, b| (a - b) as i32,
| | ^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure | | ^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
LL | | _ => unimplemented!(), LL | | _ => unimplemented!(),
LL | | }; LL | | };
| |_____- `match` arms have incompatible types | |_____- `match` arms have incompatible types
| |
= note: expected closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:43]` = note: expected closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:26:16: 26:22]`
found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:27:16: 27:37]` found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:27:16: 27:22]`
= note: no two closures, even if identical, have the same type = note: no two closures, even if identical, have the same type
= help: consider boxing your closure and/or using it as a trait object = help: consider boxing your closure and/or using it as a trait object
@ -65,15 +65,15 @@ LL | | "+" => |a, b| (a + b + cap) as i32,
| | --------------------------- | | ---------------------------
| | | | | |
| | the expected closure | | the expected closure
| | this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:43]` | | this is found to be of type `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:22]`
LL | | "-" => |a, b| (a - b + cap) as i32, LL | | "-" => |a, b| (a - b + cap) as i32,
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
LL | | _ => unimplemented!(), LL | | _ => unimplemented!(),
LL | | }; LL | | };
| |_____- `match` arms have incompatible types | |_____- `match` arms have incompatible types
| |
= note: expected closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:43]` = note: expected closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:34:16: 34:22]`
found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:35:16: 35:43]` found closure `[closure@$DIR/closure_cap_coerce_many_fail.rs:35:16: 35:22]`
= note: no two closures, even if identical, have the same type = note: no two closures, even if identical, have the same type
= help: consider boxing your closure and/or using it as a trait object = help: consider boxing your closure and/or using it as a trait object

View file

@ -2,7 +2,7 @@ error[E0382]: use of moved value: `c`
--> $DIR/closure-print-generic-1.rs:17:5 --> $DIR/closure-print-generic-1.rs:17:5
| |
LL | let c = to_fn_once(move || { LL | let c = to_fn_once(move || {
| - move occurs because `c` has type `[closure@$DIR/closure-print-generic-1.rs:12:24: 14:6]`, which does not implement the `Copy` trait | - move occurs because `c` has type `[closure@$DIR/closure-print-generic-1.rs:12:24: 12:31]`, which does not implement the `Copy` trait
... ...
LL | c(); LL | c();
| --- `c` moved due to this call | --- `c` moved due to this call

View file

@ -2,14 +2,14 @@ error[E0308]: mismatched types
--> $DIR/closure-print-generic-2.rs:6:22 --> $DIR/closure-print-generic-2.rs:6:22
| |
LL | let c = || println!("{} {}", t, x); LL | let c = || println!("{} {}", t, x);
| -------------------------- the found closure | -- the found closure
LL | let c1: () = c; LL | let c1: () = c;
| -- ^ expected `()`, found closure | -- ^ expected `()`, found closure
| | | |
| expected due to this | expected due to this
| |
= note: expected unit type `()` = note: expected unit type `()`
found closure `[closure@$DIR/closure-print-generic-2.rs:5:17: 5:43]` found closure `[closure@$DIR/closure-print-generic-2.rs:5:17: 5:19]`
help: use parentheses to call this closure help: use parentheses to call this closure
| |
LL | let c1: () = c(); LL | let c1: () = c();

View file

@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/closure-print-generic-trim-off-verbose-2.rs:9:23 --> $DIR/closure-print-generic-trim-off-verbose-2.rs:9:23
| |
LL | let c = || println!("{} {}", t, x); LL | let c = || println!("{} {}", t, x);
| -------------------------- the found closure | -- the found closure
LL | let c1 : () = c; LL | let c1 : () = c;
| -- ^ expected `()`, found closure | -- ^ expected `()`, found closure
| | | |

View file

@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/closure-print-generic-verbose-2.rs:9:23 --> $DIR/closure-print-generic-verbose-2.rs:9:23
| |
LL | let c = || println!("{} {}", t, x); LL | let c = || println!("{} {}", t, x);
| -------------------------- the found closure | -- the found closure
LL | let c1 : () = c; LL | let c1 : () = c;
| -- ^ expected `()`, found closure | -- ^ expected `()`, found closure
| | | |

View file

@ -32,7 +32,7 @@ LL | let _ = box { |x| (x as u8) }: Box<dyn Fn(i32) -> _>;
| ^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure | ^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
| |
= note: expected struct `Box<dyn Fn(i32) -> u8>` = note: expected struct `Box<dyn Fn(i32) -> u8>`
found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:13:19: 13:32]>` found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:13:19: 13:22]>`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:14:13 --> $DIR/coerce-expect-unsized-ascribed.rs:14:13
@ -86,7 +86,7 @@ LL | let _ = &{ |x| (x as u8) }: &dyn Fn(i32) -> _;
| ^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure | ^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
| |
= note: expected reference `&dyn Fn(i32) -> u8` = note: expected reference `&dyn Fn(i32) -> u8`
found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:21:16: 21:29]` found reference `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:21:16: 21:19]`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/coerce-expect-unsized-ascribed.rs:22:13 --> $DIR/coerce-expect-unsized-ascribed.rs:22:13
@ -122,7 +122,7 @@ LL | let _ = Box::new(|x| (x as u8)): Box<dyn Fn(i32) -> _>;
| ^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure | ^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn Fn`, found closure
| |
= note: expected struct `Box<dyn Fn(i32) -> u8>` = note: expected struct `Box<dyn Fn(i32) -> u8>`
found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:22: 26:35]>` found struct `Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:22: 26:25]>`
error: aborting due to 14 previous errors error: aborting due to 14 previous errors

View file

@ -1,4 +1,4 @@
error[E0599]: no method named `closure` found for reference `&Obj<[closure@$DIR/issue-33784.rs:25:43: 25:48]>` in the current scope error[E0599]: no method named `closure` found for reference `&Obj<[closure@$DIR/issue-33784.rs:25:43: 25:45]>` in the current scope
--> $DIR/issue-33784.rs:27:7 --> $DIR/issue-33784.rs:27:7
| |
LL | p.closure(); LL | p.closure();
@ -9,7 +9,7 @@ help: to call the function stored in `closure`, surround the field access with p
LL | (p.closure)(); LL | (p.closure)();
| + + | + +
error[E0599]: no method named `fn_ptr` found for reference `&&Obj<[closure@$DIR/issue-33784.rs:25:43: 25:48]>` in the current scope error[E0599]: no method named `fn_ptr` found for reference `&&Obj<[closure@$DIR/issue-33784.rs:25:43: 25:45]>` in the current scope
--> $DIR/issue-33784.rs:29:7 --> $DIR/issue-33784.rs:29:7
| |
LL | q.fn_ptr(); LL | q.fn_ptr();

View file

@ -10,11 +10,11 @@ error[E0599]: no method named `blablabla` found for struct `Arc<_>` in the curre
LL | arc.blablabla(); LL | arc.blablabla();
| ^^^^^^^^^ method not found in `Arc<_>` | ^^^^^^^^^ method not found in `Arc<_>`
error[E0599]: no method named `blablabla` found for struct `Arc<[closure@$DIR/fn-help-with-err.rs:10:36: 10:40]>` in the current scope error[E0599]: no method named `blablabla` found for struct `Arc<[closure@$DIR/fn-help-with-err.rs:10:36: 10:38]>` in the current scope
--> $DIR/fn-help-with-err.rs:12:10 --> $DIR/fn-help-with-err.rs:12:10
| |
LL | arc2.blablabla(); LL | arc2.blablabla();
| ---- ^^^^^^^^^ method not found in `Arc<[closure@$DIR/fn-help-with-err.rs:10:36: 10:40]>` | ---- ^^^^^^^^^ method not found in `Arc<[closure@$DIR/fn-help-with-err.rs:10:36: 10:38]>`
| | | |
| this is a function, perhaps you wish to call it | this is a function, perhaps you wish to call it

View file

@ -4,7 +4,7 @@ error: generator cannot be sent between threads safely
LL | assert_send(|| { LL | assert_send(|| {
| ^^^^^^^^^^^ generator is not `Send` | ^^^^^^^^^^^ generator is not `Send`
| |
= help: within `[generator@$DIR/drop-yield-twice.rs:7:17: 12:6]`, the trait `Send` is not implemented for `Foo` = help: within `[generator@$DIR/drop-yield-twice.rs:7:17: 7:19]`, the trait `Send` is not implemented for `Foo`
note: generator is not `Send` as this value is used across a yield note: generator is not `Send` as this value is used across a yield
--> $DIR/drop-yield-twice.rs:9:9 --> $DIR/drop-yield-twice.rs:9:9
| |

View file

@ -1,4 +1,4 @@
error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 19:6] as Generator>::Return == [generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 19:6]` error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 15:36] as Generator>::Return == [generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 15:36]`
--> $DIR/generator-yielding-or-returning-itself.rs:15:5 --> $DIR/generator-yielding-or-returning-itself.rs:15:5
| |
LL | want_cyclic_generator_return(|| { LL | want_cyclic_generator_return(|| {
@ -16,7 +16,7 @@ LL | pub fn want_cyclic_generator_return<T>(_: T)
LL | where T: Generator<Yield = (), Return = T> LL | where T: Generator<Yield = (), Return = T>
| ^^^^^^^^^^ required by this bound in `want_cyclic_generator_return` | ^^^^^^^^^^ required by this bound in `want_cyclic_generator_return`
error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 32:6] as Generator>::Yield == [generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 32:6]` error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 28:35] as Generator>::Yield == [generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 28:35]`
--> $DIR/generator-yielding-or-returning-itself.rs:28:5 --> $DIR/generator-yielding-or-returning-itself.rs:28:5
| |
LL | want_cyclic_generator_yield(|| { LL | want_cyclic_generator_yield(|| {

View file

@ -33,11 +33,8 @@ LL | require_send(send_gen);
note: required because it's used within this generator note: required because it's used within this generator
--> $DIR/issue-68112.rs:48:5 --> $DIR/issue-68112.rs:48:5
| |
LL | / || { LL | || {
LL | | yield; | ^^
LL | | t
LL | | }
| |_____^
note: required because it appears within the type `impl Generator<Return = Arc<RefCell<i32>>>` note: required because it appears within the type `impl Generator<Return = Arc<RefCell<i32>>>`
--> $DIR/issue-68112.rs:45:30 --> $DIR/issue-68112.rs:45:30
| |
@ -53,11 +50,7 @@ note: required because it's used within this generator
--> $DIR/issue-68112.rs:59:20 --> $DIR/issue-68112.rs:59:20
| |
LL | let send_gen = || { LL | let send_gen = || {
| ____________________^ | ^^
LL | | let _non_send_gen = make_non_send_generator2();
LL | | yield;
LL | | };
| |_____^
note: required by a bound in `require_send` note: required by a bound in `require_send`
--> $DIR/issue-68112.rs:22:25 --> $DIR/issue-68112.rs:22:25
| |

View file

@ -10,12 +10,7 @@ note: required because it's used within this generator
--> $DIR/not-send-sync.rs:16:17 --> $DIR/not-send-sync.rs:16:17
| |
LL | assert_send(|| { LL | assert_send(|| {
| _________________^ | ^^
LL | |
LL | | drop(&a);
LL | | yield;
LL | | });
| |_____^
note: required by a bound in `assert_send` note: required by a bound in `assert_send`
--> $DIR/not-send-sync.rs:7:23 --> $DIR/not-send-sync.rs:7:23
| |
@ -28,7 +23,7 @@ error: generator cannot be shared between threads safely
LL | assert_sync(|| { LL | assert_sync(|| {
| ^^^^^^^^^^^ generator is not `Sync` | ^^^^^^^^^^^ generator is not `Sync`
| |
= help: within `[generator@$DIR/not-send-sync.rs:9:17: 13:6]`, the trait `Sync` is not implemented for `Cell<i32>` = help: within `[generator@$DIR/not-send-sync.rs:9:17: 9:19]`, the trait `Sync` is not implemented for `Cell<i32>`
note: generator is not `Sync` as this value is used across a yield note: generator is not `Sync` as this value is used across a yield
--> $DIR/not-send-sync.rs:12:9 --> $DIR/not-send-sync.rs:12:9
| |

View file

@ -4,7 +4,7 @@ error: generator cannot be sent between threads safely
LL | assert_send(|| { LL | assert_send(|| {
| ^^^^^^^^^^^ generator is not `Send` | ^^^^^^^^^^^ generator is not `Send`
| |
= help: within `[generator@$DIR/partial-drop.rs:14:17: 20:6]`, the trait `Send` is not implemented for `Foo` = help: within `[generator@$DIR/partial-drop.rs:14:17: 14:19]`, the trait `Send` is not implemented for `Foo`
note: generator is not `Send` as this value is used across a yield note: generator is not `Send` as this value is used across a yield
--> $DIR/partial-drop.rs:19:9 --> $DIR/partial-drop.rs:19:9
| |
@ -27,7 +27,7 @@ error: generator cannot be sent between threads safely
LL | assert_send(|| { LL | assert_send(|| {
| ^^^^^^^^^^^ generator is not `Send` | ^^^^^^^^^^^ generator is not `Send`
| |
= help: within `[generator@$DIR/partial-drop.rs:22:17: 30:6]`, the trait `Send` is not implemented for `Foo` = help: within `[generator@$DIR/partial-drop.rs:22:17: 22:19]`, the trait `Send` is not implemented for `Foo`
note: generator is not `Send` as this value is used across a yield note: generator is not `Send` as this value is used across a yield
--> $DIR/partial-drop.rs:29:9 --> $DIR/partial-drop.rs:29:9
| |
@ -50,7 +50,7 @@ error: generator cannot be sent between threads safely
LL | assert_send(|| { LL | assert_send(|| {
| ^^^^^^^^^^^ generator is not `Send` | ^^^^^^^^^^^ generator is not `Send`
| |
= help: within `[generator@$DIR/partial-drop.rs:32:17: 39:6]`, the trait `Send` is not implemented for `Foo` = help: within `[generator@$DIR/partial-drop.rs:32:17: 32:19]`, the trait `Send` is not implemented for `Foo`
note: generator is not `Send` as this value is used across a yield note: generator is not `Send` as this value is used across a yield
--> $DIR/partial-drop.rs:38:9 --> $DIR/partial-drop.rs:38:9
| |

View file

@ -31,11 +31,8 @@ LL | require_send(send_gen);
note: required because it's used within this generator note: required because it's used within this generator
--> $DIR/generator-print-verbose-1.rs:42:5 --> $DIR/generator-print-verbose-1.rs:42:5
| |
LL | / || { LL | || {
LL | | yield; | ^^
LL | | t
LL | | }
| |_____^
note: required because it appears within the type `Opaque(DefId(0:39 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [std::sync::Arc<std::cell::RefCell<i32>>])` note: required because it appears within the type `Opaque(DefId(0:39 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [std::sync::Arc<std::cell::RefCell<i32>>])`
--> $DIR/generator-print-verbose-1.rs:41:30 --> $DIR/generator-print-verbose-1.rs:41:30
| |
@ -51,11 +48,7 @@ note: required because it's used within this generator
--> $DIR/generator-print-verbose-1.rs:52:20 --> $DIR/generator-print-verbose-1.rs:52:20
| |
LL | let send_gen = || { LL | let send_gen = || {
| ____________________^ | ^^
LL | | let _non_send_gen = make_non_send_generator2();
LL | | yield;
LL | | };
| |_____^
note: required by a bound in `require_send` note: required by a bound in `require_send`
--> $DIR/generator-print-verbose-1.rs:26:25 --> $DIR/generator-print-verbose-1.rs:26:25
| |

View file

@ -10,12 +10,7 @@ note: required because it's used within this generator
--> $DIR/generator-print-verbose-2.rs:19:17 --> $DIR/generator-print-verbose-2.rs:19:17
| |
LL | assert_send(|| { LL | assert_send(|| {
| _________________^ | ^^
LL | |
LL | | drop(&a);
LL | | yield;
LL | | });
| |_____^
note: required by a bound in `assert_send` note: required by a bound in `assert_send`
--> $DIR/generator-print-verbose-2.rs:10:23 --> $DIR/generator-print-verbose-2.rs:10:23
| |

View file

@ -1,8 +1,8 @@
error[E0277]: `[static generator@$DIR/static-not-unpin.rs:11:25: 13:6]` cannot be unpinned error[E0277]: `[static generator@$DIR/static-not-unpin.rs:11:25: 11:34]` cannot be unpinned
--> $DIR/static-not-unpin.rs:14:18 --> $DIR/static-not-unpin.rs:14:18
| |
LL | assert_unpin(generator); LL | assert_unpin(generator);
| ------------ ^^^^^^^^^ the trait `Unpin` is not implemented for `[static generator@$DIR/static-not-unpin.rs:11:25: 13:6]` | ------------ ^^^^^^^^^ the trait `Unpin` is not implemented for `[static generator@$DIR/static-not-unpin.rs:11:25: 11:34]`
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call
| |

View file

@ -12,7 +12,7 @@ note: return type inferred to be `Result<{integer}, _>` here
LL | return Ok(6); LL | return Ok(6);
| ^^^^^ | ^^^^^
error[E0271]: type mismatch resolving `<[generator@$DIR/type-mismatch-signature-deduction.rs:7:5: 15:6] as Generator>::Return == i32` error[E0271]: type mismatch resolving `<[generator@$DIR/type-mismatch-signature-deduction.rs:7:5: 7:7] as Generator>::Return == i32`
--> $DIR/type-mismatch-signature-deduction.rs:5:13 --> $DIR/type-mismatch-signature-deduction.rs:5:13
| |
LL | fn foo() -> impl Generator<Return = i32> { LL | fn foo() -> impl Generator<Return = i32> {

View file

@ -4,7 +4,7 @@ error: higher-ranked lifetime error
LL | v.t(|| {}); LL | v.t(|| {});
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
= note: could not prove `[closure@$DIR/issue-59311.rs:17:9: 17:14] well-formed` = note: could not prove `[closure@$DIR/issue-59311.rs:17:9: 17:11] well-formed`
error: higher-ranked lifetime error error: higher-ranked lifetime error
--> $DIR/issue-59311.rs:17:9 --> $DIR/issue-59311.rs:17:9

View file

@ -10,7 +10,7 @@ note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-71955.rs:45:24 --> $DIR/issue-71955.rs:45:24
| |
LL | foo(bar, "string", |s| s.len() == 5); LL | foo(bar, "string", |s| s.len() == 5);
| ^^^^^^^^^^^^^^^^ | ^^^
note: the lifetime requirement is introduced here note: the lifetime requirement is introduced here
--> $DIR/issue-71955.rs:25:9 --> $DIR/issue-71955.rs:25:9
| |
@ -29,7 +29,7 @@ note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-71955.rs:45:24 --> $DIR/issue-71955.rs:45:24
| |
LL | foo(bar, "string", |s| s.len() == 5); LL | foo(bar, "string", |s| s.len() == 5);
| ^^^^^^^^^^^^^^^^ | ^^^
note: the lifetime requirement is introduced here note: the lifetime requirement is introduced here
--> $DIR/issue-71955.rs:25:44 --> $DIR/issue-71955.rs:25:44
| |
@ -48,7 +48,7 @@ note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-71955.rs:48:24 --> $DIR/issue-71955.rs:48:24
| |
LL | foo(baz, "string", |s| s.0.len() == 5); LL | foo(baz, "string", |s| s.0.len() == 5);
| ^^^^^^^^^^^^^^^^^^ | ^^^
note: the lifetime requirement is introduced here note: the lifetime requirement is introduced here
--> $DIR/issue-71955.rs:25:9 --> $DIR/issue-71955.rs:25:9
| |
@ -67,7 +67,7 @@ note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-71955.rs:48:24 --> $DIR/issue-71955.rs:48:24
| |
LL | foo(baz, "string", |s| s.0.len() == 5); LL | foo(baz, "string", |s| s.0.len() == 5);
| ^^^^^^^^^^^^^^^^^^ | ^^^
note: the lifetime requirement is introduced here note: the lifetime requirement is introduced here
--> $DIR/issue-71955.rs:25:44 --> $DIR/issue-71955.rs:25:44
| |

View file

@ -1,4 +1,4 @@
error[E0599]: the method `filterx` exists for struct `Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:36]>`, but its trait bounds were not satisfied error[E0599]: the method `filterx` exists for struct `Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:34]>`, but its trait bounds were not satisfied
--> $DIR/issue-30786.rs:118:22 --> $DIR/issue-30786.rs:118:22
| |
LL | pub struct Map<S, F> { LL | pub struct Map<S, F> {
@ -8,12 +8,12 @@ LL | pub struct Map<S, F> {
| doesn't satisfy `_: StreamExt` | doesn't satisfy `_: StreamExt`
... ...
LL | let filter = map.filterx(|x: &_| true); LL | let filter = map.filterx(|x: &_| true);
| ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:36]>` due to unsatisfied trait bounds | ^^^^^^^ method cannot be called on `Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:34]>` due to unsatisfied trait bounds
| |
note: the following trait bounds were not satisfied: note: the following trait bounds were not satisfied:
`&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:36]>: Stream` `&'a mut &Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:34]>: Stream`
`&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:36]>: Stream` `&'a mut &mut Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:34]>: Stream`
`&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:36]>: Stream` `&'a mut Map<Repeat, [closure@$DIR/issue-30786.rs:117:27: 117:34]>: Stream`
--> $DIR/issue-30786.rs:96:50 --> $DIR/issue-30786.rs:96:50
| |
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {} LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
@ -23,7 +23,7 @@ help: one of the expressions' fields has a method of the same name
LL | let filter = map.stream.filterx(|x: &_| true); LL | let filter = map.stream.filterx(|x: &_| true);
| +++++++ | +++++++
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>`, but its trait bounds were not satisfied error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>`, but its trait bounds were not satisfied
--> $DIR/issue-30786.rs:130:24 --> $DIR/issue-30786.rs:130:24
| |
LL | pub struct Filter<S, F> { LL | pub struct Filter<S, F> {
@ -33,12 +33,12 @@ LL | pub struct Filter<S, F> {
| doesn't satisfy `_: StreamExt` | doesn't satisfy `_: StreamExt`
... ...
LL | let count = filter.countx(); LL | let count = filter.countx();
| ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>` due to unsatisfied trait bounds | ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>` due to unsatisfied trait bounds
| |
note: the following trait bounds were not satisfied: note: the following trait bounds were not satisfied:
`&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>: Stream` `&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream`
`&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>: Stream` `&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream`
`&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:42]>: Stream` `&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream`
--> $DIR/issue-30786.rs:96:50 --> $DIR/issue-30786.rs:96:50
| |
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {} LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}

View file

@ -1,8 +1,8 @@
error[E0271]: type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]> as T0<'r, (&'r u8,)>>::O == <_ as Ty<'r>>::V` error[E0271]: type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:20]> as T0<'r, (&'r u8,)>>::O == <_ as Ty<'r>>::V`
--> $DIR/issue-62203-hrtb-ice.rs:38:19 --> $DIR/issue-62203-hrtb-ice.rs:38:19
| |
LL | let v = Unit2.m( LL | let v = Unit2.m(
| ^ type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]> as T0<'r, (&'r u8,)>>::O == <_ as Ty<'r>>::V` | ^ type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:20]> as T0<'r, (&'r u8,)>>::O == <_ as Ty<'r>>::V`
| |
note: expected this to be `<_ as Ty<'_>>::V` note: expected this to be `<_ as Ty<'_>>::V`
--> $DIR/issue-62203-hrtb-ice.rs:21:14 --> $DIR/issue-62203-hrtb-ice.rs:21:14
@ -22,7 +22,7 @@ LL | where
LL | F: for<'r> T0<'r, (<Self as Ty<'r>>::V,), O = <B as Ty<'r>>::V>, LL | F: for<'r> T0<'r, (<Self as Ty<'r>>::V,), O = <B as Ty<'r>>::V>,
| ^^^^^^^^^^^^^^^^^^^^ required by this bound in `T1::m` | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `T1::m`
error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39] as FnOnce<((&'r u8,),)>>::Output == Unit3` error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:20] as FnOnce<((&'r u8,),)>>::Output == Unit3`
--> $DIR/issue-62203-hrtb-ice.rs:40:9 --> $DIR/issue-62203-hrtb-ice.rs:40:9
| |
LL | let v = Unit2.m( LL | let v = Unit2.m(
@ -34,7 +34,7 @@ LL | | f : |x| { drop(x); Unit4 }
LL | | }); LL | | });
| |_________^ expected struct `Unit3`, found struct `Unit4` | |_________^ expected struct `Unit3`, found struct `Unit4`
| |
note: required because of the requirements on the impl of `for<'r> T0<'r, (&'r u8,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]>` note: required because of the requirements on the impl of `for<'r> T0<'r, (&'r u8,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:20]>`
--> $DIR/issue-62203-hrtb-ice.rs:17:16 --> $DIR/issue-62203-hrtb-ice.rs:17:16
| |
LL | impl<'a, A, T> T0<'a, A> for L<T> LL | impl<'a, A, T> T0<'a, A> for L<T>

View file

@ -14,7 +14,7 @@ note: required because it's used within this closure
--> $DIR/auto-trait-leak2.rs:10:5 --> $DIR/auto-trait-leak2.rs:10:5
| |
LL | move |x| p.set(x) LL | move |x| p.set(x)
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^
note: required because it appears within the type `impl Fn(i32)` note: required because it appears within the type `impl Fn(i32)`
--> $DIR/auto-trait-leak2.rs:5:16 --> $DIR/auto-trait-leak2.rs:5:16
| |
@ -42,7 +42,7 @@ note: required because it's used within this closure
--> $DIR/auto-trait-leak2.rs:38:5 --> $DIR/auto-trait-leak2.rs:38:5
| |
LL | move |x| p.set(x) LL | move |x| p.set(x)
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^
note: required because it appears within the type `impl Fn(i32)` note: required because it appears within the type `impl Fn(i32)`
--> $DIR/auto-trait-leak2.rs:33:15 --> $DIR/auto-trait-leak2.rs:33:15
| |

View file

@ -13,7 +13,7 @@ LL | | })
| |_____^ expected closure, found a different closure | |_____^ expected closure, found a different closure
| |
= note: expected opaque type `Closure` = note: expected opaque type `Closure`
found closure `[closure@$DIR/issue-74282.rs:8:15: 10:6]` found closure `[closure@$DIR/issue-74282.rs:8:15: 8:17]`
= note: no two closures, even if identical, have the same type = note: no two closures, even if identical, have the same type
= help: consider boxing your closure and/or using it as a trait object = help: consider boxing your closure and/or using it as a trait object
note: tuple struct defined here note: tuple struct defined here

View file

@ -100,7 +100,7 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appea
--> $DIR/must_outlive_least_region_or_bound.rs:38:5 --> $DIR/must_outlive_least_region_or_bound.rs:38:5
| |
LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) { LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) {
| -- hidden type `[closure@$DIR/must_outlive_least_region_or_bound.rs:38:5: 38:31]` captures the lifetime `'b` as defined here | -- hidden type `[closure@$DIR/must_outlive_least_region_or_bound.rs:38:5: 38:13]` captures the lifetime `'b` as defined here
LL | move |_| println!("{}", y) LL | move |_| println!("{}", y)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
| |

View file

@ -5,7 +5,7 @@ LL | fn foo() -> impl Trait<Assoc = Sendable> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Duh` is not implemented for `Sendable` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Duh` is not implemented for `Sendable`
| |
= help: the trait `Duh` is implemented for `i32` = help: the trait `Duh` is implemented for `i32`
note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait.rs:27:5: 27:10]` note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait.rs:27:5: 27:7]`
--> $DIR/nested-return-type2-tait.rs:14:31 --> $DIR/nested-return-type2-tait.rs:14:31
| |
LL | impl<R: Duh, F: FnMut() -> R> Trait for F { LL | impl<R: Duh, F: FnMut() -> R> Trait for F {

View file

@ -5,7 +5,7 @@ LL | fn foo() -> Traitable {
| ^^^^^^^^^ the trait `Duh` is not implemented for `Sendable` | ^^^^^^^^^ the trait `Duh` is not implemented for `Sendable`
| |
= help: the trait `Duh` is implemented for `i32` = help: the trait `Duh` is implemented for `i32`
note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait2.rs:28:5: 28:10]` note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait2.rs:28:5: 28:7]`
--> $DIR/nested-return-type2-tait2.rs:14:31 --> $DIR/nested-return-type2-tait2.rs:14:31
| |
LL | impl<R: Duh, F: FnMut() -> R> Trait for F { LL | impl<R: Duh, F: FnMut() -> R> Trait for F {

View file

@ -5,7 +5,7 @@ LL | fn foo() -> Traitable {
| ^^^^^^^^^ the trait `Duh` is not implemented for `impl Send` | ^^^^^^^^^ the trait `Duh` is not implemented for `impl Send`
| |
= help: the trait `Duh` is implemented for `i32` = help: the trait `Duh` is implemented for `i32`
note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait3.rs:27:5: 27:10]` note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait3.rs:27:5: 27:7]`
--> $DIR/nested-return-type2-tait3.rs:14:31 --> $DIR/nested-return-type2-tait3.rs:14:31
| |
LL | impl<R: Duh, F: FnMut() -> R> Trait for F { LL | impl<R: Duh, F: FnMut() -> R> Trait for F {

View file

@ -5,7 +5,7 @@ LL | fn foo() -> impl Trait<Assoc = impl Send> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Duh` is not implemented for `impl Send` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Duh` is not implemented for `impl Send`
| |
= help: the trait `Duh` is implemented for `i32` = help: the trait `Duh` is implemented for `i32`
note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2.rs:23:5: 23:10]` note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2.rs:23:5: 23:7]`
--> $DIR/nested-return-type2.rs:12:31 --> $DIR/nested-return-type2.rs:12:31
| |
LL | impl<R: Duh, F: FnMut() -> R> Trait for F { LL | impl<R: Duh, F: FnMut() -> R> Trait for F {

View file

@ -54,7 +54,7 @@ LL | fn closure_capture() -> impl Sized {
LL | / move || { LL | / move || {
LL | | x; LL | | x;
LL | | } LL | | }
| |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:35:5: 37:6]` | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:35:5: 35:12]`
error[E0720]: cannot resolve opaque type error[E0720]: cannot resolve opaque type
--> $DIR/recursive-impl-trait-type-indirect.rs:40:29 --> $DIR/recursive-impl-trait-type-indirect.rs:40:29
@ -65,7 +65,7 @@ LL | fn closure_ref_capture() -> impl Sized {
LL | / move || { LL | / move || {
LL | | &x; LL | | &x;
LL | | } LL | | }
| |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:43:5: 45:6]` | |_____- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:43:5: 43:12]`
error[E0720]: cannot resolve opaque type error[E0720]: cannot resolve opaque type
--> $DIR/recursive-impl-trait-type-indirect.rs:48:21 --> $DIR/recursive-impl-trait-type-indirect.rs:48:21
@ -74,7 +74,7 @@ LL | fn closure_sig() -> impl Sized {
| ^^^^^^^^^^ recursive opaque type | ^^^^^^^^^^ recursive opaque type
LL | LL |
LL | || closure_sig() LL | || closure_sig()
| ---------------- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:50:5: 50:21]` | ---------------- returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:50:5: 50:7]`
error[E0720]: cannot resolve opaque type error[E0720]: cannot resolve opaque type
--> $DIR/recursive-impl-trait-type-indirect.rs:53:23 --> $DIR/recursive-impl-trait-type-indirect.rs:53:23
@ -83,7 +83,7 @@ LL | fn generator_sig() -> impl Sized {
| ^^^^^^^^^^ recursive opaque type | ^^^^^^^^^^ recursive opaque type
LL | LL |
LL | || generator_sig() LL | || generator_sig()
| ------------------ returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:55:5: 55:23]` | ------------------ returning here with type `[closure@$DIR/recursive-impl-trait-type-indirect.rs:55:5: 55:7]`
error[E0720]: cannot resolve opaque type error[E0720]: cannot resolve opaque type
--> $DIR/recursive-impl-trait-type-indirect.rs:58:27 --> $DIR/recursive-impl-trait-type-indirect.rs:58:27
@ -95,7 +95,7 @@ LL | / move || {
LL | | yield; LL | | yield;
LL | | x; LL | | x;
LL | | } LL | | }
| |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:61:5: 64:6]` | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:61:5: 61:12]`
error[E0720]: cannot resolve opaque type error[E0720]: cannot resolve opaque type
--> $DIR/recursive-impl-trait-type-indirect.rs:67:35 --> $DIR/recursive-impl-trait-type-indirect.rs:67:35
@ -117,7 +117,7 @@ LL | | let x = generator_hold();
LL | | yield; LL | | yield;
LL | | x; LL | | x;
LL | | } LL | | }
| |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:74:5: 78:6]` | |_____- returning here with type `[generator@$DIR/recursive-impl-trait-type-indirect.rs:74:5: 74:12]`
error[E0720]: cannot resolve opaque type error[E0720]: cannot resolve opaque type
--> $DIR/recursive-impl-trait-type-indirect.rs:86:26 --> $DIR/recursive-impl-trait-type-indirect.rs:86:26

View file

@ -2,7 +2,7 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appea
--> $DIR/static-return-lifetime-infered.rs:7:9 --> $DIR/static-return-lifetime-infered.rs:7:9
| |
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> { LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
| ----- hidden type `Map<std::slice::Iter<'_, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:7:27: 7:34]>` captures the anonymous lifetime defined here | ----- hidden type `Map<std::slice::Iter<'_, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:7:27: 7:30]>` captures the anonymous lifetime defined here
LL | self.x.iter().map(|a| a.0) LL | self.x.iter().map(|a| a.0)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
@ -15,7 +15,7 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appea
--> $DIR/static-return-lifetime-infered.rs:7:9 --> $DIR/static-return-lifetime-infered.rs:7:9
| |
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> { LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
| ----- hidden type `Map<std::slice::Iter<'_, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:7:27: 7:34]>` captures the anonymous lifetime defined here | ----- hidden type `Map<std::slice::Iter<'_, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:7:27: 7:30]>` captures the anonymous lifetime defined here
LL | self.x.iter().map(|a| a.0) LL | self.x.iter().map(|a| a.0)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
@ -28,7 +28,7 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appea
--> $DIR/static-return-lifetime-infered.rs:12:9 --> $DIR/static-return-lifetime-infered.rs:12:9
| |
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> { LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
| -- hidden type `Map<std::slice::Iter<'a, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:12:27: 12:34]>` captures the lifetime `'a` as defined here | -- hidden type `Map<std::slice::Iter<'a, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:12:27: 12:30]>` captures the lifetime `'a` as defined here
LL | self.x.iter().map(|a| a.0) LL | self.x.iter().map(|a| a.0)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
@ -41,7 +41,7 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appea
--> $DIR/static-return-lifetime-infered.rs:12:9 --> $DIR/static-return-lifetime-infered.rs:12:9
| |
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> { LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
| -- hidden type `Map<std::slice::Iter<'a, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:12:27: 12:34]>` captures the lifetime `'a` as defined here | -- hidden type `Map<std::slice::Iter<'a, (u32, u32)>, [closure@$DIR/static-return-lifetime-infered.rs:12:27: 12:30]>` captures the lifetime `'a` as defined here
LL | self.x.iter().map(|a| a.0) LL | self.x.iter().map(|a| a.0)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
| |

View file

@ -11,7 +11,7 @@ note: required because it's used within this closure
--> $DIR/interior-mutability.rs:5:18 --> $DIR/interior-mutability.rs:5:18
| |
LL | catch_unwind(|| { x.set(23); }); LL | catch_unwind(|| { x.set(23); });
| ^^^^^^^^^^^^^^^^^ | ^^
note: required by a bound in `catch_unwind` note: required by a bound in `catch_unwind`
--> $SRC_DIR/std/src/panic.rs:LL:COL --> $SRC_DIR/std/src/panic.rs:LL:COL
| |

View file

@ -1,18 +1,18 @@
error[E0277]: the trait bound `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]: ~const FnOnce<()>` is not satisfied error[E0277]: the trait bound `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:29]: ~const FnOnce<()>` is not satisfied
--> $DIR/const-eval-select-bad.rs:6:27 --> $DIR/const-eval-select-bad.rs:6:27
| |
LL | const_eval_select((), || {}, || {}); LL | const_eval_select((), || {}, || {});
| ----------------- ^^^^^ expected an `FnOnce<()>` closure, found `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]` | ----------------- ^^^^^ expected an `FnOnce<()>` closure, found `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:29]`
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call
| |
= help: the trait `~const FnOnce<()>` is not implemented for `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]` = help: the trait `~const FnOnce<()>` is not implemented for `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:29]`
note: the trait `FnOnce<()>` is implemented for `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]`, but that implementation is not `const` note: the trait `FnOnce<()>` is implemented for `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:29]`, but that implementation is not `const`
--> $DIR/const-eval-select-bad.rs:6:27 --> $DIR/const-eval-select-bad.rs:6:27
| |
LL | const_eval_select((), || {}, || {}); LL | const_eval_select((), || {}, || {});
| ^^^^^ | ^^^^^
= note: wrap the `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:32]` in a closure with no arguments: `|| { /* code */ }` = note: wrap the `[closure@$DIR/const-eval-select-bad.rs:6:27: 6:29]` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `const_eval_select` note: required by a bound in `const_eval_select`
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
| |

View file

@ -11,7 +11,7 @@ note: this value implements `FnOnce`, which causes it to be moved when called
| |
LL | f(); LL | f();
| ^ | ^
= note: move occurs because `f` has type `[closure@$DIR/issue-12127.rs:8:24: 8:41]`, which does not implement the `Copy` trait = note: move occurs because `f` has type `[closure@$DIR/issue-12127.rs:8:24: 8:30]`, which does not implement the `Copy` trait
error: aborting due to previous error error: aborting due to previous error

View file

@ -16,18 +16,12 @@ LL | fn call_it<F>(f: F) where F: Fn() { f(); }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | call_it(|| { LL | call_it(|| {
| _____-------_- | ------- expects `Fn` instead of `FnMut`
| | | LL | call_it(|| x.gen());
| | expects `Fn` instead of `FnMut` LL | call_it(|| x.gen_mut());
LL | | call_it(|| x.gen()); | ^^ - mutable borrow occurs due to use of `x` in closure
LL | | call_it(|| x.gen_mut()); | |
| | ^^ - mutable borrow occurs due to use of `x` in closure | cannot borrow as mutable
| | |
| | cannot borrow as mutable
LL | |
LL | |
LL | | });
| |_____- in this closure
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,12 +2,12 @@ error[E0308]: mismatched types
--> $DIR/issue-24036.rs:3:9 --> $DIR/issue-24036.rs:3:9
| |
LL | let mut x = |c| c + 1; LL | let mut x = |c| c + 1;
| --------- the expected closure | --- the expected closure
LL | x = |c| c + 1; LL | x = |c| c + 1;
| ^^^^^^^^^ expected closure, found a different closure | ^^^^^^^^^ expected closure, found a different closure
| |
= note: expected closure `[closure@$DIR/issue-24036.rs:2:17: 2:26]` = note: expected closure `[closure@$DIR/issue-24036.rs:2:17: 2:20]`
found closure `[closure@$DIR/issue-24036.rs:3:9: 3:18]` found closure `[closure@$DIR/issue-24036.rs:3:9: 3:12]`
= note: no two closures, even if identical, have the same type = note: no two closures, even if identical, have the same type
= help: consider boxing your closure and/or using it as a trait object = help: consider boxing your closure and/or using it as a trait object

View file

@ -2,11 +2,13 @@ error[E0308]: mismatched types
--> $DIR/issue-3044.rs:3:35 --> $DIR/issue-3044.rs:3:35
| |
LL | needlesArr.iter().fold(|x, y| { LL | needlesArr.iter().fold(|x, y| {
| ___________________________________^ | ____________________________------_^
| | |
| | the expected closure
LL | | }); LL | | });
| |_____^ expected closure, found `()` | |_____^ expected closure, found `()`
| |
= note: expected closure `[closure@$DIR/issue-3044.rs:3:28: 4:6]` = note: expected closure `[closure@$DIR/issue-3044.rs:3:28: 3:34]`
found unit type `()` found unit type `()`
error[E0061]: this function takes 2 arguments but 1 argument was supplied error[E0061]: this function takes 2 arguments but 1 argument was supplied

View file

@ -1,4 +1,4 @@
error[E0271]: type mismatch resolving `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]> as Iterator>::Item == &_` error[E0271]: type mismatch resolving `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]> as Iterator>::Item == &_`
--> $DIR/issue-31173.rs:10:10 --> $DIR/issue-31173.rs:10:10
| |
LL | .cloned() LL | .cloned()
@ -12,11 +12,11 @@ note: required by a bound in `cloned`
LL | Self: Sized + Iterator<Item = &'a T>, LL | Self: Sized + Iterator<Item = &'a T>,
| ^^^^^^^^^^^^ required by this bound in `cloned` | ^^^^^^^^^^^^ required by this bound in `cloned`
error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>`, but its trait bounds were not satisfied error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>`, but its trait bounds were not satisfied
--> $DIR/issue-31173.rs:12:10 --> $DIR/issue-31173.rs:12:10
| |
LL | .collect(); LL | .collect();
| ^^^^^^^ method cannot be called on `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>` due to unsatisfied trait bounds | ^^^^^^^ method cannot be called on `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>` due to unsatisfied trait bounds
| |
::: $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL ::: $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL
| |
@ -29,10 +29,10 @@ LL | pub struct TakeWhile<I, P> {
| -------------------------- doesn't satisfy `<_ as Iterator>::Item = &_` | -------------------------- doesn't satisfy `<_ as Iterator>::Item = &_`
| |
= note: the following trait bounds were not satisfied: = note: the following trait bounds were not satisfied:
`<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]> as Iterator>::Item = &_` `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]> as Iterator>::Item = &_`
which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator` which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>: Iterator`
`Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator` `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>: Iterator`
which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>: Iterator` which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>: Iterator`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -5,7 +5,7 @@ LL | pub struct Iterate<T, F> {
| ------- method `iter` not found for this struct | ------- method `iter` not found for this struct
... ...
LL | println!("{:?}", a.iter().take(10).collect::<Vec<usize>>()); LL | println!("{:?}", a.iter().take(10).collect::<Vec<usize>>());
| ^^^^ method not found in `Iterate<{integer}, [closure@$DIR/issue-41880.rs:26:24: 26:31]>` | ^^^^ method not found in `Iterate<{integer}, [closure@$DIR/issue-41880.rs:26:24: 26:27]>`
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,9 +4,8 @@ error[E0507]: cannot move out of `*v`, as `v` is a captured variable in an `FnMu
LL | fn f<'r, T>(v: &'r T) -> Box<dyn FnMut() -> T + 'r> { LL | fn f<'r, T>(v: &'r T) -> Box<dyn FnMut() -> T + 'r> {
| - captured outer variable | - captured outer variable
LL | id(Box::new(|| *v)) LL | id(Box::new(|| *v))
| ---^^ | -- ^^ move occurs because `*v` has type `T`, which does not implement the `Copy` trait
| | | | |
| | move occurs because `*v` has type `T`, which does not implement the `Copy` trait
| captured by this `FnMut` closure | captured by this `FnMut` closure
error: aborting due to previous error error: aborting due to previous error

View file

@ -5,7 +5,7 @@ LL | Square = |x| x,
| ^^^^^ expected `isize`, found closure | ^^^^^ expected `isize`, found closure
| |
= note: expected type `isize` = note: expected type `isize`
found closure `[closure@$DIR/issue-48838.rs:2:14: 2:19]` found closure `[closure@$DIR/issue-48838.rs:2:14: 2:17]`
error: aborting due to previous error error: aborting due to previous error

View file

@ -5,7 +5,7 @@ LL | fn([u8; |x: u8| {}]),
| ^^^^^^^^^^ expected `usize`, found closure | ^^^^^^^^^^ expected `usize`, found closure
| |
= note: expected type `usize` = note: expected type `usize`
found closure `[closure@$DIR/issue-50600.rs:2:13: 2:23]` found closure `[closure@$DIR/issue-50600.rs:2:13: 2:20]`
error: aborting due to previous error error: aborting due to previous error

View file

@ -5,7 +5,7 @@ LL | [1; || {}];
| ^^^^^ expected `usize`, found closure | ^^^^^ expected `usize`, found closure
| |
= note: expected type `usize` = note: expected type `usize`
found closure `[closure@$DIR/issue-50688.rs:2:9: 2:14]` found closure `[closure@$DIR/issue-50688.rs:2:9: 2:11]`
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,7 +9,7 @@ LL | let _: Box<F> = Box::new(|| ());
| arguments to this function are incorrect | arguments to this function are incorrect
| |
= note: expected type parameter `F` = note: expected type parameter `F`
found closure `[closure@$DIR/issue-51154.rs:2:30: 2:35]` found closure `[closure@$DIR/issue-51154.rs:2:30: 2:32]`
= help: every closure has a distinct type and so could not always match the caller-chosen type of parameter `F` = help: every closure has a distinct type and so could not always match the caller-chosen type of parameter `F`
note: associated function defined here note: associated function defined here
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL --> $SRC_DIR/alloc/src/boxed.rs:LL:COL

View file

@ -2,16 +2,16 @@ error[E0277]: `Rc<usize>` cannot be sent between threads safely
--> $DIR/kindck-nonsendable-1.rs:9:5 --> $DIR/kindck-nonsendable-1.rs:9:5
| |
LL | bar(move|| foo(x)); LL | bar(move|| foo(x));
| ^^^ ------------- within this `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22]` | ^^^ ------ within this `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:15]`
| | | |
| `Rc<usize>` cannot be sent between threads safely | `Rc<usize>` cannot be sent between threads safely
| |
= help: within `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22]`, the trait `Send` is not implemented for `Rc<usize>` = help: within `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:15]`, the trait `Send` is not implemented for `Rc<usize>`
note: required because it's used within this closure note: required because it's used within this closure
--> $DIR/kindck-nonsendable-1.rs:9:9 --> $DIR/kindck-nonsendable-1.rs:9:9
| |
LL | bar(move|| foo(x)); LL | bar(move|| foo(x));
| ^^^^^^^^^^^^^ | ^^^^^^
note: required by a bound in `bar` note: required by a bound in `bar`
--> $DIR/kindck-nonsendable-1.rs:5:21 --> $DIR/kindck-nonsendable-1.rs:5:21
| |

View file

@ -37,7 +37,7 @@ note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-79187-2.rs:8:14 --> $DIR/issue-79187-2.rs:8:14
| |
LL | take_foo(|a| a); LL | take_foo(|a| a);
| ^^^^^ | ^^^
note: the lifetime requirement is introduced here note: the lifetime requirement is introduced here
--> $DIR/issue-79187-2.rs:5:21 --> $DIR/issue-79187-2.rs:5:21
| |

View file

@ -10,7 +10,7 @@ note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-79187.rs:4:13 --> $DIR/issue-79187.rs:4:13
| |
LL | let f = |_| (); LL | let f = |_| ();
| ^^^^^^ | ^^^
note: the lifetime requirement is introduced here note: the lifetime requirement is introduced here
--> $DIR/issue-79187.rs:1:18 --> $DIR/issue-79187.rs:1:18
| |

View file

@ -128,7 +128,7 @@ LL | let _ = &baz as &dyn Fn(i32);
| |
= help: cast can be replaced by coercion; this might require a temporary variable = help: cast can be replaced by coercion; this might require a temporary variable
error: trivial cast: `&[closure@$DIR/trivial_casts.rs:72:13: 72:25]` as `&dyn Fn(i32)` error: trivial cast: `&[closure@$DIR/trivial_casts.rs:72:13: 72:22]` as `&dyn Fn(i32)`
--> $DIR/trivial_casts.rs:73:13 --> $DIR/trivial_casts.rs:73:13
| |
LL | let _ = &x as &dyn Fn(i32); LL | let _ = &x as &dyn Fn(i32);

View file

@ -9,7 +9,7 @@ help: use parentheses to call the method
LL | .get_x(); LL | .get_x();
| ++ | ++
error[E0615]: attempted to take value of method `filter_map` on type `Filter<Map<std::slice::Iter<'_, {integer}>, [closure@$DIR/method-missing-call.rs:27:20: 27:25]>, [closure@$DIR/method-missing-call.rs:28:23: 28:35]>` error[E0615]: attempted to take value of method `filter_map` on type `Filter<Map<std::slice::Iter<'_, {integer}>, [closure@$DIR/method-missing-call.rs:27:20: 27:23]>, [closure@$DIR/method-missing-call.rs:28:23: 28:28]>`
--> $DIR/method-missing-call.rs:29:16 --> $DIR/method-missing-call.rs:29:16
| |
LL | .filter_map; LL | .filter_map;

View file

@ -23,7 +23,7 @@ error[E0599]: no method named `extend` found for struct `Map` in the current sco
--> $DIR/method-not-found-generic-arg-elision.rs:87:29 --> $DIR/method-not-found-generic-arg-elision.rs:87:29
| |
LL | v.iter().map(|x| x * x).extend(std::iter::once(100)); LL | v.iter().map(|x| x * x).extend(std::iter::once(100));
| ^^^^^^ method not found in `Map<std::slice::Iter<'_, i32>, [closure@$DIR/method-not-found-generic-arg-elision.rs:87:18: 87:27]>` | ^^^^^^ method not found in `Map<std::slice::Iter<'_, i32>, [closure@$DIR/method-not-found-generic-arg-elision.rs:87:18: 87:21]>`
error[E0599]: no method named `method` found for struct `Wrapper<bool>` in the current scope error[E0599]: no method named `method` found for struct `Wrapper<bool>` in the current scope
--> $DIR/method-not-found-generic-arg-elision.rs:90:13 --> $DIR/method-not-found-generic-arg-elision.rs:90:13

View file

@ -2,7 +2,7 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/closure-arg-type-mismatch.rs:3:14 --> $DIR/closure-arg-type-mismatch.rs:3:14
| |
LL | a.iter().map(|_: (u32, u32)| 45); LL | a.iter().map(|_: (u32, u32)| 45);
| ^^^ ------------------ found signature of `fn((u32, u32)) -> _` | ^^^ --------------- found signature of `fn((u32, u32)) -> _`
| | | |
| expected signature of `fn(&(u32, u32)) -> _` | expected signature of `fn(&(u32, u32)) -> _`
| |
@ -16,7 +16,7 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/closure-arg-type-mismatch.rs:4:14 --> $DIR/closure-arg-type-mismatch.rs:4:14
| |
LL | a.iter().map(|_: &(u16, u16)| 45); LL | a.iter().map(|_: &(u16, u16)| 45);
| ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _` | ^^^ ---------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _`
| | | |
| expected signature of `fn(&(u32, u32)) -> _` | expected signature of `fn(&(u32, u32)) -> _`
| |
@ -30,7 +30,7 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/closure-arg-type-mismatch.rs:5:14 --> $DIR/closure-arg-type-mismatch.rs:5:14
| |
LL | a.iter().map(|_: (u16, u16)| 45); LL | a.iter().map(|_: (u16, u16)| 45);
| ^^^ ------------------ found signature of `fn((u16, u16)) -> _` | ^^^ --------------- found signature of `fn((u16, u16)) -> _`
| | | |
| expected signature of `fn(&(u32, u32)) -> _` | expected signature of `fn(&(u32, u32)) -> _`
| |

View file

@ -19,7 +19,7 @@ note: this closure does not fulfill the lifetime requirements
--> $DIR/closure-mismatch.rs:8:9 --> $DIR/closure-mismatch.rs:8:9
| |
LL | baz(|_| ()); LL | baz(|_| ());
| ^^^^^^ | ^^^
note: the lifetime requirement is introduced here note: the lifetime requirement is introduced here
--> $DIR/closure-mismatch.rs:5:11 --> $DIR/closure-mismatch.rs:5:11
| |

View file

@ -2,7 +2,7 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/issue-36053-2.rs:7:32 --> $DIR/issue-36053-2.rs:7:32
| |
LL | once::<&str>("str").fuse().filter(|a: &str| true).count(); LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
| ^^^^^^ -------------- found signature of `for<'r> fn(&'r str) -> _` | ^^^^^^ --------- found signature of `for<'r> fn(&'r str) -> _`
| | | |
| expected signature of `for<'r> fn(&'r &str) -> _` | expected signature of `for<'r> fn(&'r &str) -> _`
| |
@ -12,11 +12,11 @@ note: required by a bound in `filter`
LL | P: FnMut(&Self::Item) -> bool, LL | P: FnMut(&Self::Item) -> bool,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `filter` | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `filter`
error[E0599]: the method `count` exists for struct `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>`, but its trait bounds were not satisfied error[E0599]: the method `count` exists for struct `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>`, but its trait bounds were not satisfied
--> $DIR/issue-36053-2.rs:7:55 --> $DIR/issue-36053-2.rs:7:55
| |
LL | once::<&str>("str").fuse().filter(|a: &str| true).count(); LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
| -------------- ^^^^^ method cannot be called on `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>` due to unsatisfied trait bounds | --------- ^^^^^ method cannot be called on `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>` due to unsatisfied trait bounds
| | | |
| doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool` | doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool`
| doesn't satisfy `_: FnMut<(&&str,)>` | doesn't satisfy `_: FnMut<(&&str,)>`
@ -27,12 +27,12 @@ LL | pub struct Filter<I, P> {
| ----------------------- doesn't satisfy `_: Iterator` | ----------------------- doesn't satisfy `_: Iterator`
| |
= note: the following trait bounds were not satisfied: = note: the following trait bounds were not satisfied:
`<[closure@$DIR/issue-36053-2.rs:7:39: 7:53] as FnOnce<(&&str,)>>::Output = bool` `<[closure@$DIR/issue-36053-2.rs:7:39: 7:48] as FnOnce<(&&str,)>>::Output = bool`
which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>: Iterator` which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
`[closure@$DIR/issue-36053-2.rs:7:39: 7:53]: FnMut<(&&str,)>` `[closure@$DIR/issue-36053-2.rs:7:39: 7:48]: FnMut<(&&str,)>`
which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>: Iterator` which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
`Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>: Iterator` `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
which is required by `&mut Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>: Iterator` which is required by `&mut Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -4,9 +4,8 @@ error[E0507]: cannot move out of `i`, a captured variable in an `Fn` closure
LL | let i = Box::new(3); LL | let i = Box::new(3);
| - captured outer variable | - captured outer variable
LL | let _f = to_fn(|| test(i)); LL | let _f = to_fn(|| test(i));
| --------^- | -- ^ move occurs because `i` has type `Box<usize>`, which does not implement the `Copy` trait
| | | | |
| | move occurs because `i` has type `Box<usize>`, which does not implement the `Copy` trait
| captured by this `Fn` closure | captured by this `Fn` closure
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,4 +1,4 @@
error[E0271]: type mismatch resolving `<[closure@$DIR/fallback-closure-wrap.rs:18:40: 21:6] as FnOnce<()>>::Output == ()` error[E0271]: type mismatch resolving `<[closure@$DIR/fallback-closure-wrap.rs:18:40: 18:47] as FnOnce<()>>::Output == ()`
--> $DIR/fallback-closure-wrap.rs:18:31 --> $DIR/fallback-closure-wrap.rs:18:31
| |
LL | let error = Closure::wrap(Box::new(move || { LL | let error = Closure::wrap(Box::new(move || {
@ -10,7 +10,7 @@ LL | | }) as Box<dyn FnMut()>);
| |
= note: expected unit type `()` = note: expected unit type `()`
found type `!` found type `!`
= note: required for the cast from `[closure@$DIR/fallback-closure-wrap.rs:18:40: 21:6]` to the object type `dyn FnMut()` = note: required for the cast from `[closure@$DIR/fallback-closure-wrap.rs:18:40: 18:47]` to the object type `dyn FnMut()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -41,15 +41,11 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(|| { LL | fn_ref(|| {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | LL | ||
| | expects `Fn` instead of `FnMut` | ^^ cannot borrow as mutable
LL | | || LL | x = 1;}
| | ^^ cannot borrow as mutable | - mutable borrow occurs due to use of `x` in closure
LL | | x = 1;}
| |__________-_____- in this closure
| |
| mutable borrow occurs due to use of `x` in closure
error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
--> $DIR/closure-captures.rs:31:9 --> $DIR/closure-captures.rs:31:9
@ -58,15 +54,11 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(move || { LL | fn_ref(move || {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | LL | ||
| | expects `Fn` instead of `FnMut` | ^^ cannot borrow as mutable
LL | | || LL | x = 1;});
| | ^^ cannot borrow as mutable | - mutable borrow occurs due to use of `x` in closure
LL | | x = 1;});
| |_____-_____- in this closure
| |
| mutable borrow occurs due to use of `x` in closure
error[E0594]: cannot assign to `x`, as it is not declared as mutable error[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/closure-captures.rs:39:10 --> $DIR/closure-captures.rs:39:10
@ -84,15 +76,11 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(|| { LL | fn_ref(|| {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | LL | ||
| | expects `Fn` instead of `FnMut` | ^^ cannot borrow as mutable
LL | | || LL | x = 1;}
| | ^^ cannot borrow as mutable | - mutable borrow occurs due to use of `x` in closure
LL | | x = 1;}
| |__________-_____- in this closure
| |
| mutable borrow occurs due to use of `x` in closure
error[E0594]: cannot assign to `x`, as it is not declared as mutable error[E0594]: cannot assign to `x`, as it is not declared as mutable
--> $DIR/closure-captures.rs:43:5 --> $DIR/closure-captures.rs:43:5
@ -110,15 +98,11 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(move || { LL | fn_ref(move || {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | LL | ||
| | expects `Fn` instead of `FnMut` | ^^ cannot borrow as mutable
LL | | || LL | x = 1;});
| | ^^ cannot borrow as mutable | - mutable borrow occurs due to use of `x` in closure
LL | | x = 1;});
| |_____-_____- in this closure
| |
| mutable borrow occurs due to use of `x` in closure
error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
--> $DIR/closure-captures.rs:48:9 --> $DIR/closure-captures.rs:48:9
@ -127,15 +111,11 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(|| { LL | fn_ref(|| {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | LL | ||
| | expects `Fn` instead of `FnMut` | ^^ cannot borrow as mutable
LL | | || LL | *x = 1;});
| | ^^ cannot borrow as mutable | -- mutable borrow occurs due to use of `x` in closure
LL | | *x = 1;});
| |_________--_____- in this closure
| |
| mutable borrow occurs due to use of `x` in closure
error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
--> $DIR/closure-captures.rs:51:9 --> $DIR/closure-captures.rs:51:9
@ -144,15 +124,11 @@ LL | fn fn_ref<F: Fn()>(f: F) -> F { f }
| - change this to accept `FnMut` instead of `Fn` | - change this to accept `FnMut` instead of `Fn`
... ...
LL | fn_ref(move || { LL | fn_ref(move || {
| _____------_- | ------ expects `Fn` instead of `FnMut`
| | | LL | ||
| | expects `Fn` instead of `FnMut` | ^^ cannot borrow as mutable
LL | | || LL | *x = 1;});
| | ^^ cannot borrow as mutable | -- mutable borrow occurs due to use of `x` in closure
LL | | *x = 1;});
| |_________--_____- in this closure
| |
| mutable borrow occurs due to use of `x` in closure
error: aborting due to 12 previous errors error: aborting due to 12 previous errors

View file

@ -2,7 +2,7 @@ note: no external requirements
--> $DIR/escape-argument-callee.rs:26:38 --> $DIR/escape-argument-callee.rs:26:38
| |
LL | let mut closure = expect_sig(|p, y| *p = y); LL | let mut closure = expect_sig(|p, y| *p = y);
| ^^^^^^^^^^^^^ | ^^^^^^
| |
= note: defining type: test::{closure#0} with closure substs [ = note: defining type: test::{closure#0} with closure substs [
i16, i16,

View file

@ -2,7 +2,7 @@ note: no external requirements
--> $DIR/escape-argument.rs:26:38 --> $DIR/escape-argument.rs:26:38
| |
LL | let mut closure = expect_sig(|p, y| *p = y); LL | let mut closure = expect_sig(|p, y| *p = y);
| ^^^^^^^^^^^^^ | ^^^^^^
| |
= note: defining type: test::{closure#0} with closure substs [ = note: defining type: test::{closure#0} with closure substs [
i16, i16,

View file

@ -2,7 +2,7 @@ note: external requirements
--> $DIR/escape-upvar-nested.rs:21:32 --> $DIR/escape-upvar-nested.rs:21:32
| |
LL | let mut closure1 = || p = &y; LL | let mut closure1 = || p = &y;
| ^^^^^^^^^ | ^^
| |
= note: defining type: test::{closure#0}::{closure#0} with closure substs [ = note: defining type: test::{closure#0}::{closure#0} with closure substs [
i16, i16,
@ -16,11 +16,7 @@ note: external requirements
--> $DIR/escape-upvar-nested.rs:20:27 --> $DIR/escape-upvar-nested.rs:20:27
| |
LL | let mut closure = || { LL | let mut closure = || {
| ___________________________^ | ^^
LL | | let mut closure1 = || p = &y;
LL | | closure1();
LL | | };
| |_________^
| |
= note: defining type: test::{closure#0} with closure substs [ = note: defining type: test::{closure#0} with closure substs [
i16, i16,

Some files were not shown because too many files have changed in this diff Show more