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 6 pull requests #127706

Merged
merged 27 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift click to select a range
6bd68fc
Run filecheck on dest-prop/branch.rs
CastilloDel Apr 14, 2024
f238eba
Run filecheck on dest-prop/copy_propagation.rs
CastilloDel Apr 14, 2024
853311c
Run filecheck on dest-prop/cycle.rs
CastilloDel Apr 14, 2024
0692090
Run filecheck on dest-prop/dead_stores_79191.rs and dead_stores_bette…
CastilloDel Apr 14, 2024
f0f867e
Run filecheck on dest-prop/simple.rs
CastilloDel Apr 14, 2024
2d5a483
Acknowledge comments
CastilloDel Jun 26, 2024
4819270
use "bootstrap" instead of "rustbuild" in comments and docs
onur-ozkan Jul 6, 2024
99721c8
Clear `inner_attr_ranges` regularly.
nnethercote Jul 8, 2024
a47ae57
Use an `@` pattern to shorten some code.
nnethercote Jul 8, 2024
b162013
Use iterator normally in `make_attr_token_stream`.
nnethercote Jul 8, 2024
a88c4d6
Split the stack in `make_attr_token_stream`.
nnethercote Jul 8, 2024
f552794
Move `Spacing` into `FlatToken`.
nnethercote Jul 8, 2024
8a390ba
Change empty replace range condition.
nnethercote Jul 10, 2024
fee1525
Rework `Attribute::get_tokens`.
nnethercote Jul 10, 2024
d8b6aa6
Use `cfg_attr` as a name more.
nnethercote Jul 10, 2024
d6ebbbf
Factor out `AttrsTarget` flattening code.
nnethercote Jul 10, 2024
478ba59
Add some comments.
nnethercote Jul 10, 2024
7fc6943
Use ManuallyDrop in BufWriter::into_parts
saethlin Jul 12, 2024
4d35754
Add URL and crate_name to test cases
notriddle Jul 13, 2024
17419f6
rustdoc: rename `issue-\d .rs` tests to have meaningful names
notriddle Jul 13, 2024
42ee400
Move assertion-free rustdoc ice tests to rustdoc-ui
notriddle Jul 13, 2024
4c493db
Rollup merge of #122300 - CastilloDel:master, r=cjgillot
workingjubilee Jul 14, 2024
1d59d22
Rollup merge of #127434 - onur-ozkan:use-bootstrap-instead-of-rustbui…
workingjubilee Jul 14, 2024
1c8ea14
Rollup merge of #127477 - nnethercote:tweak-inner_attr_ranges, r=petr…
workingjubilee Jul 14, 2024
125343e
Rollup merge of #127558 - nnethercote:more-Attribute-cleanups, r=petr…
workingjubilee Jul 14, 2024
2d8493b
Rollup merge of #127659 - saethlin:manually-drop-bufwriter, r=joboet
workingjubilee Jul 14, 2024
6a3566c
Rollup merge of #127671 - notriddle:notriddle/issue-d, r=Mark-Simulacrum
workingjubilee Jul 14, 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
Add some comments.
Explaining things that took me some time to work out.
  • Loading branch information
nnethercote committed Jul 10, 2024
commit 478ba5902629b0a4dda914e81167e6b3b44c3a51
5 changes: 4 additions & 1 deletion compiler/rustc_ast/src/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 269,14 @@ fn attrs_and_tokens_to_token_trees(
/// with its attributes.
///
/// This is constructed during parsing when we need to capture
/// tokens.
/// tokens, for `cfg` and `cfg_attr` attributes.
///
/// For example, `#[cfg(FALSE)] struct Foo {}` would
/// have an `attrs` field containing the `#[cfg(FALSE)]` attr,
/// and a `tokens` field storing the (unparsed) tokens `struct Foo {}`
///
/// The `cfg`/`cfg_attr` processing occurs in
/// `StripUnconfigured::configure_tokens`.
#[derive(Clone, Debug, Encodable, Decodable)]
pub struct AttrsTarget {
/// Attributes, both outer and inner.
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_expand/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 187,7 @@ impl<'a> StripUnconfigured<'a> {
.iter()
.filter_map(|tree| match tree.clone() {
AttrTokenTree::AttrsTarget(mut target) => {
// Expand any `cfg_attr` attributes.
target.attrs.flat_map_in_place(|attr| self.process_cfg_attr(&attr));

if self.in_cfg(&target.attrs) {
Expand All @@ -195,6 196,8 @@ impl<'a> StripUnconfigured<'a> {
);
Some(AttrTokenTree::AttrsTarget(target))
} else {
// Remove the target if there's a `cfg` attribute and
// the condition isn't satisfied.
None
}
}
Expand Down
Loading