Skip to content

Commit 0e2300b

Browse files
committed
Auto merge of #144466 - GuillaumeGomez:rollup-pvka4ir, r=GuillaumeGomez
Rollup of 14 pull requests Successful merges: - #144316 (bootstrap: Move musl-root fallback out of sanity check) - #144352 (RustWrapper: Suppress getNextNonDebugInfoInstruction) - #144356 (Add `ignore-backends` annotations in failing GCC backend ui tests) - #144359 (add codegen test for variadics) - #144376 (Suggest unwrapping when private method name is available in inner type) - #144379 (test using multiple c-variadic ABIs in the same program) - #144383 (disable cfg.has_reliable_f128 on amdgcn) - #144412 (Small cleanup: Use LocalKey<Cell> methods more) - #144421 (Call `is_parsed_attribute` rather than keeping track of a list of parsed attributes manually) - #144422 (library/windows_targets: Fix macro expansion error in 'link' macro) - #144424 (Allow setting `release-blog-post` label with rustbot) - #144430 (tests: aarch64-outline-atomics: Remove hardcoded target) - #144435 (rustc-dev-guide subtree update) - #144445 (Fix `./x check bootstrap` (again)) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 430d6ed + 16d5f24 commit 0e2300b

File tree

123 files changed

+460
-220
lines changed

Some content is hidden

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

123 files changed

+460
-220
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4255,6 +4255,7 @@ dependencies = [
42554255
"rustc-literal-escaper",
42564256
"rustc_ast",
42574257
"rustc_ast_pretty",
4258+
"rustc_attr_parsing",
42584259
"rustc_data_structures",
42594260
"rustc_errors",
42604261
"rustc_feature",

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,8 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
405405
("mips64" | "mips64r6", _) => false,
406406
// Selection bug <https://github.com/llvm/llvm-project/issues/95471>
407407
("nvptx64", _) => false,
408+
// Unsupported https://github.com/llvm/llvm-project/issues/121122
409+
("amdgpu", _) => false,
408410
// ABI bugs <https://github.com/rust-lang/rust/issues/125109> et al. (full
409411
// list at <https://github.com/rust-lang/rust/issues/116909>)
410412
("powerpc" | "powerpc64", _) => false,

compiler/rustc_errors/src/markdown/term.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ thread_local! {
1818
pub(crate) fn entrypoint(stream: &MdStream<'_>, buf: &mut Buffer) -> io::Result<()> {
1919
#[cfg(not(test))]
2020
if let Some((w, _)) = termize::dimensions() {
21-
WIDTH.with(|c| c.set(std::cmp::min(w, DEFAULT_COLUMN_WIDTH)));
21+
WIDTH.set(std::cmp::min(w, DEFAULT_COLUMN_WIDTH));
2222
}
2323
write_stream(stream, buf, None, 0)?;
2424
buf.write_all(b"\n")
@@ -84,7 +84,7 @@ fn write_tt(tt: &MdTree<'_>, buf: &mut Buffer, indent: usize) -> io::Result<()>
8484
reset_cursor();
8585
}
8686
MdTree::HorizontalRule => {
87-
(0..WIDTH.with(Cell::get)).for_each(|_| buf.write_all(b"-").unwrap());
87+
(0..WIDTH.get()).for_each(|_| buf.write_all(b"-").unwrap());
8888
reset_cursor();
8989
}
9090
MdTree::Heading(n, stream) => {
@@ -121,7 +121,7 @@ fn write_tt(tt: &MdTree<'_>, buf: &mut Buffer, indent: usize) -> io::Result<()>
121121

122122
/// End of that block, just wrap the line
123123
fn reset_cursor() {
124-
CURSOR.with(|cur| cur.set(0));
124+
CURSOR.set(0);
125125
}
126126

127127
/// Change to be generic on Write for testing. If we have a link URL, we don't
@@ -144,7 +144,7 @@ fn write_wrapping<B: io::Write>(
144144
buf.write_all(ind_ws)?;
145145
cur.set(indent);
146146
}
147-
let ch_count = WIDTH.with(Cell::get) - cur.get();
147+
let ch_count = WIDTH.get() - cur.get();
148148
let mut iter = to_write.char_indices();
149149
let Some((end_idx, _ch)) = iter.nth(ch_count) else {
150150
// Write entire line

compiler/rustc_hir_typeck/src/method/suggest.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
264264
err.span_label(within_macro_span, "due to this macro variable");
265265
}
266266
self.suggest_valid_traits(&mut err, item_name, out_of_scope_traits, true);
267+
self.suggest_unwrapping_inner_self(&mut err, source, rcvr_ty, item_name);
267268
err.emit()
268269
}
269270

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ extern "C" void LLVMRustPositionBefore(LLVMBuilderRef B, LLVMValueRef Instr) {
16101610

16111611
extern "C" void LLVMRustPositionAfter(LLVMBuilderRef B, LLVMValueRef Instr) {
16121612
if (auto I = dyn_cast<Instruction>(unwrap<Value>(Instr))) {
1613-
auto J = I->getNextNonDebugInstruction();
1613+
auto J = I->getNextNode();
16141614
unwrap(B)->SetInsertPoint(J);
16151615
}
16161616
}

compiler/rustc_middle/src/ty/print/pretty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ macro_rules! define_helper {
8686

8787
impl $helper {
8888
pub fn new() -> $helper {
89-
$helper($tl.with(|c| c.replace(true)))
89+
$helper($tl.replace(true))
9090
}
9191
}
9292

@@ -100,12 +100,12 @@ macro_rules! define_helper {
100100

101101
impl Drop for $helper {
102102
fn drop(&mut self) {
103-
$tl.with(|c| c.set(self.0))
103+
$tl.set(self.0)
104104
}
105105
}
106106

107107
pub fn $name() -> bool {
108-
$tl.with(|c| c.get())
108+
$tl.get()
109109
}
110110
)+
111111
}

compiler/rustc_parse/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ bitflags = "2.4.1"
99
rustc-literal-escaper = "0.0.5"
1010
rustc_ast = { path = "../rustc_ast" }
1111
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
12+
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
1213
rustc_data_structures = { path = "../rustc_data_structures" }
1314
rustc_errors = { path = "../rustc_errors" }
1415
rustc_feature = { path = "../rustc_feature" }

compiler/rustc_parse/src/validate_attr.rs

Lines changed: 4 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
//! Meta-syntax validation logic of attributes for post-expansion.
22
3+
use std::slice;
4+
35
use rustc_ast::token::Delimiter;
46
use rustc_ast::tokenstream::DelimSpan;
57
use rustc_ast::{
68
self as ast, AttrArgs, Attribute, DelimArgs, MetaItem, MetaItemInner, MetaItemKind, NodeId,
79
Path, Safety,
810
};
11+
use rustc_attr_parsing::{AttributeParser, Late};
912
use rustc_errors::{Applicability, DiagCtxtHandle, FatalError, PResult};
1013
use rustc_feature::{AttributeSafety, AttributeTemplate, BUILTIN_ATTRIBUTE_MAP, BuiltinAttribute};
1114
use rustc_session::errors::report_lit_error;
@@ -266,67 +269,7 @@ pub fn check_builtin_meta_item(
266269
) {
267270
if !is_attr_template_compatible(&template, &meta.kind) {
268271
// attrs with new parsers are locally validated so excluded here
269-
if matches!(
270-
name,
271-
sym::inline
272-
| sym::export_stable
273-
| sym::ffi_const
274-
| sym::ffi_pure
275-
| sym::rustc_std_internal_symbol
276-
| sym::may_dangle
277-
| sym::rustc_as_ptr
278-
| sym::rustc_pub_transparent
279-
| sym::rustc_const_stable_indirect
280-
| sym::rustc_force_inline
281-
| sym::rustc_confusables
282-
| sym::rustc_skip_during_method_dispatch
283-
| sym::rustc_pass_by_value
284-
| sym::rustc_deny_explicit_impl
285-
| sym::rustc_do_not_implement_via_object
286-
| sym::rustc_coinductive
287-
| sym::const_trait
288-
| sym::stable
289-
| sym::unstable
290-
| sym::rustc_allowed_through_unstable_modules
291-
| sym::rustc_specialization_trait
292-
| sym::rustc_unsafe_specialization_marker
293-
| sym::rustc_allow_incoherent_impl
294-
| sym::rustc_coherence_is_core
295-
| sym::marker
296-
| sym::fundamental
297-
| sym::rustc_paren_sugar
298-
| sym::type_const
299-
| sym::repr
300-
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres
301-
// ambiguity
302-
| sym::rustc_align
303-
| sym::deprecated
304-
| sym::optimize
305-
| sym::pointee
306-
| sym::cold
307-
| sym::target_feature
308-
| sym::rustc_allow_const_fn_unstable
309-
| sym::macro_use
310-
| sym::macro_escape
311-
| sym::naked
312-
| sym::no_mangle
313-
| sym::non_exhaustive
314-
| sym::omit_gdb_pretty_printer_section
315-
| sym::path
316-
| sym::ignore
317-
| sym::must_use
318-
| sym::track_caller
319-
| sym::link_name
320-
| sym::link_ordinal
321-
| sym::export_name
322-
| sym::rustc_macro_transparency
323-
| sym::link_section
324-
| sym::rustc_layout_scalar_valid_range_start
325-
| sym::rustc_layout_scalar_valid_range_end
326-
| sym::no_implicit_prelude
327-
| sym::automatically_derived
328-
| sym::coverage
329-
) {
272+
if AttributeParser::<Late>::is_parsed_attribute(slice::from_ref(&name)) {
330273
return;
331274
}
332275
emit_malformed_attribute(psess, style, meta.span, name, template);

compiler/rustc_query_system/src/query/plumbing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ fn incremental_verify_ich_failed<Tcx>(
720720
static INSIDE_VERIFY_PANIC: Cell<bool> = const { Cell::new(false) };
721721
};
722722

723-
let old_in_panic = INSIDE_VERIFY_PANIC.with(|in_panic| in_panic.replace(true));
723+
let old_in_panic = INSIDE_VERIFY_PANIC.replace(true);
724724

725725
if old_in_panic {
726726
tcx.sess().dcx().emit_err(crate::error::Reentrant);
@@ -739,7 +739,7 @@ fn incremental_verify_ich_failed<Tcx>(
739739
panic!("Found unstable fingerprints for {dep_node:?}: {}", result());
740740
}
741741

742-
INSIDE_VERIFY_PANIC.with(|in_panic| in_panic.set(old_in_panic));
742+
INSIDE_VERIFY_PANIC.set(old_in_panic);
743743
}
744744

745745
/// Ensure that either this query has all green inputs or been executed.

library/windows_targets/src/lib.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,12 @@ pub macro link_dylib {
3434

3535
#[cfg(feature = "windows_raw_dylib")]
3636
pub macro link($($tt:tt)*) {
37-
$crate::link_raw_dylib!($($tt)*)
37+
$crate::link_raw_dylib!($($tt)*);
3838
}
3939

4040
#[cfg(not(feature = "windows_raw_dylib"))]
41-
pub macro link {
42-
($library:literal $abi:literal $($link_name:literal)? $(#[$doc:meta])? fn $($function:tt)*) => (
43-
// Note: the windows-targets crate uses a pre-built Windows.lib import library which we don't
44-
// have in this repo. So instead we always link kernel32.lib and add the rest of the import
45-
// libraries below by using an empty extern block. This works because extern blocks are not
46-
// connected to the library given in the #[link] attribute.
47-
#[link(name = "kernel32")]
48-
unsafe extern $abi {
49-
$(#[link_name=$link_name])?
50-
pub fn $($function)*;
51-
}
52-
)
41+
pub macro link($($tt:tt)*) {
42+
$crate::link_dylib!($($tt)*);
5343
}
5444

5545
#[cfg(not(feature = "windows_raw_dylib"))]

0 commit comments

Comments
 (0)