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 12 pull requests #126016

Merged
merged 41 commits into from
Jun 5, 2024
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a5a60d7
Add `size_of`, `size_of_val`, `align_of`, and `align_of_val` to the p…
joshtriplett Mar 28, 2024
b4834a1
rewrite resolve-rename in rmake
Oneirical May 28, 2024
d553d5b
rewrite incr-prev-body-beyond-eof in rmake
Oneirical May 28, 2024
8530285
rustc_span: Inline some hot functions
petrochenkov Jun 2, 2024
07dc3eb
Allow static mut definitions with #[linkage]
bjorn3 Jun 3, 2024
8f08625
Remove a bunch of redundant args from report_method_error
compiler-errors Jun 3, 2024
e9957b9
Stop passing empty args to check_expr_path
compiler-errors Jun 3, 2024
8f677e8
bootstrap: implement new feature `bootstrap-self-test`
onur-ozkan May 19, 2024
2bad3d1
Make deleting on LinkedList aware of the allocator
xTachyon Jun 4, 2024
59e2074
rewrite suspicious-library in rmake
Oneirical May 28, 2024
5d26f58
Closures are recursively reachable
tmiasko Jun 4, 2024
ac96fa4
Use inline const instead of unsafe to construct arrays in `MaybeUnini…
kpreid May 13, 2024
ec8fa17
Use inline const instead of unsafe to implement `MaybeUninit::uninit_…
kpreid May 13, 2024
2a21937
Add a co-maintainer for the two ARMv4T targets
Lokathor Jun 4, 2024
e1ae0fa
`UNICODE_ARRAY` and `ASCII_ARRAY` fixes.
nnethercote May 29, 2024
d1215da
Don't use the word "parse" for lexing operations.
nnethercote May 30, 2024
f657624
Inline and remove `error_malformed_cfg_attr_missing`.
nnethercote May 31, 2024
769ca3f
Rename `maybe_file_to_stream` as `maybe_source_file_to_stream`.
nnethercote May 31, 2024
3c321b9
Remove `stream_to_parser`.
nnethercote May 31, 2024
af13b48
Improve `panictry_buffer!`.
nnethercote May 31, 2024
29e6e28
Remove low-value comments.
nnethercote May 31, 2024
191b76e
Rename `maybe_source_file_to_parser` as `maybe_new_parser_from_source…
nnethercote May 31, 2024
8964106
Use `source_str_to_stream` in a test file.
nnethercote May 31, 2024
25972ae
Inline and remove `parse_crate{,_attrs}_from_{file,source_str}`.
nnethercote May 31, 2024
ab192a0
Reorder `source_str_to_stream` arguments.
nnethercote May 31, 2024
264dbe4
Inline and remove `source_file_to_stream`.
nnethercote May 31, 2024
b903733
Make top-level `rustc_parse` functions fallible.
nnethercote May 31, 2024
2d4e7df
rustfmt: Remove an unnecessary `catch_unwind` use.
nnethercote Jun 3, 2024
dd6bca5
Add another test for hidden types capturing lifetimes that outlive bu…
compiler-errors Jun 5, 2024
9ccc7b7
Rollup merge of #123168 - joshtriplett:size-of-prelude, r=Amanieu
workingjubilee Jun 5, 2024
0f86182
Rollup merge of #125273 - onur-ozkan:bootstrap-self-test, r=albertlar…
workingjubilee Jun 5, 2024
0f2b34a
Rollup merge of #125683 - Oneirical:patience-testing-test, r=jieyouxu
workingjubilee Jun 5, 2024
05b4674
Rollup merge of #125815 - nnethercote:rustc_parse-top-level-cleanups,…
workingjubilee Jun 5, 2024
0096138
Rollup merge of #125903 - petrochenkov:upctxt3, r=nnethercote
workingjubilee Jun 5, 2024
78d9a7e
Rollup merge of #125906 - compiler-errors:simplify-method-error-args,…
workingjubilee Jun 5, 2024
2b89c1b
Rollup merge of #125920 - bjorn3:allow_static_mut_linkage_def, r=Urgau
workingjubilee Jun 5, 2024
448159c
Rollup merge of #125982 - xTachyon:fix-linked-list, r=jhpratt
workingjubilee Jun 5, 2024
6b6b698
Rollup merge of #125995 - kpreid:const-uninit-stable, r=Nilstrieb
workingjubilee Jun 5, 2024
eb2819e
Rollup merge of #125996 - tmiasko:closure-recursively-reachable, r=ol…
workingjubilee Jun 5, 2024
669935e
Rollup merge of #126003 - Lokathor:new-co-maintainer, r=compiler-errors
workingjubilee Jun 5, 2024
f12fe3a
Rollup merge of #126004 - compiler-errors:captures-soundness-test, r=…
workingjubilee Jun 5, 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 error_malformed_cfg_attr_missing.
It has a single call site.

This also means `CFG_ATTR_{GRAMMAR_HELP,NOTE_REF}` can be moved into
`parse_cfg_attr`, now that it's the only function that uses them.
And the commit removes the line break in the URL.
  • Loading branch information
nnethercote committed Jun 5, 2024
commit f6576249abf9d66b936d55a4d15c44932c800fe2
20 changes: 10 additions & 10 deletions compiler/rustc_parse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ pub fn parse_cfg_attr(
attr: &Attribute,
psess: &ParseSess,
) -> Option<(MetaItem, Vec<(AttrItem, Span)>)> {
const CFG_ATTR_GRAMMAR_HELP: &str = "#[cfg_attr(condition, attribute, other_attribute, ...)]";
const CFG_ATTR_NOTE_REF: &str = "for more information, visit \
<https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute>";

match attr.get_normal_item().args {
ast::AttrArgs::Delimited(ast::DelimArgs { dspan, delim, ref tokens })
if !tokens.is_empty() =>
Expand All @@ -222,16 +226,12 @@ pub fn parse_cfg_attr(
}
}
}
_ => error_malformed_cfg_attr_missing(attr.span, psess),
_ => {
psess.dcx.emit_err(errors::MalformedCfgAttr {
span: attr.span,
sugg: CFG_ATTR_GRAMMAR_HELP,
});
}
}
None
}

const CFG_ATTR_GRAMMAR_HELP: &str = "#[cfg_attr(condition, attribute, other_attribute, ...)]";
const CFG_ATTR_NOTE_REF: &str = "for more information, visit \
<https://doc.rust-lang.org/reference/conditional-compilation.html\
#the-cfg_attr-attribute>";

fn error_malformed_cfg_attr_missing(span: Span, psess: &ParseSess) {
psess.dcx.emit_err(errors::MalformedCfgAttr { span, sugg: CFG_ATTR_GRAMMAR_HELP });
}