-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #97654 - Dylan-DPC:rollup-w6zrzxf, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #97420 (Be a little nicer with casts when formatting `fn` pointers) - #97450 ([RFC 2011] Basic compiler infrastructure) - #97599 (Fix JSON reexport ICE) - #97617 (Rustdoc anonymous reexports) - #97636 (Revert #96682.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
31 changed files
with
336 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use rustc_ast::{ptr::P, Expr, Path}; | ||
use rustc_expand::base::ExtCtxt; | ||
use rustc_span::Span; | ||
|
||
pub(super) struct Context<'cx, 'a> { | ||
cx: &'cx ExtCtxt<'a>, | ||
span: Span, | ||
} | ||
|
||
impl<'cx, 'a> Context<'cx, 'a> { | ||
pub(super) fn new(cx: &'cx ExtCtxt<'a>, span: Span) -> Self { | ||
Self { cx, span } | ||
} | ||
|
||
/// Builds the whole `assert!` expression. | ||
/// | ||
/// { | ||
/// use ::core::asserting::{ ... }; | ||
/// | ||
/// let mut __capture0 = Capture::new(); | ||
/// ... | ||
/// ... | ||
/// ... | ||
/// | ||
/// if !{ | ||
/// ... | ||
/// ... | ||
/// ... | ||
/// } { | ||
/// panic!( | ||
/// "Assertion failed: ... \n With expansion: ...", | ||
/// __capture0, | ||
/// ... | ||
/// ... | ||
/// ... | ||
/// ); | ||
/// } | ||
/// } | ||
pub(super) fn build(self, _cond_expr: P<Expr>, _panic_path: Path) -> P<Expr> { | ||
let Self { cx, span, .. } = self; | ||
let stmts = Vec::new(); | ||
cx.expr_block(cx.block(span, stmts)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.