Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9d471f2

Browse files
committedJun 7, 2024
Auto merge of rust-lang#126126 - matthiaskrgr:rollup-541x5a6, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#116088 (Stabilise `c_unwind`) - rust-lang#124012 (Stabilize `binary_heap_as_slice`) - rust-lang#124214 (Parse unsafe attributes) - rust-lang#125572 (Detect pub structs never constructed and unused associated constants) - rust-lang#125781 (prefer `compile::stream_cargo` for building tools) - rust-lang#126030 (Update `./x fmt` command in library/std/src/sys/pal/windows/c/README.md) - rust-lang#126047 (Simplify the rayon calls in the installer) - rust-lang#126089 (Stabilize Option::take_if) - rust-lang#126112 (Clean up source root in run-make tests) - rust-lang#126119 (Improve docs for using custom paths with `--emit`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents e3c3ce6 + 5c96adc commit 9d471f2

File tree

138 files changed

+713
-336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+713
-336
lines changed
 

‎compiler/rustc_expand/src/build.rs

+17-3
Original file line numberDiff line numberDiff line change
@@ -666,20 +666,34 @@ impl<'a> ExtCtxt<'a> {
666666
// Builds `#[name]`.
667667
pub fn attr_word(&self, name: Symbol, span: Span) -> ast::Attribute {
668668
let g = &self.sess.psess.attr_id_generator;
669-
attr::mk_attr_word(g, ast::AttrStyle::Outer, name, span)
669+
attr::mk_attr_word(g, ast::AttrStyle::Outer, ast::Safety::Default, name, span)
670670
}
671671

672672
// Builds `#[name = val]`.
673673
//
674674
// Note: `span` is used for both the identifier and the value.
675675
pub fn attr_name_value_str(&self, name: Symbol, val: Symbol, span: Span) -> ast::Attribute {
676676
let g = &self.sess.psess.attr_id_generator;
677-
attr::mk_attr_name_value_str(g, ast::AttrStyle::Outer, name, val, span)
677+
attr::mk_attr_name_value_str(
678+
g,
679+
ast::AttrStyle::Outer,
680+
ast::Safety::Default,
681+
name,
682+
val,
683+
span,
684+
)
678685
}
679686

680687
// Builds `#[outer(inner)]`.
681688
pub fn attr_nested_word(&self, outer: Symbol, inner: Symbol, span: Span) -> ast::Attribute {
682689
let g = &self.sess.psess.attr_id_generator;
683-
attr::mk_attr_nested_word(g, ast::AttrStyle::Outer, outer, inner, span)
690+
attr::mk_attr_nested_word(
691+
g,
692+
ast::AttrStyle::Outer,
693+
ast::Safety::Default,
694+
outer,
695+
inner,
696+
span,
697+
)
684698
}
685699
}

‎compiler/rustc_expand/src/expand.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,14 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
778778
if let SyntaxExtensionKind::Derive(..) = ext {
779779
self.gate_proc_macro_input(&item);
780780
}
781-
let meta = ast::MetaItem { kind: MetaItemKind::Word, span, path };
781+
// The `MetaItem` representing the trait to derive can't
782+
// have an unsafe around it (as of now).
783+
let meta = ast::MetaItem {
784+
unsafety: ast::Safety::Default,
785+
kind: MetaItemKind::Word,
786+
span,
787+
path,
788+
};
782789
let items = match expander.expand(self.cx, span, &meta, item, is_const) {
783790
ExpandResult::Ready(items) => items,
784791
ExpandResult::Retry(item) => {

‎compiler/rustc_feature/src/accepted.rs

+2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ declare_features! (
8080
(accepted, braced_empty_structs, "1.8.0", Some(29720)),
8181
/// Allows `c"foo"` literals.
8282
(accepted, c_str_literals, "1.77.0", Some(105723)),
83+
/// Allows `extern "C-unwind" fn` to enable unwinding across ABI boundaries and treat `extern "C" fn` as nounwind.
84+
(accepted, c_unwind, "CURRENT_RUSTC_VERSION", Some(74990)),
8385
/// Allows `#[cfg_attr(predicate, multiple, attributes, here)]`.
8486
(accepted, cfg_attr_multi, "1.33.0", Some(54881)),
8587
/// Allows the use of `#[cfg(doctest)]`, set when rustdoc is collecting doctests.
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.