Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
794434e
initial implementation of rustdoc nested aux-build
EtomicBomb Jul 24, 2024
d8211de
ordering and wrapping cross-crate-info tests
EtomicBomb Jul 24, 2024
f6f0ef4
reformatted rustdoc/cross-crate-info, fixing trailing newline issue
EtomicBomb Jul 24, 2024
12d87ee
file_stem and comment per notriddle
EtomicBomb Jul 25, 2024
f91da72
merge conflicts; fix rebase duplicating imports
EtomicBomb Jul 29, 2024
bd23e0e
canonicalize path in another place to fix #128411
EtomicBomb Jul 31, 2024
281c2fd
Inline and remove `parse_local_mk`.
nnethercote Jul 31, 2024
fe647f0
Remove `LhsExpr`.
nnethercote Jul 31, 2024
2eb2ef1
Streamline attribute stitching on AST nodes.
nnethercote Jul 31, 2024
9d77d17
Move a comment to a better spot.
nnethercote Aug 1, 2024
d1f05fd
Distinguish the two kinds of token range.
nnethercote Jul 31, 2024
6ba240a
Promote riscv64gc-unknown-linux-musl to tier 2
Amanieu Feb 26, 2024
b056ab6
Make riscv64gc-unknown-linux-musl dynamically linked by default
Amanieu Jun 22, 2024
beacd70
Add platform support document for riscv64gc-unknown-linux-musl
Amanieu Jun 22, 2024
41b017e
Add the `sha512`, `sm3` and `sm4` target features
sayantn Aug 1, 2024
2f0aaaf
std: Remove has_cpuid
workingjubilee Aug 2, 2024
36527d6
rustfmt: Remove `has_cpuid` from test
workingjubilee Aug 2, 2024
a8daf1c
Rollup merge of #122049 - Amanieu:riscv64-musl-tier2, r=Mark-Simulacrum
matthiaskrgr Aug 2, 2024
84b403f
Rollup merge of #126704 - sayantn:sha, r=Amanieu
matthiaskrgr Aug 2, 2024
168972f
Rollup merge of #128161 - EtomicBomb:just-compiletest, r=notriddle
matthiaskrgr Aug 2, 2024
b31222b
Rollup merge of #128483 - nnethercote:still-more-cfg-cleanups, r=petr…
matthiaskrgr Aug 2, 2024
fc75a90
Rollup merge of #128528 - workingjubilee:you-dont-need-to-see-this-cp…
matthiaskrgr Aug 2, 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
Streamline attribute stitching on AST nodes.
It can be done more concisely.
  • Loading branch information
nnethercote committed Aug 1, 2024
commit 2eb2ef1684e4df67389432fe0c1cc2776c790cd7
7 changes: 3 additions & 4 deletions compiler/rustc_parse/src/parser/attr_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ impl AttrWrapper {

/// Prepend `self.attrs` to `attrs`.
// FIXME: require passing an NT to prevent misuse of this method
pub(crate) fn prepend_to_nt_inner(self, attrs: &mut AttrVec) {
let mut self_attrs = self.attrs;
mem::swap(attrs, &mut self_attrs);
attrs.extend(self_attrs);
pub(crate) fn prepend_to_nt_inner(mut self, attrs: &mut AttrVec) {
mem::swap(attrs, &mut self.attrs);
attrs.extend(self.attrs);
}

pub fn is_empty(&self) -> bool {
Expand Down
18 changes: 7 additions & 11 deletions compiler/rustc_parse/src/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ impl<'a> Parser<'a> {
mut e: P<Expr>,
lo: Span,
) -> PResult<'a, P<Expr>> {
let res = ensure_sufficient_stack(|| {
let mut res = ensure_sufficient_stack(|| {
loop {
let has_question =
if self.prev_token.kind == TokenKind::Ident(kw::Return, IdentIsRaw::No) {
Expand Down Expand Up @@ -924,17 +924,13 @@ impl<'a> Parser<'a> {

// Stitch the list of outer attributes onto the return value. A little
// bit ugly, but the best way given the current code structure.
if attrs.is_empty() {
res
} else {
res.map(|expr| {
expr.map(|mut expr| {
attrs.extend(expr.attrs);
expr.attrs = attrs;
expr
})
})
if !attrs.is_empty()
&& let Ok(expr) = &mut res
{
mem::swap(&mut expr.attrs, &mut attrs);
expr.attrs.extend(attrs)
}
res
}

pub(super) fn parse_dot_suffix_expr(
Expand Down