diff options
| author | Matthew Jasper <mjjasper1@gmail.com> | 2019-09-14 21:17:11 +0100 |
|---|---|---|
| committer | Matthew Jasper <mjjasper1@gmail.com> | 2019-09-15 09:15:38 +0100 |
| commit | 8ab67c8f560a730b8978f4a42deb70d01ca1cdfc (patch) | |
| tree | 5b6728330dafce3a7036175624022ec9168e1e05 /src/libsyntax_ext/assert.rs | |
| parent | 5ae3830d589ec75494ff26bd9c92e9f77e49173f (diff) | |
| download | rust-8ab67c8f560a730b8978f4a42deb70d01ca1cdfc.tar.gz rust-8ab67c8f560a730b8978f4a42deb70d01ca1cdfc.zip | |
Remove `with_legacy_ctxt`
Diffstat (limited to 'src/libsyntax_ext/assert.rs')
| -rw-r--r-- | src/libsyntax_ext/assert.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax_ext/assert.rs b/src/libsyntax_ext/assert.rs index 001996e1db7..cbfe14fa439 100644 --- a/src/libsyntax_ext/assert.rs +++ b/src/libsyntax_ext/assert.rs @@ -23,7 +23,9 @@ pub fn expand_assert<'cx>( } }; - let sp = cx.with_legacy_ctxt(sp); + // `core::panic` and `std::panic` are different macros, so we use call-site + // context to pick up whichever is currently in scope. + let sp = cx.with_call_site_ctxt(sp); let panic_call = Mac { path: Path::from_ident(Ident::new(sym::panic, sp)), tts: custom_message.unwrap_or_else(|| { |
