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 804421d

Browse files
committedJun 7, 2024
Auto merge of rust-lang#126134 - matthiaskrgr:rollup-vzlegsc, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - 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#126052 (More `rustc_parse` cleanups) - rust-lang#126077 (Revert "Use the HIR instead of mir_keys for determining whether something will have a MIR body.") - 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 4dc24ae + df35d7a commit 804421d

File tree

89 files changed

+745
-234
lines changed

Some content is hidden

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

89 files changed

+745
-234
lines changed
 

‎compiler/rustc_builtin_macros/src/test_harness.rs

+1
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ impl<'a> MutVisitor for EntryPointCleaner<'a> {
203203
let allow_dead_code = attr::mk_attr_nested_word(
204204
&self.sess.psess.attr_id_generator,
205205
ast::AttrStyle::Outer,
206+
ast::Safety::Default,
206207
sym::allow,
207208
sym::dead_code,
208209
self.def_site,

‎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) => {
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.