Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #124646

Merged
merged 34 commits into from
May 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1a83bea
Impl `DerefPure` for more std types
Nadrieril Mar 29, 2024
6b6bc98
io safety: update Unix explanation
RalfJung Apr 26, 2024
825a3b1
String.truncate calls Vec.truncate, in turn, and that states
deep-outcome Apr 27, 2024
f840da7
WS fix.
deep-outcome Apr 27, 2024
42ecde4
run-make-support: preserve tooks.mk behavior for EXTRACXXFLAGS
jieyouxu May 1, 2024
9af3b1e
library/std: Remove unused `gimli-symbolize` feature
Enselic May 2, 2024
dbe2f51
const_eval_select: add tracking issue
RalfJung May 2, 2024
ff2ff97
variable-precision float operations behave non-deterministically
RalfJung May 2, 2024
3722eb0
Tweak `consts_may_unify`.
nnethercote May 2, 2024
aabb90d
rustc_expand: clean up attributes.
nnethercote Apr 28, 2024
d817856
Remove an unnecessary re-export of `rustc_span::hygiene`.
nnethercote Apr 29, 2024
7c6d363
Remove an unnecessary `#[macro_use]`.
nnethercote Apr 29, 2024
3f05589
Remove unused `ExpCtxt` methods.
nnethercote Apr 30, 2024
189a8a6
De-`pub` some `rustc_expand` modules.
nnethercote Apr 30, 2024
e809df6
Remove unnecessary re-export of `MacroKind`.
nnethercote Apr 30, 2024
d7f5319
Inline and remove three `DummyResult` methods.
nnethercote Apr 30, 2024
c9c964f
Fix some comment formatting.
nnethercote Apr 30, 2024
79c4d02
Remove unnecessary `pub`s.
nnethercote Apr 30, 2024
3b69781
Tweak `fully_expand_fragment` loop.
nnethercote May 1, 2024
1c15b6a
Replace a hard-to-read line.
nnethercote May 1, 2024
ae7e328
Introduce `Invocation::span_mut`.
nnethercote May 1, 2024
5ac017e
Type annotate `repeats`.
nnethercote May 2, 2024
3a3a15d
Refactor `Frame`.
nnethercote May 2, 2024
3a3df3e
AST pretty: Use `builtin_syntax` for type ascription
fmease May 2, 2024
e17a222
Rollup merge of #123480 - Nadrieril:impl-all-derefpures, r=compiler-e…
matthiaskrgr May 3, 2024
9ab5cfd
Rollup merge of #124412 - RalfJung:io-safety, r=Amanieu
matthiaskrgr May 3, 2024
d7a8936
Rollup merge of #124441 - bravequickcleverfibreyarn:string.rs, r=Amanieu
matthiaskrgr May 3, 2024
30efce9
Rollup merge of #124594 - jieyouxu:rmake-cc, r=fmease
matthiaskrgr May 3, 2024
bd6276c
Rollup merge of #124604 - Enselic:std-gimli-symbolize, r=workingjubilee
matthiaskrgr May 3, 2024
ad0be15
Rollup merge of #124607 - nnethercote:rustc_expand-cleanups, r=compil…
matthiaskrgr May 3, 2024
c412751
Rollup merge of #124609 - RalfJung:float-precision, r=cuviper
matthiaskrgr May 3, 2024
a9edd38
Rollup merge of #124610 - nnethercote:typenum, r=lcnr
matthiaskrgr May 3, 2024
e2a5344
Rollup merge of #124626 - RalfJung:const_eval_select, r=joboet
matthiaskrgr May 3, 2024
e6c82d9
Rollup merge of #124637 - fmease:ast-pretty-ty-asc-builtin-syn, r=com…
matthiaskrgr May 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Inline and remove three DummyResult methods.
They each have a single call site.
  • Loading branch information
nnethercote committed May 2, 2024
commit d7f5319b6db4cac89b7989ecfbb1f511a95826e6
54 changes: 22 additions & 32 deletions compiler/rustc_expand/src/base.rs
Original file line number Diff line number Diff line change
@@ -571,35 +571,6 @@ impl DummyResult {
tokens: None,
})
}

/// A plain dummy pattern.
pub fn raw_pat(sp: Span) -> ast::Pat {
ast::Pat { id: ast::DUMMY_NODE_ID, kind: PatKind::Wild, span: sp, tokens: None }
}

/// A plain dummy type.
pub fn raw_ty(sp: Span) -> P<ast::Ty> {
// FIXME(nnethercote): you might expect `ast::TyKind::Dummy` to be used here, but some
// values produced here end up being lowered to HIR, which `ast::TyKind::Dummy` does not
// support, so we use an empty tuple instead.
P(ast::Ty {
id: ast::DUMMY_NODE_ID,
kind: ast::TyKind::Tup(ThinVec::new()),
span: sp,
tokens: None,
})
}

/// A plain dummy crate.
pub fn raw_crate() -> ast::Crate {
ast::Crate {
attrs: Default::default(),
items: Default::default(),
spans: Default::default(),
id: ast::DUMMY_NODE_ID,
is_placeholder: Default::default(),
}
}
}

impl MacResult for DummyResult {
@@ -608,7 +579,12 @@ impl MacResult for DummyResult {
}

fn make_pat(self: Box<DummyResult>) -> Option<P<ast::Pat>> {
Some(P(DummyResult::raw_pat(self.span)))
Some(P(ast::Pat {
id: ast::DUMMY_NODE_ID,
kind: PatKind::Wild,
span: self.span,
tokens: None,
}))
}

fn make_items(self: Box<DummyResult>) -> Option<SmallVec<[P<ast::Item>; 1]>> {
@@ -636,7 +612,15 @@ impl MacResult for DummyResult {
}

fn make_ty(self: Box<DummyResult>) -> Option<P<ast::Ty>> {
Some(DummyResult::raw_ty(self.span))
// FIXME(nnethercote): you might expect `ast::TyKind::Dummy` to be used here, but some
// values produced here end up being lowered to HIR, which `ast::TyKind::Dummy` does not
// support, so we use an empty tuple instead.
Some(P(ast::Ty {
id: ast::DUMMY_NODE_ID,
kind: ast::TyKind::Tup(ThinVec::new()),
span: self.span,
tokens: None,
}))
}

fn make_arms(self: Box<DummyResult>) -> Option<SmallVec<[ast::Arm; 1]>> {
@@ -668,7 +652,13 @@ impl MacResult for DummyResult {
}

fn make_crate(self: Box<DummyResult>) -> Option<ast::Crate> {
Some(DummyResult::raw_crate())
Some(ast::Crate {
attrs: Default::default(),
items: Default::default(),
spans: Default::default(),
id: ast::DUMMY_NODE_ID,
is_placeholder: Default::default(),
})
}
}