1
Fork 0
rust/compiler/rustc_builtin_macros/src
bors e0d9f79399 Auto merge of #80851 - m-ou-se:panic-2021, r=petrochenkov
Implement Rust 2021 panic

This implements the Rust 2021 versions of `panic!()`. See https://github.com/rust-lang/rust/issues/80162 and https://github.com/rust-lang/rfcs/pull/3007.

It does so by replacing `{std, core}::panic!()` by a bulitin macro that expands to either `$crate::panic::panic_2015!(..)` or `$crate::panic::panic_2021!(..)` depending on the edition of the caller.

This does not yet make std's panic an alias for core's panic on Rust 2021 as the RFC proposes. That will be a separate change: c5273bdfb2 That change is blocked on figuring out what to do with https://github.com/rust-lang/rust/issues/80846 first.
2021-02-01 10:25:31 +00:00
..
deriving reduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats) 2021-01-02 20:09:17 +01:00
format_foreign mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
asm.rs rustc_parse: Make Parser::unexpected public and use it in built-in macros 2020-10-06 00:23:36 +03:00
assert.rs Only call span.rust_2021() when necessary. 2021-01-24 14:19:05 +01:00
cfg.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
cfg_accessible.rs expand: Tell built-in macros whether we are currently in forced expansion mode 2020-11-19 19:25:20 +03:00
cmdline_attrs.rs Unconditionally capture tokens for attributes. 2020-10-21 18:57:29 -04:00
compile_error.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
concat.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
concat_idents.rs expand: Stop un-interpolating NtIdents before passing them to built-in macros 2020-09-28 23:10:44 +03:00
env.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
format.rs use matches!() macro in more places 2020-12-24 13:35:12 +01:00
format_foreign.rs use matches!() macro in more places 2020-12-24 13:35:12 +01:00
global_allocator.rs Handle Annotatable::Stmt in some builtin macros 2020-11-24 14:04:32 -05:00
global_asm.rs Attach TokenStream to ast::Visibility 2020-09-10 17:33:06 -04:00
lib.rs Implement new panic!() behaviour for Rust 2021. 2021-01-25 13:48:11 +01:00
llvm_asm.rs Rollup merge of #80495 - jyn514:rename-empty, r=petrochenkov 2020-12-30 20:56:58 +00:00
log_syntax.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
panic.rs Implement new panic!() behaviour for Rust 2021. 2021-01-25 13:48:11 +01:00
proc_macro_harness.rs use matches!() macro in more places 2020-12-24 13:35:12 +01:00
source_util.rs Force token collection to run when parsing nonterminals 2021-01-20 18:09:32 -05:00
standard_library_imports.rs cleanup: Remove ParseSess::injected_crate_name 2020-11-13 00:59:57 +03:00
test.rs Handle Annotatable::Stmt in some builtin macros 2020-11-24 14:04:32 -05:00
test_harness.rs Changed unwrap_or to unwrap_or_else in some places. 2020-11-10 20:07:47 -08:00
trace_macros.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
util.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00