diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 2943672c79f9d..20e75f0fdfd20 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -2767,6 +2767,10 @@ fn add_order_independent_options( cmd.pgo_gen(); } + if sess.opts.unstable_opts.instrument_mcount { + cmd.enable_profiling(); + } + if sess.opts.cg.control_flow_guard != CFGuard::Disabled { cmd.control_flow_guard(); } diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs index 323fa7fb91b8c..eb908e19be54e 100644 --- a/compiler/rustc_codegen_ssa/src/back/linker.rs +++ b/compiler/rustc_codegen_ssa/src/back/linker.rs @@ -352,6 +352,7 @@ pub(crate) trait Linker { fn add_no_exec(&mut self) {} fn add_as_needed(&mut self) {} fn reset_per_library_state(&mut self) {} + fn enable_profiling(&mut self) {} } impl dyn Linker + '_ { @@ -732,6 +733,19 @@ impl<'a> Linker for GccLinker<'a> { self.link_or_cc_args(&["-u", "__llvm_profile_runtime"]); } + fn enable_profiling(&mut self) { + // This flag is also used when linking to choose target specific + // libraries needed to enable profiling. + self.cc_arg("-pg"); + // On windows-gnu targets, libgmon also needs to be linked, and this + // requires readding libraries to satisfy its dependencies. + if self.sess.target.is_like_windows { + self.cc_arg("-lgmon"); + self.cc_arg("-lkernel32"); + self.cc_arg("-lmsvcrt"); + } + } + fn control_flow_guard(&mut self) {} fn ehcont_guard(&mut self) {} diff --git a/compiler/rustc_hir_typeck/src/demand.rs b/compiler/rustc_hir_typeck/src/demand.rs index 0d49e06240532..c5ad8cf33e8bb 100644 --- a/compiler/rustc_hir_typeck/src/demand.rs +++ b/compiler/rustc_hir_typeck/src/demand.rs @@ -1,5 +1,5 @@ -use rustc_errors::{Applicability, Diag, MultiSpan, listify}; -use rustc_hir::def::Res; +use rustc_errors::{Applicability, Diag, MultiSpan, listify, pluralize}; +use rustc_hir::def::{DefKind, Res}; use rustc_hir::intravisit::Visitor; use rustc_hir::{self as hir, find_attr}; use rustc_infer::infer::DefineOpaqueTypes; @@ -29,7 +29,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { if expr_ty == expected { return; } - self.annotate_alternative_method_deref(err, expr, error); + self.annotate_alternative_method_deref_for_unop(err, expr, error); self.explain_self_literal(err, expr, expected, expr_ty); // Use `||` to give these suggestions a precedence @@ -723,8 +723,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { hir::Path { res: hir::def::Res::Def( - hir::def::DefKind::Static { .. } - | hir::def::DefKind::Const { .. }, + DefKind::Static { .. } | DefKind::Const { .. }, def_id, ), .. @@ -899,7 +898,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { false } - fn annotate_alternative_method_deref( + fn annotate_alternative_method_deref_for_unop( &self, err: &mut Diag<'_>, expr: &hir::Expr<'_>, @@ -919,7 +918,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let hir::ExprKind::Unary(hir::UnOp::Deref, deref) = lhs.kind else { return; }; - let hir::ExprKind::MethodCall(path, base, args, _) = deref.kind else { + self.annotate_alternative_method_deref(err, deref, Some(expected)) + } + + #[tracing::instrument(skip(self, err), level = "debug")] + pub(crate) fn annotate_alternative_method_deref( + &self, + err: &mut Diag<'_>, + expr: &hir::Expr<'_>, + expected: Option>, + ) { + let hir::ExprKind::MethodCall(path, base, args, _) = expr.kind else { return; }; let Some(self_ty) = self.typeck_results.borrow().expr_ty_adjusted_opt(base) else { @@ -929,7 +938,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let Ok(pick) = self.lookup_probe_for_diagnostic( path.ident, self_ty, - deref, + expr, probe::ProbeScope::TraitsInScope, None, ) else { @@ -939,10 +948,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let Ok(in_scope_methods) = self.probe_for_name_many( probe::Mode::MethodCall, path.ident, - Some(expected), + expected, probe::IsSuggestion(true), self_ty, - deref.hir_id, + expr.hir_id, probe::ProbeScope::TraitsInScope, ) else { return; @@ -954,10 +963,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let Ok(all_methods) = self.probe_for_name_many( probe::Mode::MethodCall, path.ident, - Some(expected), + expected, probe::IsSuggestion(true), self_ty, - deref.hir_id, + expr.hir_id, probe::ProbeScope::AllTraits, ) else { return; @@ -965,34 +974,51 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let suggestions: Vec<_> = all_methods .into_iter() - .filter(|c| c.item.def_id != pick.item.def_id) - .map(|c| { + .filter_map(|c| { + if c.item.def_id == pick.item.def_id { + return None; + } let m = c.item; let generic_args = ty::GenericArgs::for_item(self.tcx, m.def_id, |param, _| { - self.var_for_def(deref.span, param) + self.var_for_def(expr.span, param) }); - let mutability = - match self.tcx.fn_sig(m.def_id).skip_binder().input(0).skip_binder().kind() { - ty::Ref(_, _, hir::Mutability::Mut) => "&mut ", - ty::Ref(_, _, _) => "&", - _ => "", - }; - vec![ - ( - deref.span.until(base.span), - format!( - "{}({}", - with_no_trimmed_paths!( - self.tcx.def_path_str_with_args(m.def_id, generic_args,) - ), - mutability, - ), - ), + let fn_sig = self.tcx.fn_sig(m.def_id); + if fn_sig.skip_binder().inputs().skip_binder().len() != args.len() + 1 { + return None; + } + let rcvr_ty = fn_sig.skip_binder().input(0).skip_binder(); + let (mutability, ty) = match rcvr_ty.kind() { + ty::Ref(_, ty, hir::Mutability::Mut) => ("&mut ", ty), + ty::Ref(_, ty, _) => ("&", ty), + _ => ("", &rcvr_ty), + }; + let path = match self.tcx.assoc_parent(m.def_id) { + Some((_, DefKind::Impl { of_trait: true })) => { + // We have `impl Trait for T {}`, suggest `::method`. + self.tcx.def_path_str_with_args(m.def_id, generic_args).to_string() + } + Some((_, DefKind::Impl { of_trait: false })) => { + if let ty::Adt(def, _) = ty.kind() { + // We have `impl T {}`, suggest `T::method`. + format!("{}::{}", self.tcx.def_path_str(def.did()), path.ident) + } else { + // This should be unreachable, as `impl &'a T {}` is invalid. + format!("{ty}::{}", path.ident) + } + } + // Fallback for arbitrary self types. + _ => with_no_trimmed_paths!( + self.tcx.def_path_str_with_args(m.def_id, generic_args) + ) + .to_string(), + }; + Some(vec![ + (expr.span.until(base.span), format!("{path}({}", mutability)), match &args { - [] => (base.span.shrink_to_hi().with_hi(deref.span.hi()), ")".to_string()), + [] => (base.span.shrink_to_hi().with_hi(expr.span.hi()), ")".to_string()), [first, ..] => (base.span.between(first.span), ", ".to_string()), }, - ] + ]) }) .collect(); if suggestions.is_empty() { @@ -1046,9 +1072,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { ), ); if suggestions.len() > other_methods_in_scope.len() { + let n = suggestions.len() - other_methods_in_scope.len(); err.note(format!( - "additionally, there are {} other available methods that aren't in scope", - suggestions.len() - other_methods_in_scope.len() + "additionally, there {are} {n} other available method{s} that {are}n't in scope", + are = pluralize!("is", n), + s = pluralize!(n), )); } err.multipart_suggestions( @@ -1263,7 +1291,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let hir::def::Res::Def(kind, def_id) = path.res else { return; }; - let callable_kind = if matches!(kind, hir::def::DefKind::Ctor(_, _)) { + let callable_kind = if matches!(kind, DefKind::Ctor(_, _)) { CallableKind::Constructor } else { CallableKind::Function diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index 6b77169994a03..872328535ce64 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -1660,14 +1660,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { expr: &'tcx hir::Expr<'tcx>, ) -> Ty<'tcx> { let element_ty = if !args.is_empty() { - // This shouldn't happen unless there's another error - // (e.g., never patterns in inappropriate contexts). - if self.diverges.get() != Diverges::Maybe { - self.dcx() - .struct_span_err(expr.span, "unexpected divergence state in checking array") - .delay_as_bug(); - } - let coerce_to = expected .to_option(self) .and_then(|uty| { diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs index 0471fd965cd82..f92dfb8bad7be 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs @@ -2853,6 +2853,8 @@ impl<'a, 'b, 'tcx> ArgMatchingCtxt<'a, 'b, 'tcx> { ); return; } + + self.annotate_alternative_method_deref(err, self.call_expr, None); } /// A "softer" version of the `demand_compatible`, which checks types without persisting them, diff --git a/compiler/rustc_target/src/spec/base/windows_gnu.rs b/compiler/rustc_target/src/spec/base/windows_gnu.rs index d2fe42b903062..cee3f91226998 100644 --- a/compiler/rustc_target/src/spec/base/windows_gnu.rs +++ b/compiler/rustc_target/src/spec/base/windows_gnu.rs @@ -106,6 +106,7 @@ pub(crate) fn opts() -> TargetOptions { // FIXME(davidtwco): Support Split DWARF on Windows GNU - may require LLVM changes to // output DWO, despite using DWARF, doesn't use ELF.. supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]), + mcount: "_mcount".into(), ..Default::default() } } diff --git a/compiler/rustc_target/src/spec/base/windows_gnullvm.rs b/compiler/rustc_target/src/spec/base/windows_gnullvm.rs index 1a69c8ef65f93..c1b4eecae3f5c 100644 --- a/compiler/rustc_target/src/spec/base/windows_gnullvm.rs +++ b/compiler/rustc_target/src/spec/base/windows_gnullvm.rs @@ -53,6 +53,7 @@ pub(crate) fn opts() -> TargetOptions { // FIXME(davidtwco): Support Split DWARF on Windows GNU - may require LLVM changes to // output DWO, despite using DWARF, doesn't use ELF.. supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]), + mcount: "_mcount".into(), ..Default::default() } } diff --git a/library/core/src/intrinsics/simd.rs b/library/core/src/intrinsics/simd.rs index 5fb2102c319e2..50d8871973792 100644 --- a/library/core/src/intrinsics/simd.rs +++ b/library/core/src/intrinsics/simd.rs @@ -62,6 +62,7 @@ pub const unsafe fn simd_splat(value: U) -> T; /// Adds two simd vectors elementwise. /// /// `T` must be a vector of integers or floats. +/// For integers, wrapping arithmetic is used. #[rustc_intrinsic] #[rustc_nounwind] pub const unsafe fn simd_add(x: T, y: T) -> T; @@ -69,6 +70,7 @@ pub const unsafe fn simd_add(x: T, y: T) -> T; /// Subtracts `rhs` from `lhs` elementwise. /// /// `T` must be a vector of integers or floats. +/// For integers, wrapping arithmetic is used. #[rustc_intrinsic] #[rustc_nounwind] pub const unsafe fn simd_sub(lhs: T, rhs: T) -> T; @@ -76,6 +78,7 @@ pub const unsafe fn simd_sub(lhs: T, rhs: T) -> T; /// Multiplies two simd vectors elementwise. /// /// `T` must be a vector of integers or floats. +/// For integers, wrapping arithmetic is used. #[rustc_intrinsic] #[rustc_nounwind] pub const unsafe fn simd_mul(x: T, y: T) -> T; @@ -233,8 +236,7 @@ pub const unsafe fn simd_as(x: T) -> U; /// Negates a vector elementwise. /// /// `T` must be a vector of integers or floats. -/// -/// Rust panics for `-::Min` due to overflow, but it is not UB with this intrinsic. +/// For integers, wrapping arithmetic is used. #[rustc_intrinsic] #[rustc_nounwind] pub const unsafe fn simd_neg(x: T) -> T; diff --git a/src/bootstrap/download-ci-llvm-stamp b/src/bootstrap/download-ci-llvm-stamp index 2ca19f082693b..fa640ad8d96f1 100644 --- a/src/bootstrap/download-ci-llvm-stamp +++ b/src/bootstrap/download-ci-llvm-stamp @@ -1,4 +1,4 @@ Change this file to make users of the `download-ci-llvm` configuration download a new version of LLVM from CI, even if the LLVM submodule hasn’t changed. -Last change is for: https://github.com/rust-lang/rust/pull/153179 +Last change is for: https://github.com/rust-lang/rust/pull/151063 diff --git a/tests/run-make/instrument-mcount-link-pg/main.rs b/tests/run-make/instrument-mcount-link-pg/main.rs new file mode 100644 index 0000000000000..47ad8c634112b --- /dev/null +++ b/tests/run-make/instrument-mcount-link-pg/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello World!"); +} diff --git a/tests/run-make/instrument-mcount-link-pg/rmake.rs b/tests/run-make/instrument-mcount-link-pg/rmake.rs new file mode 100644 index 0000000000000..184bd9429bfd8 --- /dev/null +++ b/tests/run-make/instrument-mcount-link-pg/rmake.rs @@ -0,0 +1,19 @@ +// When building a binary instrumented with mcount, verify the +// binary is linked with the correct crt to enable profiling. +// +//@ only-gnu +//@ ignore-cross-compile + +use run_make_support::{path, run, rustc}; + +fn main() { + // Compile instrumentation enabled binary, and verify -pg is passed + let link_args = + rustc().input("main.rs").arg("-Zinstrument-mcount").print("link-args").run().stdout_utf8(); + assert!(link_args.contains("\"-pg\"")); + + // Run it, and verify gmon.out is created + assert!(!path("gmon.out").exists()); + run("main"); + assert!(path("gmon.out").exists()); +} diff --git a/tests/ui/methods/shadowed-intrinsic-method.rs b/tests/ui/methods/shadowed-intrinsic-method.rs new file mode 100644 index 0000000000000..8350d6a7ba5f0 --- /dev/null +++ b/tests/ui/methods/shadowed-intrinsic-method.rs @@ -0,0 +1,37 @@ +// Can't use rustfix because we provide two suggestions: +// to remove the arg for `Borrow::borrow` or to call `Type::borrow`. +use std::borrow::Borrow; + +struct A; + +impl A { fn borrow(&mut self, _: ()) {} } + +struct B; + +fn main() { + // The fully-qualified path for items within functions is unnameable from outside that function. + impl B { fn borrow(&mut self, _: ()) {} } + + struct C; + // The fully-qualified path for items within functions is unnameable from outside that function. + impl C { fn borrow(&mut self, _: ()) {} } + + let mut a = A; + a.borrow(()); //~ ERROR E0061 + // A::borrow(&mut a, ()); + let mut b = B; + b.borrow(()); //~ ERROR E0061 + // This currently suggests `main::::borrow`, which is not correct, it should be + // B::borrow(&mut b, ()); + let mut c = C; + c.borrow(()); //~ ERROR E0061 + // This currently suggests `main::C::borrow`, which is not correct, it should be + // C::borrow(&mut c, ()); +} + +fn foo() { + let mut b = B; + b.borrow(()); //~ ERROR E0061 + // This currently suggests `main::::borrow`, which is not correct, it should be + // B::borrow(&mut b, ()); +} diff --git a/tests/ui/methods/shadowed-intrinsic-method.stderr b/tests/ui/methods/shadowed-intrinsic-method.stderr new file mode 100644 index 0000000000000..a832714cd1f97 --- /dev/null +++ b/tests/ui/methods/shadowed-intrinsic-method.stderr @@ -0,0 +1,111 @@ +error[E0061]: this method takes 0 arguments but 1 argument was supplied + --> $DIR/shadowed-intrinsic-method.rs:20:7 + | +LL | a.borrow(()); + | ^^^^^^ -- unexpected argument of type `()` + | +note: the `borrow` call is resolved to the method in `std::borrow::Borrow`, shadowing the method of the same name on the inherent impl for `A` + --> $DIR/shadowed-intrinsic-method.rs:20:7 + | +LL | use std::borrow::Borrow; + | ------------------- `std::borrow::Borrow` imported here +... +LL | a.borrow(()); + | ^^^^^^ refers to `std::borrow::Borrow::borrow` +note: method defined here + --> $SRC_DIR/core/src/borrow.rs:LL:COL +help: you might have meant to call the other method; you can use the fully-qualified path to call it explicitly + | +LL - a.borrow(()); +LL + A::borrow(&mut a, ()); + | +help: remove the extra argument + | +LL - a.borrow(()); +LL + a.borrow(); + | + +error[E0061]: this method takes 0 arguments but 1 argument was supplied + --> $DIR/shadowed-intrinsic-method.rs:23:7 + | +LL | b.borrow(()); + | ^^^^^^ -- unexpected argument of type `()` + | +note: the `borrow` call is resolved to the method in `std::borrow::Borrow`, shadowing the method of the same name on the inherent impl for `main::` + --> $DIR/shadowed-intrinsic-method.rs:23:7 + | +LL | use std::borrow::Borrow; + | ------------------- `std::borrow::Borrow` imported here +... +LL | b.borrow(()); + | ^^^^^^ refers to `std::borrow::Borrow::borrow` +note: method defined here + --> $SRC_DIR/core/src/borrow.rs:LL:COL +help: you might have meant to call the other method; you can use the fully-qualified path to call it explicitly + | +LL - b.borrow(()); +LL + B::borrow(&mut b, ()); + | +help: remove the extra argument + | +LL - b.borrow(()); +LL + b.borrow(); + | + +error[E0061]: this method takes 0 arguments but 1 argument was supplied + --> $DIR/shadowed-intrinsic-method.rs:27:7 + | +LL | c.borrow(()); + | ^^^^^^ -- unexpected argument of type `()` + | +note: the `borrow` call is resolved to the method in `std::borrow::Borrow`, shadowing the method of the same name on the inherent impl for `main::C` + --> $DIR/shadowed-intrinsic-method.rs:27:7 + | +LL | use std::borrow::Borrow; + | ------------------- `std::borrow::Borrow` imported here +... +LL | c.borrow(()); + | ^^^^^^ refers to `std::borrow::Borrow::borrow` +note: method defined here + --> $SRC_DIR/core/src/borrow.rs:LL:COL +help: you might have meant to call the other method; you can use the fully-qualified path to call it explicitly + | +LL - c.borrow(()); +LL + C::borrow(&mut c, ()); + | +help: remove the extra argument + | +LL - c.borrow(()); +LL + c.borrow(); + | + +error[E0061]: this method takes 0 arguments but 1 argument was supplied + --> $DIR/shadowed-intrinsic-method.rs:34:7 + | +LL | b.borrow(()); + | ^^^^^^ -- unexpected argument of type `()` + | +note: the `borrow` call is resolved to the method in `std::borrow::Borrow`, shadowing the method of the same name on the inherent impl for `main::` + --> $DIR/shadowed-intrinsic-method.rs:34:7 + | +LL | use std::borrow::Borrow; + | ------------------- `std::borrow::Borrow` imported here +... +LL | b.borrow(()); + | ^^^^^^ refers to `std::borrow::Borrow::borrow` +note: method defined here + --> $SRC_DIR/core/src/borrow.rs:LL:COL +help: you might have meant to call the other method; you can use the fully-qualified path to call it explicitly + | +LL - b.borrow(()); +LL + B::borrow(&mut b, ()); + | +help: remove the extra argument + | +LL - b.borrow(()); +LL + b.borrow(); + | + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0061`. diff --git a/tests/ui/mismatched_types/diagnostic-method-lookup-returns-sig-with-fewer-args.stderr b/tests/ui/mismatched_types/diagnostic-method-lookup-returns-sig-with-fewer-args.stderr index 0f86916fcdae4..c683f09f19106 100644 --- a/tests/ui/mismatched_types/diagnostic-method-lookup-returns-sig-with-fewer-args.stderr +++ b/tests/ui/mismatched_types/diagnostic-method-lookup-returns-sig-with-fewer-args.stderr @@ -11,6 +11,20 @@ note: method defined here | LL | pub fn get(&self, data: i32) { | ^^^ --------- +note: the `get` call is resolved to the method in `Target`, shadowing the method of the same name on trait `RandomTrait` + --> $DIR/diagnostic-method-lookup-returns-sig-with-fewer-args.rs:4:12 + | +LL | target.get(10.0); // (used to crash here) + | ^^^ refers to `Target::get` + = note: additionally, there is 1 other available method that isn't in scope +help: you might have meant to call one of the other methods; you can use the fully-qualified path to call one of them explicitly + | +LL - target.get(10.0); // (used to crash here) +LL + <_ as std::slice::SliceIndex<_>>::get(target, 10.0); // (used to crash here) + | +LL - target.get(10.0); // (used to crash here) +LL + <_ as object::read::elf::relocation::Relr>::get(&target, 10.0); // (used to crash here) + | error: aborting due to 1 previous error diff --git a/tests/ui/reachable/never-pattern-closure-param-array.rs b/tests/ui/reachable/never-pattern-closure-param-array.rs new file mode 100644 index 0000000000000..83bbc4b39b772 --- /dev/null +++ b/tests/ui/reachable/never-pattern-closure-param-array.rs @@ -0,0 +1,13 @@ +//@ check-pass +//@ edition: 2024 + +#![feature(never_patterns)] +#![allow(incomplete_features)] +#![allow(unreachable_code)] + +fn main() { + let _ = Some({ + return; + }) + .map(|!| [1]); +} diff --git a/tests/ui/suggestions/shadowed-lplace-method.fixed b/tests/ui/suggestions/shadowed-lplace-method.fixed index 87db01a3b230b..e7f6df9fff8fb 100644 --- a/tests/ui/suggestions/shadowed-lplace-method.fixed +++ b/tests/ui/suggestions/shadowed-lplace-method.fixed @@ -6,5 +6,5 @@ use std::rc::Rc; fn main() { let rc = Rc::new(RefCell::new(true)); - *std::cell::RefCell::<_>::borrow_mut(&rc) = false; //~ ERROR E0308 + *RefCell::borrow_mut(&rc) = false; //~ ERROR E0308 } diff --git a/tests/ui/suggestions/shadowed-lplace-method.stderr b/tests/ui/suggestions/shadowed-lplace-method.stderr index aab9e442007ff..dfd52b9b5587b 100644 --- a/tests/ui/suggestions/shadowed-lplace-method.stderr +++ b/tests/ui/suggestions/shadowed-lplace-method.stderr @@ -19,7 +19,7 @@ LL | *rc.borrow_mut() = false; help: you might have meant to call the other method; you can use the fully-qualified path to call it explicitly | LL - *rc.borrow_mut() = false; -LL + *std::cell::RefCell::<_>::borrow_mut(&rc) = false; +LL + *RefCell::borrow_mut(&rc) = false; | error: aborting due to 1 previous error diff --git a/tests/ui/unsafe/access_union_field.rs b/tests/ui/union/access_union_field.rs similarity index 100% rename from tests/ui/unsafe/access_union_field.rs rename to tests/ui/union/access_union_field.rs diff --git a/tests/ui/unsafe/access_union_field.stderr b/tests/ui/union/access_union_field.stderr similarity index 100% rename from tests/ui/unsafe/access_union_field.stderr rename to tests/ui/union/access_union_field.stderr diff --git a/tests/ui/unsafe/union-assignop.rs b/tests/ui/union/union-assignop.rs similarity index 100% rename from tests/ui/unsafe/union-assignop.rs rename to tests/ui/union/union-assignop.rs diff --git a/tests/ui/unsafe/union-assignop.stderr b/tests/ui/union/union-assignop.stderr similarity index 100% rename from tests/ui/unsafe/union-assignop.stderr rename to tests/ui/union/union-assignop.stderr diff --git a/tests/ui/unsafe/union-modification.rs b/tests/ui/union/union-modification.rs similarity index 100% rename from tests/ui/unsafe/union-modification.rs rename to tests/ui/union/union-modification.rs diff --git a/tests/ui/unsafe/union-pat-in-param.rs b/tests/ui/union/union-pat-in-param.rs similarity index 100% rename from tests/ui/unsafe/union-pat-in-param.rs rename to tests/ui/union/union-pat-in-param.rs diff --git a/tests/ui/unsafe/union-pat-in-param.stderr b/tests/ui/union/union-pat-in-param.stderr similarity index 100% rename from tests/ui/unsafe/union-pat-in-param.stderr rename to tests/ui/union/union-pat-in-param.stderr diff --git a/tests/ui/unsafe/union.rs b/tests/ui/union/union.rs similarity index 100% rename from tests/ui/unsafe/union.rs rename to tests/ui/union/union.rs diff --git a/tests/ui/unsafe/union.stderr b/tests/ui/union/union.stderr similarity index 100% rename from tests/ui/unsafe/union.stderr rename to tests/ui/union/union.stderr diff --git a/tests/ui/unsafe/union_access_through_block.rs b/tests/ui/union/union_access_through_block.rs similarity index 100% rename from tests/ui/unsafe/union_access_through_block.rs rename to tests/ui/union/union_access_through_block.rs diff --git a/tests/ui/unsafe/union_destructure.rs b/tests/ui/union/union_destructure.rs similarity index 100% rename from tests/ui/unsafe/union_destructure.rs rename to tests/ui/union/union_destructure.rs diff --git a/tests/ui/unsafe/union_wild_or_wild.rs b/tests/ui/union/union_wild_or_wild.rs similarity index 100% rename from tests/ui/unsafe/union_wild_or_wild.rs rename to tests/ui/union/union_wild_or_wild.rs diff --git a/tests/ui/unsafe/move-out-of-non-copy.rs b/tests/ui/unsafe-binders/move-out-of-non-copy.rs similarity index 100% rename from tests/ui/unsafe/move-out-of-non-copy.rs rename to tests/ui/unsafe-binders/move-out-of-non-copy.rs diff --git a/tests/ui/unsafe/move-out-of-non-copy.stderr b/tests/ui/unsafe-binders/move-out-of-non-copy.stderr similarity index 100% rename from tests/ui/unsafe/move-out-of-non-copy.stderr rename to tests/ui/unsafe-binders/move-out-of-non-copy.stderr diff --git a/tests/ui/unsafe/initializing-ranged-via-ctor.rs b/tests/ui/unsafe/rustc_layout_scalar_valid_range/initializing-ranged-via-ctor.rs similarity index 100% rename from tests/ui/unsafe/initializing-ranged-via-ctor.rs rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/initializing-ranged-via-ctor.rs diff --git a/tests/ui/unsafe/initializing-ranged-via-ctor.stderr b/tests/ui/unsafe/rustc_layout_scalar_valid_range/initializing-ranged-via-ctor.stderr similarity index 100% rename from tests/ui/unsafe/initializing-ranged-via-ctor.stderr rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/initializing-ranged-via-ctor.stderr diff --git a/tests/ui/unsafe/ranged-ctor-as-fn-ptr.rs b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged-ctor-as-fn-ptr.rs similarity index 100% rename from tests/ui/unsafe/ranged-ctor-as-fn-ptr.rs rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged-ctor-as-fn-ptr.rs diff --git a/tests/ui/unsafe/ranged-ctor-as-fn-ptr.stderr b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged-ctor-as-fn-ptr.stderr similarity index 100% rename from tests/ui/unsafe/ranged-ctor-as-fn-ptr.stderr rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged-ctor-as-fn-ptr.stderr diff --git a/tests/ui/unsafe/ranged_ints.rs b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints.rs similarity index 100% rename from tests/ui/unsafe/ranged_ints.rs rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints.rs diff --git a/tests/ui/unsafe/ranged_ints.stderr b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints.stderr similarity index 100% rename from tests/ui/unsafe/ranged_ints.stderr rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints.stderr diff --git a/tests/ui/unsafe/ranged_ints2.rs b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints2.rs similarity index 100% rename from tests/ui/unsafe/ranged_ints2.rs rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints2.rs diff --git a/tests/ui/unsafe/ranged_ints2.stderr b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints2.stderr similarity index 100% rename from tests/ui/unsafe/ranged_ints2.stderr rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints2.stderr diff --git a/tests/ui/unsafe/ranged_ints2_const.rs b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints2_const.rs similarity index 100% rename from tests/ui/unsafe/ranged_ints2_const.rs rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints2_const.rs diff --git a/tests/ui/unsafe/ranged_ints2_const.stderr b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints2_const.stderr similarity index 100% rename from tests/ui/unsafe/ranged_ints2_const.stderr rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints2_const.stderr diff --git a/tests/ui/unsafe/ranged_ints3.rs b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints3.rs similarity index 100% rename from tests/ui/unsafe/ranged_ints3.rs rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints3.rs diff --git a/tests/ui/unsafe/ranged_ints3.stderr b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints3.stderr similarity index 100% rename from tests/ui/unsafe/ranged_ints3.stderr rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints3.stderr diff --git a/tests/ui/unsafe/ranged_ints3_const.rs b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints3_const.rs similarity index 100% rename from tests/ui/unsafe/ranged_ints3_const.rs rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints3_const.rs diff --git a/tests/ui/unsafe/ranged_ints3_const.stderr b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints3_const.stderr similarity index 100% rename from tests/ui/unsafe/ranged_ints3_const.stderr rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints3_const.stderr diff --git a/tests/ui/unsafe/ranged_ints3_match.rs b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints3_match.rs similarity index 100% rename from tests/ui/unsafe/ranged_ints3_match.rs rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints3_match.rs diff --git a/tests/ui/unsafe/ranged_ints3_match.stderr b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints3_match.stderr similarity index 100% rename from tests/ui/unsafe/ranged_ints3_match.stderr rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints3_match.stderr diff --git a/tests/ui/unsafe/ranged_ints4.rs b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints4.rs similarity index 100% rename from tests/ui/unsafe/ranged_ints4.rs rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints4.rs diff --git a/tests/ui/unsafe/ranged_ints4.stderr b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints4.stderr similarity index 100% rename from tests/ui/unsafe/ranged_ints4.stderr rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints4.stderr diff --git a/tests/ui/unsafe/ranged_ints4_const.rs b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints4_const.rs similarity index 100% rename from tests/ui/unsafe/ranged_ints4_const.rs rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints4_const.rs diff --git a/tests/ui/unsafe/ranged_ints4_const.stderr b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints4_const.stderr similarity index 100% rename from tests/ui/unsafe/ranged_ints4_const.stderr rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints4_const.stderr diff --git a/tests/ui/unsafe/ranged_ints_const.rs b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints_const.rs similarity index 100% rename from tests/ui/unsafe/ranged_ints_const.rs rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints_const.rs diff --git a/tests/ui/unsafe/ranged_ints_const.stderr b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints_const.stderr similarity index 100% rename from tests/ui/unsafe/ranged_ints_const.stderr rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints_const.stderr diff --git a/tests/ui/unsafe/ranged_ints_macro.rs b/tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints_macro.rs similarity index 100% rename from tests/ui/unsafe/ranged_ints_macro.rs rename to tests/ui/unsafe/rustc_layout_scalar_valid_range/ranged_ints_macro.rs diff --git a/triagebot.toml b/triagebot.toml index 86192295e0cdb..01d047cdae553 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -194,6 +194,11 @@ Hi relnotes-interest-group, this issue/PR could use some help in reviewing / adjusting release notes. Could you take a look if available? Thanks <3 """ +[ping.gpu-target] +message = """\ +Hi GPU experts, this issue/PR could use some guidance on how this should be +resolved/implemented. Could you take a look if available? Thanks <3 +""" # ------------------------------------------------------------------------------ # Autolabels