Change:
When trying to compile the tests for my I get this error: <details<summary</summary</detailsMy understanding is that the compiler was trying to tell me about a borrow checker error; but I have no idea where to start minimizing this error(sorry).
I have managed to get it down to two files: It doesn't work with a in the , it has to be a different file. is then needed to trigger the ICE.
modify labels: I-ICE A-macros C-Bug T-compiler
cc
Seems to be related to 2018 edition? If I use the nightly-2018-10-01 and execute it doesn't ICE, but with it does ICE. well...
Most likely related to the fact that NLL is active in Rust 2018 then.
Bisecting: Somewhere in
Confirmed. gave me the ICE on 2015 as well (forgot that in the good ol' days nll was not a thing) Also confirmed, that edition 2015 does ICE with on and not on (like edition 2018 did above).
Also ICE with

Discussion:
"{:?}", move_place.ty(self.body, self.infcx.tcx).ty, ); <del> let snippet = self.infcx.tcx.sess.source_map().span_to_snippet(span).unwrap(); let is_option = move_ty.starts_with("std::option::Option"); let is_result = move_ty.starts_with("std::result::Result"); if  is_option || is_result { err.span_suggestion( span, &format!("consider borrowing the `{}`'s content", if is_option { "Option" } else { "Result" }), format!("{}.as_ref()", snippet), Applicability::MaybeIncorrect, ); </del> <ins> if let Ok(snippet) = self.infcx.tcx.sess.source_map().span_to_snippet(span) { let is_option = move_ty.starts_with("std::option::Option"); let is_result = move_ty.starts_with("std::result::Result"); if is_option || is_result { err.span_suggestion( span, &format!("consider borrowing the `{}`'s content", if is_option { "Option" } else { "Result" }), format!("{}.as_ref()", snippet), Applicability::MaybeIncorrect, ); } </ins> } err }

err: &mut DiagnosticBuilder<'a>, span: Span, ) { <del> let snippet = self.infcx.tcx.sess.source_map().span_to_snippet(span).unwrap(); </del> match error { GroupedMoveError::MovesFromPlace { mut binds_to, move_from, .. } => { <del> err.span_suggestion( span, "consider borrowing here", format!("&{}", snippet), Applicability::Unspecified, ); </del> <ins> if let Ok(snippet) = self.infcx.tcx.sess.source_map().span_to_snippet(span) { err.span_suggestion( span, "consider borrowing here", format!("&{}", snippet), Applicability::Unspecified, ); } </ins> if binds_to.is_empty() { let place_ty = move_from.ty(self.body, self.infcx.tcx).ty;

.. })) ) = bind_to.is_user_variable { <del> let pat_snippet = self.infcx.tcx.sess.source_map() .span_to_snippet(pat_span) .unwrap(); if pat_snippet.starts_with('&') { let pat_snippet = pat_snippet[1..].trim_start(); let suggestion; let to_remove; if pat_snippet.starts_with("mut") && pat_snippet["mut".len()..].starts_with(Pattern_White_Space) { suggestion = pat_snippet["mut".len()..].trim_start(); to_remove = "&mut"; } else { suggestion = pat_snippet; to_remove = "&"; </del> <ins> if let Ok(pat_snippet) = self.infcx.tcx.sess.source_map().span_to_snippet(pat_span) { if pat_snippet.starts_with('&') { let pat_snippet = pat_snippet[1..].trim_start(); let suggestion; let to_remove; if pat_snippet.starts_with("mut") && pat_snippet["mut".len()..].starts_with(Pattern_White_Space) { suggestion = pat_snippet["mut".len()..].trim_start(); to_remove = "&mut"; } else { suggestion = pat_snippet; to_remove = "&"; } suggestions.push(( pat_span, to_remove, suggestion.to_owned(), )); </ins> } <del> suggestions.push(( pat_span, to_remove, suggestion.to_owned(), )); </del> } } }

} /// If possible, suggest replacing `ref` with `ref mut`. <del> fn suggest_ref_mut(tcx: TyCtxt<'_>, binding_span: Span) -> Option<(String)> { let hi_src = tcx.sess.source_map().span_to_snippet(binding_span).unwrap(); </del> <ins> fn suggest_ref_mut(tcx: TyCtxt<'_>, binding_span: Span) -> Option<String> { let hi_src = tcx.sess.source_map().span_to_snippet(binding_span).ok()?; </ins> if hi_src.starts_with("ref") && hi_src["ref".len()..].starts_with(Pattern_White_Space) {

<ins> // ignore-test macro_rules! aaa { ($c:ident) => {{ let a = $c; }} } </ins>

<ins> // Test that we don't ICE after trying to construct a cross-file snippet #63800. // compile-flags: --test #[macro_use] #[path = "move-error-snippets-ext.rs"] mod move_error_snippets_ext; struct A; macro_rules! sss { () => { #[test] fn fff() { static D: A = A; aaa!(D);         //~ ERROR cannot move } }; } sss!(); fn main() {} </ins>

<ins> error[E0507]: cannot move out of static item `D` --> $DIR/move-error-snippets.rs:16:18 | LL | | #[macro_use] | |__________________^ move occurs because `D` has type `A`, which does not implement the `Copy` trait ... LL |               aaa!(D); |  __________________^ ... LL |   sss!(); |   ------- in this macro invocation error: aborting due to previous error For more information about this error, try `rustc --explain E0507`. </ins>