Auto merge of #132326 - matthiaskrgr:rollup-ngyw18g, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #131984 (Stabilize if_let_rescope)
 - #132151 (Ensure that resume arg outlives region bound for coroutines)
 - #132157 (Remove detail from label/note that is already available in other note)
 - #132274 (Cleanup op lookup in HIR typeck)
 - #132319 (cg_llvm: Clean up FFI calls for setting module flags)
 - #132321 (xous: sync: remove `rustc_const_stable` attribute on Condvar and Mutex new())

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2024-10-29 19:25:03 +00:00
commit 1e4f10ba64
261 changed files with 857 additions and 824 deletions

View File

@ -25,7 +25,6 @@ use tracing::{debug, info};
use crate::back::write::{
self, CodegenDiagnosticsStage, DiagnosticHandlers, bitcode_section_name, save_temp_bitcode,
};
use crate::common::AsCCharPtr;
use crate::errors::{
DynamicLinkingWithLTO, LlvmError, LtoBitcodeFromRlib, LtoDisallowed, LtoDylib, LtoProcMacro,
};
@ -602,23 +601,9 @@ pub(crate) fn run_pass_manager(
// This code is based off the code found in llvm's LTO code generator:
// llvm/lib/LTO/LTOCodeGenerator.cpp
debug!("running the pass manager");
unsafe {
if !llvm::LLVMRustHasModuleFlag(
module.module_llvm.llmod(),
"LTOPostLink".as_c_char_ptr(),
11,
) {
llvm::LLVMRustAddModuleFlagU32(
module.module_llvm.llmod(),
llvm::LLVMModFlagBehavior::Error,
c"LTOPostLink".as_ptr(),
1,
);
}
let opt_stage = if thin { llvm::OptStage::ThinLTO } else { llvm::OptStage::FatLTO };
let opt_level = config.opt_level.unwrap_or(config::OptLevel::No);
write::llvm_optimize(cgcx, dcx, module, config, opt_level, opt_stage)?;
}
let opt_stage = if thin { llvm::OptStage::ThinLTO } else { llvm::OptStage::FatLTO };
let opt_level = config.opt_level.unwrap_or(config::OptLevel::No);
unsafe { write::llvm_optimize(cgcx, dcx, module, config, opt_level, opt_stage) }?;
debug!("lto done");
Ok(())
}

View File

@ -210,133 +210,111 @@ pub(crate) unsafe fn create_module<'ll>(
// If skipping the PLT is enabled, we need to add some module metadata
// to ensure intrinsic calls don't use it.
if !sess.needs_plt() {
let avoid_plt = c"RtLibUseGOT".as_ptr();
unsafe {
llvm::LLVMRustAddModuleFlagU32(llmod, llvm::LLVMModFlagBehavior::Warning, avoid_plt, 1);
}
llvm::add_module_flag_u32(llmod, llvm::ModuleFlagMergeBehavior::Warning, "RtLibUseGOT", 1);
}
// Enable canonical jump tables if CFI is enabled. (See https://reviews.llvm.org/D65629.)
if sess.is_sanitizer_cfi_canonical_jump_tables_enabled() && sess.is_sanitizer_cfi_enabled() {
let canonical_jump_tables = c"CFI Canonical Jump Tables".as_ptr();
unsafe {
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Override,
canonical_jump_tables,
1,
);
}
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Override,
"CFI Canonical Jump Tables",
1,
);
}
// If we're normalizing integers with CFI, ensure LLVM generated functions do the same.
// See https://github.com/llvm/llvm-project/pull/104826
if sess.is_sanitizer_cfi_normalize_integers_enabled() {
let cfi_normalize_integers = c"cfi-normalize-integers".as_ptr();
unsafe {
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Override,
cfi_normalize_integers,
1,
);
}
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Override,
"cfi-normalize-integers",
1,
);
}
// Enable LTO unit splitting if specified or if CFI is enabled. (See
// https://reviews.llvm.org/D53891.)
if sess.is_split_lto_unit_enabled() || sess.is_sanitizer_cfi_enabled() {
let enable_split_lto_unit = c"EnableSplitLTOUnit".as_ptr();
unsafe {
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Override,
enable_split_lto_unit,
1,
);
}
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Override,
"EnableSplitLTOUnit",
1,
);
}
// Add "kcfi" module flag if KCFI is enabled. (See https://reviews.llvm.org/D119296.)
if sess.is_sanitizer_kcfi_enabled() {
let kcfi = c"kcfi".as_ptr();
unsafe {
llvm::LLVMRustAddModuleFlagU32(llmod, llvm::LLVMModFlagBehavior::Override, kcfi, 1);
}
llvm::add_module_flag_u32(llmod, llvm::ModuleFlagMergeBehavior::Override, "kcfi", 1);
// Add "kcfi-offset" module flag with -Z patchable-function-entry (See
// https://reviews.llvm.org/D141172).
let pfe =
PatchableFunctionEntry::from_config(sess.opts.unstable_opts.patchable_function_entry);
if pfe.prefix() > 0 {
let kcfi_offset = c"kcfi-offset".as_ptr();
unsafe {
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Override,
kcfi_offset,
pfe.prefix().into(),
);
}
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Override,
"kcfi-offset",
pfe.prefix().into(),
);
}
}
// Control Flow Guard is currently only supported by the MSVC linker on Windows.
if sess.target.is_like_msvc {
unsafe {
match sess.opts.cg.control_flow_guard {
CFGuard::Disabled => {}
CFGuard::NoChecks => {
// Set `cfguard=1` module flag to emit metadata only.
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Warning,
c"cfguard".as_ptr() as *const _,
1,
)
}
CFGuard::Checks => {
// Set `cfguard=2` module flag to emit metadata and checks.
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Warning,
c"cfguard".as_ptr() as *const _,
2,
)
}
match sess.opts.cg.control_flow_guard {
CFGuard::Disabled => {}
CFGuard::NoChecks => {
// Set `cfguard=1` module flag to emit metadata only.
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Warning,
"cfguard",
1,
);
}
CFGuard::Checks => {
// Set `cfguard=2` module flag to emit metadata and checks.
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Warning,
"cfguard",
2,
);
}
}
}
if let Some(BranchProtection { bti, pac_ret }) = sess.opts.unstable_opts.branch_protection {
if sess.target.arch == "aarch64" {
unsafe {
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Min,
c"branch-target-enforcement".as_ptr(),
bti.into(),
);
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Min,
c"sign-return-address".as_ptr(),
pac_ret.is_some().into(),
);
let pac_opts = pac_ret.unwrap_or(PacRet { leaf: false, key: PAuthKey::A });
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Min,
c"sign-return-address-all".as_ptr(),
pac_opts.leaf.into(),
);
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Min,
c"sign-return-address-with-bkey".as_ptr(),
u32::from(pac_opts.key == PAuthKey::B),
);
}
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Min,
"branch-target-enforcement",
bti.into(),
);
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Min,
"sign-return-address",
pac_ret.is_some().into(),
);
let pac_opts = pac_ret.unwrap_or(PacRet { leaf: false, key: PAuthKey::A });
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Min,
"sign-return-address-all",
pac_opts.leaf.into(),
);
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Min,
"sign-return-address-with-bkey",
u32::from(pac_opts.key == PAuthKey::B),
);
} else {
bug!(
"branch-protection used on non-AArch64 target; \
@ -347,59 +325,46 @@ pub(crate) unsafe fn create_module<'ll>(
// Pass on the control-flow protection flags to LLVM (equivalent to `-fcf-protection` in Clang).
if let CFProtection::Branch | CFProtection::Full = sess.opts.unstable_opts.cf_protection {
unsafe {
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Override,
c"cf-protection-branch".as_ptr(),
1,
);
}
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Override,
"cf-protection-branch",
1,
);
}
if let CFProtection::Return | CFProtection::Full = sess.opts.unstable_opts.cf_protection {
unsafe {
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Override,
c"cf-protection-return".as_ptr(),
1,
);
}
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Override,
"cf-protection-return",
1,
);
}
if sess.opts.unstable_opts.virtual_function_elimination {
unsafe {
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Error,
c"Virtual Function Elim".as_ptr(),
1,
);
}
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Error,
"Virtual Function Elim",
1,
);
}
// Set module flag to enable Windows EHCont Guard (/guard:ehcont).
if sess.opts.unstable_opts.ehcont_guard {
unsafe {
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Warning,
c"ehcontguard".as_ptr() as *const _,
1,
)
}
llvm::add_module_flag_u32(llmod, llvm::ModuleFlagMergeBehavior::Warning, "ehcontguard", 1);
}
match sess.opts.unstable_opts.function_return {
FunctionReturn::Keep => {}
FunctionReturn::ThunkExtern => unsafe {
llvm::LLVMRustAddModuleFlagU32(
FunctionReturn::ThunkExtern => {
llvm::add_module_flag_u32(
llmod,
llvm::LLVMModFlagBehavior::Override,
c"function_return_thunk_extern".as_ptr(),
llvm::ModuleFlagMergeBehavior::Override,
"function_return_thunk_extern",
1,
)
},
);
}
}
match (sess.opts.unstable_opts.small_data_threshold, sess.target.small_data_threshold_support())
@ -407,15 +372,12 @@ pub(crate) unsafe fn create_module<'ll>(
// Set up the small-data optimization limit for architectures that use
// an LLVM module flag to control this.
(Some(threshold), SmallDataThresholdSupport::LlvmModuleFlag(flag)) => {
let flag = SmallCStr::new(flag.as_ref());
unsafe {
llvm::LLVMRustAddModuleFlagU32(
llmod,
llvm::LLVMModFlagBehavior::Error,
flag.as_c_str().as_ptr(),
threshold as u32,
)
}
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Error,
&flag,
threshold as u32,
);
}
_ => (),
};
@ -449,33 +411,29 @@ pub(crate) unsafe fn create_module<'ll>(
// If llvm_abiname is empty, emit nothing.
let llvm_abiname = &sess.target.options.llvm_abiname;
if matches!(sess.target.arch.as_ref(), "riscv32" | "riscv64") && !llvm_abiname.is_empty() {
unsafe {
llvm::LLVMRustAddModuleFlagString(
llmod,
llvm::LLVMModFlagBehavior::Error,
c"target-abi".as_ptr(),
llvm_abiname.as_c_char_ptr(),
llvm_abiname.len(),
);
}
llvm::add_module_flag_str(
llmod,
llvm::ModuleFlagMergeBehavior::Error,
"target-abi",
llvm_abiname,
);
}
// Add module flags specified via -Z llvm_module_flag
for (key, value, behavior) in &sess.opts.unstable_opts.llvm_module_flag {
let key = format!("{key}\0");
let behavior = match behavior.as_str() {
"error" => llvm::LLVMModFlagBehavior::Error,
"warning" => llvm::LLVMModFlagBehavior::Warning,
"require" => llvm::LLVMModFlagBehavior::Require,
"override" => llvm::LLVMModFlagBehavior::Override,
"append" => llvm::LLVMModFlagBehavior::Append,
"appendunique" => llvm::LLVMModFlagBehavior::AppendUnique,
"max" => llvm::LLVMModFlagBehavior::Max,
"min" => llvm::LLVMModFlagBehavior::Min,
for (key, value, merge_behavior) in &sess.opts.unstable_opts.llvm_module_flag {
let merge_behavior = match merge_behavior.as_str() {
"error" => llvm::ModuleFlagMergeBehavior::Error,
"warning" => llvm::ModuleFlagMergeBehavior::Warning,
"require" => llvm::ModuleFlagMergeBehavior::Require,
"override" => llvm::ModuleFlagMergeBehavior::Override,
"append" => llvm::ModuleFlagMergeBehavior::Append,
"appendunique" => llvm::ModuleFlagMergeBehavior::AppendUnique,
"max" => llvm::ModuleFlagMergeBehavior::Max,
"min" => llvm::ModuleFlagMergeBehavior::Min,
// We already checked this during option parsing
_ => unreachable!(),
};
unsafe { llvm::LLVMRustAddModuleFlagU32(llmod, behavior, key.as_c_char_ptr(), *value) }
llvm::add_module_flag_u32(llmod, merge_behavior, key, *value);
}
llmod

View File

@ -91,45 +91,39 @@ impl<'ll, 'tcx> CodegenUnitDebugContext<'ll, 'tcx> {
}
pub(crate) fn finalize(&self, sess: &Session) {
unsafe {
llvm::LLVMRustDIBuilderFinalize(self.builder);
if !sess.target.is_like_msvc {
// Debuginfo generation in LLVM by default uses a higher
// version of dwarf than macOS currently understands. We can
// instruct LLVM to emit an older version of dwarf, however,
// for macOS to understand. For more info see #11352
// This can be overridden using --llvm-opts -dwarf-version,N.
// Android has the same issue (#22398)
let dwarf_version = sess
.opts
.unstable_opts
.dwarf_version
.unwrap_or(sess.target.default_dwarf_version);
llvm::LLVMRustAddModuleFlagU32(
self.llmod,
llvm::LLVMModFlagBehavior::Warning,
c"Dwarf Version".as_ptr(),
dwarf_version,
);
} else {
// Indicate that we want CodeView debug information on MSVC
llvm::LLVMRustAddModuleFlagU32(
self.llmod,
llvm::LLVMModFlagBehavior::Warning,
c"CodeView".as_ptr(),
1,
)
}
// Prevent bitcode readers from deleting the debug info.
llvm::LLVMRustAddModuleFlagU32(
unsafe { llvm::LLVMRustDIBuilderFinalize(self.builder) };
if !sess.target.is_like_msvc {
// Debuginfo generation in LLVM by default uses a higher
// version of dwarf than macOS currently understands. We can
// instruct LLVM to emit an older version of dwarf, however,
// for macOS to understand. For more info see #11352
// This can be overridden using --llvm-opts -dwarf-version,N.
// Android has the same issue (#22398)
let dwarf_version =
sess.opts.unstable_opts.dwarf_version.unwrap_or(sess.target.default_dwarf_version);
llvm::add_module_flag_u32(
self.llmod,
llvm::LLVMModFlagBehavior::Warning,
c"Debug Info Version".as_ptr(),
llvm::LLVMRustDebugMetadataVersion(),
llvm::ModuleFlagMergeBehavior::Warning,
"Dwarf Version",
dwarf_version,
);
} else {
// Indicate that we want CodeView debug information on MSVC
llvm::add_module_flag_u32(
self.llmod,
llvm::ModuleFlagMergeBehavior::Warning,
"CodeView",
1,
);
}
// Prevent bitcode readers from deleting the debug info.
llvm::add_module_flag_u32(
self.llmod,
llvm::ModuleFlagMergeBehavior::Warning,
"Debug Info Version",
unsafe { llvm::LLVMRustDebugMetadataVersion() },
);
}
}

View File

@ -85,7 +85,7 @@ pub enum LLVMMachineType {
ARM = 0x01c0,
}
/// LLVM's Module::ModFlagBehavior, defined in llvm/include/llvm/IR/Module.h.
/// Must match the layout of `LLVMRustModuleFlagMergeBehavior`.
///
/// When merging modules (e.g. during LTO), their metadata flags are combined. Conflicts are
/// resolved according to the merge behaviors specified here. Flags differing only in merge
@ -93,9 +93,13 @@ pub enum LLVMMachineType {
///
/// In order for Rust-C LTO to work, we must specify behaviors compatible with Clang. Notably,
/// 'Error' and 'Warning' cannot be mixed for a given flag.
///
/// There is a stable LLVM-C version of this enum (`LLVMModuleFlagBehavior`),
/// but as of LLVM 19 it does not support all of the enum values in the unstable
/// C++ API.
#[derive(Copy, Clone, PartialEq)]
#[repr(C)]
pub enum LLVMModFlagBehavior {
pub enum ModuleFlagMergeBehavior {
Error = 1,
Warning = 2,
Require = 3,
@ -1829,21 +1833,21 @@ unsafe extern "C" {
/// "compatible" means depends on the merge behaviors involved.
pub fn LLVMRustAddModuleFlagU32(
M: &Module,
merge_behavior: LLVMModFlagBehavior,
name: *const c_char,
value: u32,
MergeBehavior: ModuleFlagMergeBehavior,
Name: *const c_char,
NameLen: size_t,
Value: u32,
);
pub fn LLVMRustAddModuleFlagString(
M: &Module,
merge_behavior: LLVMModFlagBehavior,
name: *const c_char,
value: *const c_char,
value_len: size_t,
MergeBehavior: ModuleFlagMergeBehavior,
Name: *const c_char,
NameLen: size_t,
Value: *const c_char,
ValueLen: size_t,
);
pub fn LLVMRustHasModuleFlag(M: &Module, name: *const c_char, len: size_t) -> bool;
pub fn LLVMRustDIBuilderCreate(M: &Module) -> &mut DIBuilder<'_>;
pub fn LLVMRustDIBuilderDispose<'a>(Builder: &'a mut DIBuilder<'a>);

View File

@ -352,3 +352,32 @@ impl Drop for OperandBundleDef<'_> {
}
}
}
pub(crate) fn add_module_flag_u32(
module: &Module,
merge_behavior: ModuleFlagMergeBehavior,
key: &str,
value: u32,
) {
unsafe {
LLVMRustAddModuleFlagU32(module, merge_behavior, key.as_c_char_ptr(), key.len(), value);
}
}
pub(crate) fn add_module_flag_str(
module: &Module,
merge_behavior: ModuleFlagMergeBehavior,
key: &str,
value: &str,
) {
unsafe {
LLVMRustAddModuleFlagString(
module,
merge_behavior,
key.as_c_char_ptr(),
key.len(),
value.as_c_char_ptr(),
value.len(),
);
}
}

View File

@ -224,6 +224,8 @@ declare_features! (
(accepted, i128_type, "1.26.0", Some(35118)),
/// Allows the use of `if let` expressions.
(accepted, if_let, "1.0.0", None),
/// Rescoping temporaries in `if let` to align with Rust 2024.
(accepted, if_let_rescope, "CURRENT_RUSTC_VERSION", Some(124085)),
/// Allows top level or-patterns (`p | q`) in `if let` and `while let`.
(accepted, if_while_or_patterns, "1.33.0", Some(48215)),
/// Allows lifetime elision in `impl` headers. For example:

View File

@ -505,8 +505,6 @@ declare_features! (
(unstable, half_open_range_patterns_in_slices, "1.66.0", Some(67264)),
/// Allows `if let` guard in match arms.
(unstable, if_let_guard, "1.47.0", Some(51114)),
/// Rescoping temporaries in `if let` to align with Rust 2024.
(unstable, if_let_rescope, "1.83.0", Some(124085)),
/// Allows `impl Trait` to be used inside associated types (RFC 2515).
(unstable, impl_trait_in_assoc_type, "1.70.0", Some(63063)),
/// Allows `impl Trait` as output type in `Fn` traits in return position of functions.

View File

@ -464,8 +464,7 @@ fn resolve_expr<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx h
hir::ExprKind::If(cond, then, Some(otherwise)) => {
let expr_cx = visitor.cx;
let data = if expr.span.at_least_rust_2024() && visitor.tcx.features().if_let_rescope()
{
let data = if expr.span.at_least_rust_2024() {
ScopeData::IfThenRescope
} else {
ScopeData::IfThen
@ -480,8 +479,7 @@ fn resolve_expr<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, expr: &'tcx h
hir::ExprKind::If(cond, then, None) => {
let expr_cx = visitor.cx;
let data = if expr.span.at_least_rust_2024() && visitor.tcx.features().if_let_rescope()
{
let data = if expr.span.at_least_rust_2024() {
ScopeData::IfThenRescope
} else {
ScopeData::IfThen

View File

@ -23,7 +23,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
span: Span,
base_ty: Ty<'tcx>,
) -> Option<InferOk<'tcx, MethodCallee<'tcx>>> {
self.try_overloaded_place_op(span, base_ty, &[], PlaceOp::Deref)
self.try_overloaded_place_op(span, base_ty, None, PlaceOp::Deref)
}
/// Returns the adjustment steps.

View File

@ -1,4 +1,4 @@
use std::{iter, slice};
use std::iter;
use rustc_ast::util::parser::PREC_UNAMBIGUOUS;
use rustc_errors::{Applicability, Diag, ErrorGuaranteed, StashKey};
@ -300,7 +300,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
Ident::with_dummy_span(method_name),
trait_def_id,
adjusted_ty,
opt_input_type.as_ref().map(slice::from_ref),
opt_input_type,
) {
let method = self.register_infer_ok_obligations(ok);
let mut autoref = None;

View File

@ -324,35 +324,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
Ok(pick)
}
pub(super) fn obligation_for_method(
&self,
cause: ObligationCause<'tcx>,
trait_def_id: DefId,
self_ty: Ty<'tcx>,
opt_input_types: Option<&[Ty<'tcx>]>,
) -> (traits::PredicateObligation<'tcx>, ty::GenericArgsRef<'tcx>) {
// Construct a trait-reference `self_ty : Trait<input_tys>`
let args = GenericArgs::for_item(self.tcx, trait_def_id, |param, _| {
match param.kind {
GenericParamDefKind::Lifetime | GenericParamDefKind::Const { .. } => {}
GenericParamDefKind::Type { .. } => {
if param.index == 0 {
return self_ty.into();
} else if let Some(input_types) = opt_input_types {
return input_types[param.index as usize - 1].into();
}
}
}
self.var_for_def(cause.span, param)
});
let trait_ref = ty::TraitRef::new_from_args(self.tcx, trait_def_id, args);
// Construct an obligation
let poly_trait_ref = ty::Binder::dummy(trait_ref);
(traits::Obligation::new(self.tcx, cause, self.param_env, poly_trait_ref), args)
}
/// `lookup_method_in_trait` is used for overloaded operators.
/// It does a very narrow slice of what the normal probe/confirm path does.
/// In particular, it doesn't really do any probing: it simply constructs
@ -365,24 +336,34 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
m_name: Ident,
trait_def_id: DefId,
self_ty: Ty<'tcx>,
opt_input_types: Option<&[Ty<'tcx>]>,
opt_rhs_ty: Option<Ty<'tcx>>,
) -> Option<InferOk<'tcx, MethodCallee<'tcx>>> {
let (obligation, args) =
self.obligation_for_method(cause, trait_def_id, self_ty, opt_input_types);
self.construct_obligation_for_trait(m_name, trait_def_id, obligation, args)
}
// Construct a trait-reference `self_ty : Trait<input_tys>`
let args = GenericArgs::for_item(self.tcx, trait_def_id, |param, _| match param.kind {
GenericParamDefKind::Lifetime | GenericParamDefKind::Const { .. } => {
unreachable!("did not expect operator trait to have lifetime/const")
}
GenericParamDefKind::Type { .. } => {
if param.index == 0 {
self_ty.into()
} else if let Some(rhs_ty) = opt_rhs_ty {
assert_eq!(param.index, 1, "did not expect >1 param on operator trait");
rhs_ty.into()
} else {
// FIXME: We should stop passing `None` for the failure case
// when probing for call exprs. I.e. `opt_rhs_ty` should always
// be set when it needs to be.
self.var_for_def(cause.span, param)
}
}
});
// FIXME(#18741): it seems likely that we can consolidate some of this
// code with the other method-lookup code. In particular, the second half
// of this method is basically the same as confirmation.
fn construct_obligation_for_trait(
&self,
m_name: Ident,
trait_def_id: DefId,
obligation: traits::PredicateObligation<'tcx>,
args: ty::GenericArgsRef<'tcx>,
) -> Option<InferOk<'tcx, MethodCallee<'tcx>>> {
debug!(?obligation);
let obligation = traits::Obligation::new(
self.tcx,
cause,
self.param_env,
ty::TraitRef::new_from_args(self.tcx, trait_def_id, args),
);
// Now we want to know if this can be matched
if !self.predicate_may_hold(&obligation) {
@ -406,8 +387,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
debug!("lookup_in_trait_adjusted: method_item={:?}", method_item);
let mut obligations = PredicateObligations::new();
// FIXME(effects): revisit when binops get `#[const_trait]`
// Instantiate late-bound regions and instantiate the trait
// parameters into the method type to get the actual method type.
//
@ -418,12 +397,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let fn_sig =
self.instantiate_binder_with_fresh_vars(obligation.cause.span, infer::FnCall, fn_sig);
let InferOk { value, obligations: o } =
let InferOk { value: fn_sig, obligations: o } =
self.at(&obligation.cause, self.param_env).normalize(fn_sig);
let fn_sig = {
obligations.extend(o);
value
};
obligations.extend(o);
// Register obligations for the parameters. This will include the
// `Self` parameter, which in turn has a bound of the main trait,
@ -435,13 +411,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// any late-bound regions appearing in its bounds.
let bounds = self.tcx.predicates_of(def_id).instantiate(self.tcx, args);
let InferOk { value, obligations: o } =
let InferOk { value: bounds, obligations: o } =
self.at(&obligation.cause, self.param_env).normalize(bounds);
let bounds = {
obligations.extend(o);
value
};
obligations.extend(o);
assert!(!bounds.has_escaping_bound_vars());
let predicates_cause = obligation.cause.clone();
@ -454,7 +426,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// Also add an obligation for the method type being well-formed.
let method_ty = Ty::new_fn_ptr(tcx, ty::Binder::dummy(fn_sig));
debug!(
"lookup_in_trait_adjusted: matched method method_ty={:?} obligation={:?}",
"lookup_method_in_trait: matched method method_ty={:?} obligation={:?}",
method_ty, obligation
);
obligations.push(traits::Obligation::new(
@ -467,7 +439,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
));
let callee = MethodCallee { def_id, args, sig: fn_sig };
debug!("callee = {:?}", callee);
Some(InferOk { obligations, value: callee })

View File

@ -15,7 +15,7 @@ use rustc_span::Span;
use rustc_span::source_map::Spanned;
use rustc_span::symbol::{Ident, sym};
use rustc_trait_selection::infer::InferCtxtExt;
use rustc_trait_selection::traits::{FulfillmentError, ObligationCtxt};
use rustc_trait_selection::traits::{FulfillmentError, Obligation, ObligationCtxt};
use rustc_type_ir::TyKind::*;
use tracing::debug;
use {rustc_ast as ast, rustc_hir as hir};
@ -895,7 +895,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let opname = Ident::with_dummy_span(opname);
let (opt_rhs_expr, opt_rhs_ty) = opt_rhs.unzip();
let input_types = opt_rhs_ty.as_slice();
let cause = self.cause(span, ObligationCauseCode::BinOp {
lhs_hir_id: lhs_expr.hir_id,
rhs_hir_id: opt_rhs_expr.map(|expr| expr.hir_id),
@ -904,13 +903,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
output_ty: expected.only_has_type(self),
});
let method = self.lookup_method_in_trait(
cause.clone(),
opname,
trait_did,
lhs_ty,
Some(input_types),
);
let method =
self.lookup_method_in_trait(cause.clone(), opname, trait_did, lhs_ty, opt_rhs_ty);
match method {
Some(ok) => {
let method = self.register_infer_ok_obligations(ok);
@ -931,9 +925,27 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
self.check_expr_coercible_to_type(rhs_expr, rhs_ty, None);
}
let (obligation, _) =
self.obligation_for_method(cause, trait_did, lhs_ty, Some(input_types));
// FIXME: This should potentially just add the obligation to the `FnCtxt`
// Construct an obligation `self_ty : Trait<input_tys>`
let args =
ty::GenericArgs::for_item(self.tcx, trait_did, |param, _| match param.kind {
ty::GenericParamDefKind::Lifetime
| ty::GenericParamDefKind::Const { .. } => {
unreachable!("did not expect operand trait to have lifetime/const args")
}
ty::GenericParamDefKind::Type { .. } => {
if param.index == 0 {
lhs_ty.into()
} else {
opt_rhs_ty.expect("expected RHS for binop").into()
}
}
});
let obligation = Obligation::new(
self.tcx,
cause,
self.param_env,
ty::TraitRef::new_from_args(self.tcx, trait_did, args),
);
let ocx = ObligationCtxt::new_with_diagnostics(&self.infcx);
ocx.register_obligation(obligation);
Err(ocx.select_all_or_error())

View File

@ -149,7 +149,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// If some lookup succeeded, install method in table
let input_ty = self.next_ty_var(base_expr.span);
let method =
self.try_overloaded_place_op(expr.span, self_ty, &[input_ty], PlaceOp::Index);
self.try_overloaded_place_op(expr.span, self_ty, Some(input_ty), PlaceOp::Index);
if let Some(result) = method {
debug!("try_index_step: success, using overloaded indexing");
@ -189,7 +189,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
&self,
span: Span,
base_ty: Ty<'tcx>,
arg_tys: &[Ty<'tcx>],
opt_rhs_ty: Option<Ty<'tcx>>,
op: PlaceOp,
) -> Option<InferOk<'tcx, MethodCallee<'tcx>>> {
debug!("try_overloaded_place_op({:?},{:?},{:?})", span, base_ty, op);
@ -207,7 +207,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
Ident::with_dummy_span(imm_op),
imm_tr,
base_ty,
Some(arg_tys),
opt_rhs_ty,
)
}
@ -215,7 +215,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
&self,
span: Span,
base_ty: Ty<'tcx>,
arg_tys: &[Ty<'tcx>],
opt_rhs_ty: Option<Ty<'tcx>>,
op: PlaceOp,
) -> Option<InferOk<'tcx, MethodCallee<'tcx>>> {
debug!("try_mutable_overloaded_place_op({:?},{:?},{:?})", span, base_ty, op);
@ -233,7 +233,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
Ident::with_dummy_span(mut_op),
mut_tr,
base_ty,
Some(arg_tys),
opt_rhs_ty,
)
}
@ -284,7 +284,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
&& let Some(ok) = self.try_mutable_overloaded_place_op(
expr.span,
source,
&[],
None,
PlaceOp::Deref,
)
{
@ -359,8 +359,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
Some(self.typeck_results.borrow().node_args(expr.hir_id).type_at(1))
}
};
let arg_tys = arg_ty.as_slice();
let method = self.try_mutable_overloaded_place_op(expr.span, base_ty, arg_tys, op);
let method = self.try_mutable_overloaded_place_op(expr.span, base_ty, arg_ty, op);
let method = match method {
Some(ok) => self.register_infer_ok_obligations(ok),
// Couldn't find the mutable variant of the place op, keep the

View File

@ -24,7 +24,6 @@ declare_lint! {
/// ### Example
///
/// ```rust,edition2021
/// #![feature(if_let_rescope)]
/// #![warn(if_let_rescope)]
/// #![allow(unused_variables)]
///
@ -243,7 +242,7 @@ impl_lint_pass!(
impl<'tcx> LateLintPass<'tcx> for IfLetRescope {
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) {
if expr.span.edition().at_least_rust_2024() || !cx.tcx.features().if_let_rescope() {
if expr.span.edition().at_least_rust_2024() {
return;
}
if let (Level::Allow, _) = cx.tcx.lint_level_at_node(IF_LET_RESCOPE, expr.hir_id) {

View File

@ -853,25 +853,63 @@ extern "C" uint32_t LLVMRustVersionMinor() { return LLVM_VERSION_MINOR; }
extern "C" uint32_t LLVMRustVersionMajor() { return LLVM_VERSION_MAJOR; }
extern "C" void LLVMRustAddModuleFlagU32(LLVMModuleRef M,
Module::ModFlagBehavior MergeBehavior,
const char *Name, uint32_t Value) {
unwrap(M)->addModuleFlag(MergeBehavior, Name, Value);
// FFI equivalent of LLVM's `llvm::Module::ModFlagBehavior`.
// Must match the layout of
// `rustc_codegen_llvm::llvm::ffi::ModuleFlagMergeBehavior`.
//
// There is a stable LLVM-C version of this enum (`LLVMModuleFlagBehavior`),
// but as of LLVM 19 it does not support all of the enum values in the unstable
// C++ API.
enum class LLVMRustModuleFlagMergeBehavior {
Error = 1,
Warning = 2,
Require = 3,
Override = 4,
Append = 5,
AppendUnique = 6,
Max = 7,
Min = 8,
};
static Module::ModFlagBehavior
fromRust(LLVMRustModuleFlagMergeBehavior Behavior) {
switch (Behavior) {
case LLVMRustModuleFlagMergeBehavior::Error:
return Module::ModFlagBehavior::Error;
case LLVMRustModuleFlagMergeBehavior::Warning:
return Module::ModFlagBehavior::Warning;
case LLVMRustModuleFlagMergeBehavior::Require:
return Module::ModFlagBehavior::Require;
case LLVMRustModuleFlagMergeBehavior::Override:
return Module::ModFlagBehavior::Override;
case LLVMRustModuleFlagMergeBehavior::Append:
return Module::ModFlagBehavior::Append;
case LLVMRustModuleFlagMergeBehavior::AppendUnique:
return Module::ModFlagBehavior::AppendUnique;
case LLVMRustModuleFlagMergeBehavior::Max:
return Module::ModFlagBehavior::Max;
case LLVMRustModuleFlagMergeBehavior::Min:
return Module::ModFlagBehavior::Min;
}
report_fatal_error("bad LLVMRustModuleFlagMergeBehavior");
}
extern "C" void
LLVMRustAddModuleFlagU32(LLVMModuleRef M,
LLVMRustModuleFlagMergeBehavior MergeBehavior,
const char *Name, size_t NameLen, uint32_t Value) {
unwrap(M)->addModuleFlag(fromRust(MergeBehavior), StringRef(Name, NameLen),
Value);
}
extern "C" void LLVMRustAddModuleFlagString(
LLVMModuleRef M, Module::ModFlagBehavior MergeBehavior, const char *Name,
const char *Value, size_t ValueLen) {
LLVMModuleRef M, LLVMRustModuleFlagMergeBehavior MergeBehavior,
const char *Name, size_t NameLen, const char *Value, size_t ValueLen) {
unwrap(M)->addModuleFlag(
MergeBehavior, Name,
fromRust(MergeBehavior), StringRef(Name, NameLen),
MDString::get(unwrap(M)->getContext(), StringRef(Value, ValueLen)));
}
extern "C" bool LLVMRustHasModuleFlag(LLVMModuleRef M, const char *Name,
size_t Len) {
return unwrap(M)->getModuleFlag(StringRef(Name, Len)) != nullptr;
}
extern "C" void LLVMRustGlobalAddMetadata(LLVMValueRef Global, unsigned Kind,
LLVMMetadataRef MD) {
unwrap<GlobalObject>(Global)->addMetadata(Kind, *unwrap<MDNode>(MD));

View File

@ -784,7 +784,7 @@ impl<'tcx> Cx<'tcx> {
if_then_scope: region::Scope {
id: then.hir_id.local_id,
data: {
if expr.span.at_least_rust_2024() && tcx.features().if_let_rescope() {
if expr.span.at_least_rust_2024() {
region::ScopeData::IfThenRescope
} else {
region::ScopeData::IfThen

View File

@ -5105,24 +5105,13 @@ pub(super) fn get_explanation_based_on_obligation<'tcx>(
_ => None,
};
let pred = obligation.predicate;
let (_, base) = obligation.cause.code().peel_derives_with_predicate();
let post = if let ty::PredicateKind::Clause(clause) = pred.kind().skip_binder()
&& let ty::ClauseKind::Trait(pred) = clause
&& let Some(base) = base
&& base.skip_binder() != pred
{
format!(", which is required by `{base}`")
} else {
String::new()
};
let desc = match ty_desc {
Some(desc) => format!(" {desc}"),
None => String::new(),
};
if let ty::PredicatePolarity::Positive = trait_predicate.polarity() {
format!(
"{pre_message}the trait `{}` is not implemented for{desc} `{}`{post}",
"{pre_message}the trait `{}` is not implemented for{desc} `{}`",
trait_predicate.print_modifiers_and_trait_path(),
tcx.short_ty_string(trait_predicate.self_ty().skip_binder(), &mut None),
)
@ -5130,7 +5119,7 @@ pub(super) fn get_explanation_based_on_obligation<'tcx>(
// "the trait bound `T: !Send` is not satisfied" reads better than "`!Send` is
// not implemented for `T`".
// FIXME: add note explaining explicit negative trait bounds.
format!("{pre_message}the trait bound `{trait_predicate}` is not satisfied{post}")
format!("{pre_message}the trait bound `{trait_predicate}` is not satisfied")
}
}
}

View File

@ -110,6 +110,18 @@ impl<I: Interner> TypeVisitor<I> for OutlivesCollector<'_, I> {
ty::Coroutine(_, args) => {
args.as_coroutine().tupled_upvars_ty().visit_with(self);
// Coroutines may not outlive a region unless the resume
// ty outlives a region. This is because the resume ty may
// store data that lives shorter than this outlives region
// across yield points, which may subsequently be accessed
// after the coroutine is resumed again.
//
// Conceptually, you may think of the resume arg as an upvar
// of `&mut Option<ResumeArgTy>`, since it is kinda like
// storage shared between the callee of the coroutine and the
// coroutine body.
args.as_coroutine().resume_ty().visit_with(self);
// We ignore regions in the coroutine interior as we don't
// want these to affect region inference
}

View File

@ -20,7 +20,6 @@ unsafe impl Sync for Condvar {}
impl Condvar {
#[inline]
#[rustc_const_stable(feature = "const_locks", since = "1.63.0")]
pub const fn new() -> Condvar {
Condvar { counter: AtomicUsize::new(0), timed_out: AtomicUsize::new(0) }
}

View File

@ -24,7 +24,6 @@ pub struct Mutex {
impl Mutex {
#[inline]
#[rustc_const_stable(feature = "const_locks", since = "1.63.0")]
pub const fn new() -> Mutex {
Mutex { locked: AtomicUsize::new(0), contended: AtomicBool::new(false) }
}

View File

@ -13,7 +13,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation
LL | fn new(slice: &[u8; Self::SIZE]) -> Self {
| ^^^^ doesn't have a size known at compile-time
|
= help: within `Bar<[u8]>`, the trait `Sized` is not implemented for `[u8]`, which is required by `Bar<[u8]>: Sized`
= help: within `Bar<[u8]>`, the trait `Sized` is not implemented for `[u8]`
note: required because it appears within the type `Bar<[u8]>`
--> $DIR/issue-58022.rs:8:12
|

View File

@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
LL | is_send(foo::<T>());
| ^^^^^^^^^^ future returned by `foo` is not `Send`
|
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>> { <T as Foo>::method(..) }`, which is required by `impl Future<Output = Result<(), ()>>: Send`
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>> { <T as Foo>::method(..) }`
note: future is not `Send` as it awaits another future which is not `Send`
--> $DIR/basic.rs:12:5
|

View File

@ -7,7 +7,7 @@ LL | fn method() -> impl Sized {
LL | test::<DoesntWork>();
| ^^^^^^^^^^ `*mut ()` cannot be sent between threads safely
|
= help: within `impl Sized`, the trait `Send` is not implemented for `*mut ()`, which is required by `impl Sized: Send`
= help: within `impl Sized`, the trait `Send` is not implemented for `*mut ()`
note: required because it appears within the type `impl Sized`
--> $DIR/path-unsatisfied.rs:9:20
|

View File

@ -39,7 +39,7 @@ error[E0277]: the trait bound `T: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:31:23
|
LL | type Bar: Clone = Vec<T>;
| ^^^^^^ the trait `Clone` is not implemented for `T`, which is required by `Vec<T>: Clone`
| ^^^^^^ the trait `Clone` is not implemented for `T`
|
= note: required for `Vec<T>` to implement `Clone`
note: required by a bound in `Foo::Bar`
@ -88,7 +88,7 @@ error[E0277]: the trait bound `<Self as Foo2<T>>::Baz: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:68:23
|
LL | type Bar: Clone = Vec<Self::Baz>;
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo2<T>>::Baz`, which is required by `Vec<<Self as Foo2<T>>::Baz>: Clone`
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo2<T>>::Baz`
|
= note: required for `Vec<<Self as Foo2<T>>::Baz>` to implement `Clone`
note: required by a bound in `Foo2::Bar`
@ -105,7 +105,7 @@ error[E0277]: the trait bound `<Self as Foo25<T>>::Baz: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:77:23
|
LL | type Bar: Clone = Vec<Self::Baz>;
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo25<T>>::Baz`, which is required by `Vec<<Self as Foo25<T>>::Baz>: Clone`
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo25<T>>::Baz`
|
= note: required for `Vec<<Self as Foo25<T>>::Baz>` to implement `Clone`
note: required by a bound in `Foo25::Bar`

View File

@ -39,7 +39,7 @@ error[E0277]: the trait bound `T: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:31:23
|
LL | type Bar: Clone = Vec<T>;
| ^^^^^^ the trait `Clone` is not implemented for `T`, which is required by `Vec<T>: Clone`
| ^^^^^^ the trait `Clone` is not implemented for `T`
|
= note: required for `Vec<T>` to implement `Clone`
note: required by a bound in `Foo::Bar`
@ -88,7 +88,7 @@ error[E0277]: the trait bound `<Self as Foo2<T>>::Baz: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:68:23
|
LL | type Bar: Clone = Vec<Self::Baz>;
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo2<T>>::Baz`, which is required by `Vec<<Self as Foo2<T>>::Baz>: Clone`
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo2<T>>::Baz`
|
= note: required for `Vec<<Self as Foo2<T>>::Baz>` to implement `Clone`
note: required by a bound in `Foo2::Bar`
@ -105,7 +105,7 @@ error[E0277]: the trait bound `<Self as Foo25<T>>::Baz: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:77:23
|
LL | type Bar: Clone = Vec<Self::Baz>;
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo25<T>>::Baz`, which is required by `Vec<<Self as Foo25<T>>::Baz>: Clone`
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo25<T>>::Baz`
|
= note: required for `Vec<<Self as Foo25<T>>::Baz>` to implement `Clone`
note: required by a bound in `Foo25::Bar`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-1.rs:12:14
|
LL | type U = str;
| ^^^ the trait `Clone` is not implemented for `str`, which is required by `for<'b> <i32 as X<'b>>::U: Clone`
| ^^^ the trait `Clone` is not implemented for `str`
|
= help: the trait `Clone` is implemented for `String`
note: required by a bound in `X`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-1.rs:14:14
|
LL | type V = str;
| ^^^ the trait `Clone` is not implemented for `str`, which is required by `for<'b> <u8 as Y<'b, u8>>::V: Clone`
| ^^^ the trait `Clone` is not implemented for `str`
|
= help: the trait `Clone` is implemented for `String`
note: required by a bound in `Y`

View File

@ -18,7 +18,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-2.rs:17:14
|
LL | type W = str;
| ^^^ the trait `Clone` is not implemented for `str`, which is required by `for<'b> <u16 as Z<'b, u16>>::W: Clone`
| ^^^ the trait `Clone` is not implemented for `str`
|
= help: the trait `Clone` is implemented for `String`
note: required by a bound in `Z`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-3.rs:13:14
|
LL | type U = str;
| ^^^ the trait `Clone` is not implemented for `str`, which is required by `for<'b> <(T,) as X<'b, (T,)>>::U: Clone`
| ^^^ the trait `Clone` is not implemented for `str`
|
= help: the trait `Clone` is implemented for `String`
note: required by a bound in `X`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-4.rs:13:14
|
LL | type U = str;
| ^^^ the trait `Clone` is not implemented for `str`, which is required by `for<'b> <(T,) as X<'b, T>>::U: Clone`
| ^^^ the trait `Clone` is not implemented for `str`
|
= help: the trait `Clone` is implemented for `String`
note: required by a bound in `X`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-5.rs:26:14
|
LL | type U = str;
| ^^^ the trait `Clone` is not implemented for `str`, which is required by `for<'b> <<Vec<T> as Cycle>::Next as X<'b, <Vec<T> as Cycle>::Next>>::U: Clone`
| ^^^ the trait `Clone` is not implemented for `str`
|
= help: the trait `Clone` is implemented for `String`
note: required by a bound in `X`
@ -18,7 +18,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-5.rs:31:14
|
LL | type U = str;
| ^^^ the trait `Clone` is not implemented for `str`, which is required by `for<'b> <<Box<T> as Cycle>::Next as X<'b, <Box<T> as Cycle>::Next>>::U: Clone`
| ^^^ the trait `Clone` is not implemented for `str`
|
= help: the trait `Clone` is implemented for `String`
note: required by a bound in `X`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:40:1
|
LL | pub enum ColumnInsertValue<Col, Expr> where
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -26,7 +26,7 @@ LL | | Col: Column,
... |
LL | | Default(Col),
LL | | }
| |_^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| |_^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -44,7 +44,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:10
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -63,7 +63,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:10
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -83,7 +83,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:10
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -98,7 +98,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:10
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -114,7 +114,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:17
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -133,7 +133,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:17
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -153,7 +153,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:23
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -172,7 +172,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:23
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -192,7 +192,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:23
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -207,7 +207,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:23
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -223,7 +223,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:10
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -239,7 +239,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:10
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -255,7 +255,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:23
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -271,7 +271,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:23
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -287,7 +287,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:10
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
@ -303,7 +303,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
--> $DIR/issue-38821.rs:23:23
|
LL | #[derive(Debug, Copy, Clone)]
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`, which is required by `<Col as Expression>::SqlType: IntoNullable`
| ^^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/issue-43784-associated-type.rs:14:18
|
LL | type Assoc = T;
| ^ the trait `Copy` is not implemented for `T`, which is required by `<T as Complete>::Assoc: Partial<T>`
| ^ the trait `Copy` is not implemented for `T`
|
note: required for `<T as Complete>::Assoc` to implement `Partial<T>`
--> $DIR/issue-43784-associated-type.rs:1:11

View File

@ -15,7 +15,7 @@ error[E0277]: the trait bound `T: MyDisplay` is not satisfied
--> $DIR/issue-65774-1.rs:44:76
|
LL | let closure = |config: &mut <S as MPU>::MpuConfig| writer.my_write(&config);
| ^^^^^^^ the trait `MyDisplay` is not implemented for `T`, which is required by `&mut T: MyDisplay`
| ^^^^^^^ the trait `MyDisplay` is not implemented for `T`
|
= help: the trait `MyDisplay` is implemented for `&'a mut T`
note: required for `&mut T` to implement `MyDisplay`

View File

@ -80,7 +80,7 @@ error[E0277]: the trait bound `str: Foo<'_, '_, u8>` is not satisfied
--> $DIR/substs-ppaux.rs:55:6
|
LL | <str as Foo<u8>>::bar;
| ^^^ the trait `Sized` is not implemented for `str`, which is required by `str: Foo<'_, '_, u8>`
| ^^^ the trait `Sized` is not implemented for `str`
|
note: required for `str` to implement `Foo<'_, '_, u8>`
--> $DIR/substs-ppaux.rs:15:20

View File

@ -80,7 +80,7 @@ error[E0277]: the trait bound `str: Foo<'?0, '?1, u8>` is not satisfied
--> $DIR/substs-ppaux.rs:55:6
|
LL | <str as Foo<u8>>::bar;
| ^^^ the trait `Sized` is not implemented for `str`, which is required by `str: Foo<'?0, '?1, u8>`
| ^^^ the trait `Sized` is not implemented for `str`
|
note: required for `str` to implement `Foo<'?0, '?1, u8>`
--> $DIR/substs-ppaux.rs:15:20

View File

@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
LL | is_send(foo(Some(true)));
| ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
note: future is not `Send` as this value is used across an await
--> $DIR/async-await-let-else.rs:8:15
|
@ -29,7 +29,7 @@ LL | is_send(foo2(Some(true)));
| |
| required by a bound introduced by this call
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
note: required because it's used within this `async` fn body
--> $DIR/async-await-let-else.rs:24:29
|
@ -60,7 +60,7 @@ error: future cannot be sent between threads safely
LL | is_send(foo3(Some(true)));
| ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
note: future is not `Send` as this value is used across an await
--> $DIR/async-await-let-else.rs:30:29
|
@ -80,7 +80,7 @@ error: future cannot be sent between threads safely
LL | is_send(foo4(Some(true)));
| ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
note: future is not `Send` as this value is used across an await
--> $DIR/async-await-let-else.rs:38:15
|

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `NotClonableUpvar: Clone` is not satisfied in `{as
--> $DIR/not-clone-closure.rs:32:15
|
LL | not_clone.clone();
| ^^^^^ within `{async closure@$DIR/not-clone-closure.rs:29:21: 29:34}`, the trait `Clone` is not implemented for `NotClonableUpvar`, which is required by `{async closure@$DIR/not-clone-closure.rs:29:21: 29:34}: Clone`
| ^^^^^ within `{async closure@$DIR/not-clone-closure.rs:29:21: 29:34}`, the trait `Clone` is not implemented for `NotClonableUpvar`
|
note: required because it's used within this closure
--> $DIR/not-clone-closure.rs:29:21

View File

@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
LL | assert_send(non_send_temporary_in_match());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
note: future is not `Send` as this value is used across an await
--> $DIR/async-fn-nonsend.rs:33:26
|
@ -24,7 +24,7 @@ error: future cannot be sent between threads safely
LL | assert_send(non_sync_with_method_call());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`
note: future is not `Send` as this value is used across an await
--> $DIR/async-fn-nonsend.rs:46:15
|

View File

@ -13,7 +13,7 @@ LL | | drop(cx_ref);
LL | | });
| |______^ `&mut Context<'_>` may not be safely transferred across an unwind boundary
|
= help: within `{async block@$DIR/async-is-unwindsafe.rs:12:19: 12:24}`, the trait `UnwindSafe` is not implemented for `&mut Context<'_>`, which is required by `{async block@$DIR/async-is-unwindsafe.rs:12:19: 12:24}: UnwindSafe`
= help: within `{async block@$DIR/async-is-unwindsafe.rs:12:19: 12:24}`, the trait `UnwindSafe` is not implemented for `&mut Context<'_>`
= note: `UnwindSafe` is implemented for `&Context<'_>`, but not for `&mut Context<'_>`
note: future does not implement `UnwindSafe` as this value is used across an await
--> $DIR/async-is-unwindsafe.rs:25:18

View File

@ -7,7 +7,7 @@ LL | [0usize; 0xffff_ffff_ffff_ffff].await;
| |`[usize; usize::MAX]` is not a future
| help: remove the `.await`
|
= help: the trait `Future` is not implemented for `[usize; usize::MAX]`, which is required by `[usize; usize::MAX]: IntoFuture`
= help: the trait `Future` is not implemented for `[usize; usize::MAX]`
= note: [usize; usize::MAX] must be a future or must implement `IntoFuture` to be awaited
= note: required for `[usize; usize::MAX]` to implement `IntoFuture`

View File

@ -15,7 +15,7 @@ LL | None { value: (), ..Default::default() }.await;
| |`Option<_>` is not a future
| help: remove the `.await`
|
= help: the trait `Future` is not implemented for `Option<_>`, which is required by `Option<_>: IntoFuture`
= help: the trait `Future` is not implemented for `Option<_>`
= note: Option<_> must be a future or must implement `IntoFuture` to be awaited
= note: required for `Option<_>` to implement `IntoFuture`

View File

@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
LL | assert_send(agent.handle());
| ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
note: future is not `Send` as this value is used across an await
--> $DIR/drop-track-field-assign-nonsend.rs:20:39
|

View File

@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
LL | assert_send(agent.handle());
| ^^^^^^^^^^^^^^ future returned by `handle` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
note: future is not `Send` as this value is used across an await
--> $DIR/field-assign-nonsend.rs:20:39
|

View File

@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
LL | assert_is_send(test::<T>());
| ^^^^^^^^^^^ future returned by `test` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`
note: future is not `Send` as it awaits another future which is not `Send`
--> $DIR/missing-send-bound.rs:9:5
|

View File

@ -7,7 +7,7 @@ LL | .await
| |`()` is not a future
| help: remove the `.await`
|
= help: the trait `Future` is not implemented for `()`, which is required by `(): IntoFuture`
= help: the trait `Future` is not implemented for `()`
= note: () must be a future or must implement `IntoFuture` to be awaited
= note: required for `()` to implement `IntoFuture`

View File

@ -4,7 +4,7 @@ error: future cannot be shared between threads safely
LL | is_sync(bar());
| ^^^^^ future returned by `bar` is not `Sync`
|
= help: within `impl Future<Output = ()>`, the trait `Sync` is not implemented for `Foo`, which is required by `impl Future<Output = ()>: Sync`
= help: within `impl Future<Output = ()>`, the trait `Sync` is not implemented for `Foo`
note: future is not `Sync` as this value is used across an await
--> $DIR/issue-64130-1-sync.rs:15:11
|

View File

@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
LL | is_send(bar());
| ^^^^^ future returned by `bar` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Foo`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Foo`
note: future is not `Send` as this value is used across an await
--> $DIR/issue-64130-2-send.rs:15:11
|

View File

@ -5,7 +5,7 @@ LL | async fn bar() {
| -------------- within this `impl Future<Output = ()>`
...
LL | is_qux(bar());
| ^^^^^ within `impl Future<Output = ()>`, the trait `Qux` is not implemented for `Foo`, which is required by `impl Future<Output = ()>: Qux`
| ^^^^^ within `impl Future<Output = ()>`, the trait `Qux` is not implemented for `Foo`
|
note: future does not implement `Qux` as this value is used across an await
--> $DIR/issue-64130-3-other.rs:18:11

View File

@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
LL | is_send(foo());
| ^^^^^ future returned by `foo` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, u32>`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, u32>`
note: future is not `Send` as this value is used across an await
--> $DIR/issue-64130-non-send-future-diags.rs:17:11
|

View File

@ -8,7 +8,7 @@ LL | | let _a = a;
LL | | });
| |______^ future created by async block is not `Send`
|
= help: within `{async block@$DIR/issue-67252-unnamed-future.rs:18:11: 18:16}`, the trait `Send` is not implemented for `*mut ()`, which is required by `{async block@$DIR/issue-67252-unnamed-future.rs:18:11: 18:16}: Send`
= help: within `{async block@$DIR/issue-67252-unnamed-future.rs:18:11: 18:16}`, the trait `Send` is not implemented for `*mut ()`
note: future is not `Send` as this value is used across an await
--> $DIR/issue-67252-unnamed-future.rs:20:17
|

View File

@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
LL | require_send(send_fut);
| ^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{async block@$DIR/issue-68112.rs:29:20: 29:25}: Send`
= help: the trait `Sync` is not implemented for `RefCell<i32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
note: future is not `Send` as it awaits another future which is not `Send`
--> $DIR/issue-68112.rs:31:17
@ -23,7 +23,7 @@ error: future cannot be sent between threads safely
LL | require_send(send_fut);
| ^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{async block@$DIR/issue-68112.rs:39:20: 39:25}: Send`
= help: the trait `Sync` is not implemented for `RefCell<i32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
note: future is not `Send` as it awaits another future which is not `Send`
--> $DIR/issue-68112.rs:40:17
@ -42,7 +42,7 @@ error[E0277]: `RefCell<i32>` cannot be shared between threads safely
LL | require_send(send_fut);
| ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{async block@$DIR/issue-68112.rs:57:20: 57:25}: Send`
= help: the trait `Sync` is not implemented for `RefCell<i32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Arc<RefCell<i32>>` to implement `Send`
note: required because it's used within this `async` fn body

View File

@ -4,7 +4,7 @@ error[E0277]: `*mut ()` cannot be shared between threads safely
LL | fn foo(x: NotSync) -> impl Future + Send {
| ^^^^^^^^^^^^^^^^^^ `*mut ()` cannot be shared between threads safely
|
= help: within `NotSync`, the trait `Sync` is not implemented for `*mut ()`, which is required by `{async block@$DIR/issue-70935-complex-spans.rs:18:5: 18:15}: Send`
= help: within `NotSync`, the trait `Sync` is not implemented for `*mut ()`
note: required because it appears within the type `PhantomData<*mut ()>`
--> $SRC_DIR/core/src/marker.rs:LL:COL
note: required because it appears within the type `NotSync`
@ -37,7 +37,7 @@ error[E0277]: `*mut ()` cannot be shared between threads safely
LL | fn foo(x: NotSync) -> impl Future + Send {
| ^^^^^^^^^^^^^^^^^^ `*mut ()` cannot be shared between threads safely
|
= help: within `NotSync`, the trait `Sync` is not implemented for `*mut ()`, which is required by `{async block@$DIR/issue-70935-complex-spans.rs:18:5: 18:15}: Send`
= help: within `NotSync`, the trait `Sync` is not implemented for `*mut ()`
note: required because it appears within the type `PhantomData<*mut ()>`
--> $SRC_DIR/core/src/marker.rs:LL:COL
note: required because it appears within the type `NotSync`

View File

@ -4,7 +4,7 @@ error: future cannot be sent between threads safely
LL | fake_spawn(wrong_mutex());
| ^^^^^^^^^^^^^ future returned by `wrong_mutex` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, i32>`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, i32>`
note: future is not `Send` as this value is used across an await
--> $DIR/issue-71137.rs:14:26
|

View File

@ -16,7 +16,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t
LL | async fn frob(self) {}
| ^^^^ doesn't have a size known at compile-time
|
= help: within `Foo`, the trait `Sized` is not implemented for `str`, which is required by `Foo: Sized`
= help: within `Foo`, the trait `Sized` is not implemented for `str`
note: required because it appears within the type `Foo`
--> $DIR/issue-72590-type-error-sized.rs:5:8
|

View File

@ -11,7 +11,7 @@ LL | g(issue_67893::run())
LL | pub async fn run() {
| ------------------ within this `impl Future<Output = ()>`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, ()>`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, ()>`
note: required because it's used within this `async` fn body
--> $DIR/auxiliary/issue_67893.rs:9:20
|

View File

@ -9,7 +9,7 @@ LL | gimme_send(foo());
LL | async fn foo() {
| -------------- within this `impl Future<Output = ()>`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `NotSend`, which is required by `impl Future<Output = ()>: Send`
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `NotSend`
= note: required because it appears within the type `(NotSend,)`
note: required because it's used within this `async` fn body
--> $DIR/partial-drop-partial-reinit.rs:27:16

View File

@ -2,7 +2,7 @@ error[E0277]: `PhantomPinned` cannot be unpinned
--> $DIR/pin-needed-to-poll-2.rs:43:18
|
LL | Pin::new(&mut self.sleep).poll(cx)
| -------- ^^^^^^^^^^^^^^^ within `Sleep`, the trait `Unpin` is not implemented for `PhantomPinned`, which is required by `Sleep: Unpin`
| -------- ^^^^^^^^^^^^^^^ within `Sleep`, the trait `Unpin` is not implemented for `PhantomPinned`
| |
| required by a bound introduced by this call
|

View File

@ -6,7 +6,7 @@ LL | boo().await;
| |
| this call returns `()`
|
= help: the trait `Future` is not implemented for `()`, which is required by `(): IntoFuture`
= help: the trait `Future` is not implemented for `()`
= note: () must be a future or must implement `IntoFuture` to be awaited
= note: required for `()` to implement `IntoFuture`
help: remove the `.await`
@ -28,7 +28,7 @@ LL | e!().await;
| |`()` is not a future
| help: remove the `.await`
|
= help: the trait `Future` is not implemented for `()`, which is required by `(): IntoFuture`
= help: the trait `Future` is not implemented for `()`
= note: () must be a future or must implement `IntoFuture` to be awaited
= note: required for `()` to implement `IntoFuture`
@ -44,7 +44,7 @@ LL | $expr.await
LL | f!(());
| ------ in this macro invocation
|
= help: the trait `Future` is not implemented for `()`, which is required by `(): IntoFuture`
= help: the trait `Future` is not implemented for `()`
= note: () must be a future or must implement `IntoFuture` to be awaited
= note: required for `()` to implement `IntoFuture`
= note: this error originates in the macro `f` (in Nightly builds, run with -Z macro-backtrace for more info)
@ -58,7 +58,7 @@ LL | for x in [] {}.await
| |`()` is not a future
| help: remove the `.await`
|
= help: the trait `Future` is not implemented for `()`, which is required by `(): IntoFuture`
= help: the trait `Future` is not implemented for `()`
= note: () must be a future or must implement `IntoFuture` to be awaited
= note: required for `()` to implement `IntoFuture`

View File

@ -4,7 +4,7 @@ error[E0277]: `Foo<T, U>` cannot be sent between threads safely
LL | fn generic<T, U>(v: Foo<T, U>, f: fn(<Foo<T, U> as WithAssoc>::Output) -> i32) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Foo<T, U>` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `Foo<T, U>`, which is required by `Foo<T, U>: WithAssoc`
= help: the trait `Send` is not implemented for `Foo<T, U>`
note: required for `Foo<T, U>` to implement `WithAssoc`
--> $DIR/issue-83857-ub.rs:14:15
|
@ -29,7 +29,7 @@ LL | |
LL | | }
| |_^ `Foo<T, U>` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `Foo<T, U>`, which is required by `Foo<T, U>: WithAssoc`
= help: the trait `Send` is not implemented for `Foo<T, U>`
note: required for `Foo<T, U>` to implement `WithAssoc`
--> $DIR/issue-83857-ub.rs:14:15
|

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `[u8]: AutoTrait` is not satisfied in `str`
--> $DIR/str-contains-slice-conceptually.rs:11:22
|
LL | needs_auto_trait::<str>();
| ^^^ within `str`, the trait `AutoTrait` is not implemented for `[u8]`, which is required by `str: AutoTrait`
| ^^^ within `str`, the trait `AutoTrait` is not implemented for `[u8]`
|
= note: `str` is considered to contain a `[u8]` slice for auto trait purposes
note: required by a bound in `needs_auto_trait`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `MyS2: MyTrait` is not satisfied in `(MyS2, MyS)`
--> $DIR/typeck-default-trait-impl-constituent-types-2.rs:17:18
|
LL | is_mytrait::<(MyS2, MyS)>();
| ^^^^^^^^^^^ within `(MyS2, MyS)`, the trait `MyTrait` is not implemented for `MyS2`, which is required by `(MyS2, MyS): MyTrait`
| ^^^^^^^^^^^ within `(MyS2, MyS)`, the trait `MyTrait` is not implemented for `MyS2`
|
= note: required because it appears within the type `(MyS2, MyS)`
note: required by a bound in `is_mytrait`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `&'static u32: Defaulted` is not satisfied
--> $DIR/typeck-default-trait-impl-precedence.rs:19:20
|
LL | is_defaulted::<&'static u32>();
| ^^^^^^^^^^^^ the trait `Signed` is not implemented for `u32`, which is required by `&'static u32: Defaulted`
| ^^^^^^^^^^^^ the trait `Signed` is not implemented for `u32`
|
note: required for `&'static u32` to implement `Defaulted`
--> $DIR/typeck-default-trait-impl-precedence.rs:10:19

View File

@ -27,7 +27,7 @@ error[E0277]: can't compare `&{integer}` with `{integer}`
LL | _ = foo == &0;
| ^^ no implementation for `&{integer} == {integer}`
|
= help: the trait `PartialEq<{integer}>` is not implemented for `&{integer}`, which is required by `&&{integer}: PartialEq<&{integer}>`
= help: the trait `PartialEq<{integer}>` is not implemented for `&{integer}`
= note: required for `&&{integer}` to implement `PartialEq<&{integer}>`
help: consider dereferencing here
|
@ -65,7 +65,7 @@ error[E0277]: can't compare `&&{integer}` with `{integer}`
LL | _ = &&foo == &&0;
| ^^ no implementation for `&&{integer} == {integer}`
|
= help: the trait `PartialEq<{integer}>` is not implemented for `&&{integer}`, which is required by `&&&&{integer}: PartialEq<&&{integer}>`
= help: the trait `PartialEq<{integer}>` is not implemented for `&&{integer}`
= note: required for `&&&{integer}` to implement `PartialEq<&{integer}>`
= note: 1 redundant requirement hidden
= note: required for `&&&&{integer}` to implement `PartialEq<&&{integer}>`
@ -119,7 +119,7 @@ error[E0277]: can't compare `{integer}` with `&{integer}`
LL | _ = &0 == foo;
| ^^ no implementation for `{integer} == &{integer}`
|
= help: the trait `PartialEq<&{integer}>` is not implemented for `{integer}`, which is required by `&{integer}: PartialEq<&&{integer}>`
= help: the trait `PartialEq<&{integer}>` is not implemented for `{integer}`
= note: required for `&{integer}` to implement `PartialEq<&&{integer}>`
help: consider dereferencing here
|
@ -157,7 +157,7 @@ error[E0277]: can't compare `{integer}` with `&&{integer}`
LL | _ = &&0 == &&foo;
| ^^ no implementation for `{integer} == &&{integer}`
|
= help: the trait `PartialEq<&&{integer}>` is not implemented for `{integer}`, which is required by `&&{integer}: PartialEq<&&&&{integer}>`
= help: the trait `PartialEq<&&{integer}>` is not implemented for `{integer}`
= note: required for `&{integer}` to implement `PartialEq<&&&{integer}>`
= note: 1 redundant requirement hidden
= note: required for `&&{integer}` to implement `PartialEq<&&&&{integer}>`
@ -173,7 +173,7 @@ error[E0277]: can't compare `Box<Box<{integer}>>` with `&&{integer}`
LL | _ = &Box::new(Box::new(42)) == &foo;
| ^^ no implementation for `Box<Box<{integer}>> == &&{integer}`
|
= help: the trait `PartialEq<&&{integer}>` is not implemented for `Box<Box<{integer}>>`, which is required by `&Box<Box<{integer}>>: PartialEq<&&&{integer}>`
= help: the trait `PartialEq<&&{integer}>` is not implemented for `Box<Box<{integer}>>`
= note: required for `&Box<Box<{integer}>>` to implement `PartialEq<&&&{integer}>`
help: consider dereferencing both sides of the expression
|
@ -187,7 +187,7 @@ error[E0277]: can't compare `Box<{integer}>` with `&&{integer}`
LL | _ = &Box::new(42) == &foo;
| ^^ no implementation for `Box<{integer}> == &&{integer}`
|
= help: the trait `PartialEq<&&{integer}>` is not implemented for `Box<{integer}>`, which is required by `&Box<{integer}>: PartialEq<&&&{integer}>`
= help: the trait `PartialEq<&&{integer}>` is not implemented for `Box<{integer}>`
= note: required for `&Box<{integer}>` to implement `PartialEq<&&&{integer}>`
help: consider dereferencing both sides of the expression
|
@ -201,7 +201,7 @@ error[E0277]: can't compare `Box<Box<Box<Box<{integer}>>>>` with `&&{integer}`
LL | _ = &Box::new(Box::new(Box::new(Box::new(42)))) == &foo;
| ^^ no implementation for `Box<Box<Box<Box<{integer}>>>> == &&{integer}`
|
= help: the trait `PartialEq<&&{integer}>` is not implemented for `Box<Box<Box<Box<{integer}>>>>`, which is required by `&Box<Box<Box<Box<{integer}>>>>: PartialEq<&&&{integer}>`
= help: the trait `PartialEq<&&{integer}>` is not implemented for `Box<Box<Box<Box<{integer}>>>>`
= note: required for `&Box<Box<Box<Box<{integer}>>>>` to implement `PartialEq<&&&{integer}>`
help: consider dereferencing both sides of the expression
|
@ -215,7 +215,7 @@ error[E0277]: can't compare `&&{integer}` with `Box<Box<Box<Box<{integer}>>>>`
LL | _ = &foo == &Box::new(Box::new(Box::new(Box::new(42))));
| ^^ no implementation for `&&{integer} == Box<Box<Box<Box<{integer}>>>>`
|
= help: the trait `PartialEq<Box<Box<Box<Box<{integer}>>>>>` is not implemented for `&&{integer}`, which is required by `&&&{integer}: PartialEq<&Box<Box<Box<Box<{integer}>>>>>`
= help: the trait `PartialEq<Box<Box<Box<Box<{integer}>>>>>` is not implemented for `&&{integer}`
= note: required for `&&&{integer}` to implement `PartialEq<&Box<Box<Box<Box<{integer}>>>>>`
help: consider dereferencing both sides of the expression
|

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `{integer}: Scalar` is not satisfied
--> $DIR/issue-22645.rs:15:5
|
LL | b + 3
| ^ the trait `Scalar` is not implemented for `{integer}`, which is required by `Bob: Add<_>`
| ^ the trait `Scalar` is not implemented for `{integer}`
|
= help: the trait `Scalar` is implemented for `f64`
note: required for `Bob` to implement `Add<{integer}>`

View File

@ -4,7 +4,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation
LL | val: std::mem::ManuallyDrop<[u8]>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `ManuallyDrop<[u8]>`, the trait `Sized` is not implemented for `[u8]`, which is required by `ManuallyDrop<[u8]>: Sized`
= help: within `ManuallyDrop<[u8]>`, the trait `Sized` is not implemented for `[u8]`
note: required because it appears within the type `ManuallyDrop<[u8]>`
--> $SRC_DIR/core/src/mem/manually_drop.rs:LL:COL
= note: no field of a union may have a dynamically sized type

View File

@ -10,7 +10,7 @@ LL | |
LL | | });
| |_____^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `std::sync::mpsc::Receiver<()>`, which is required by `{closure@$DIR/closure-move-sync.rs:6:27: 6:29}: Send`
= help: the trait `Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
= note: required for `&std::sync::mpsc::Receiver<()>` to implement `Send`
note: required because it's used within this closure
--> $DIR/closure-move-sync.rs:6:27

View File

@ -4,7 +4,7 @@ error[E0277]: the size for values of type `dyn A` cannot be known at compilation
LL | a::foo::<fn() -> dyn A>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`, which is required by `fn() -> dyn A: FnOnce()`
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
= note: required because it appears within the type `fn() -> dyn A`
error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
@ -13,7 +13,7 @@ error[E0277]: the size for values of type `dyn A` cannot be known at compilation
LL | a::bar::<fn() -> dyn A, _>();
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`, which is required by `fn() -> dyn A: FnOnce()`
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
= note: required because it appears within the type `fn() -> dyn A`
note: required by a bound in `a::bar`
--> $DIR/closure-return-type-must-be-sized.rs:14:19
@ -27,7 +27,7 @@ error[E0277]: the size for values of type `dyn A` cannot be known at compilation
LL | a::baz::<fn() -> dyn A>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`, which is required by `fn() -> dyn A: FnOnce()`
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
= note: required because it appears within the type `fn() -> dyn A`
error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
@ -36,7 +36,7 @@ error[E0277]: the size for values of type `dyn A` cannot be known at compilation
LL | b::foo::<fn() -> dyn A>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`, which is required by `fn() -> dyn A: FnOnce()`
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
= note: required because it appears within the type `fn() -> dyn A`
error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
@ -45,7 +45,7 @@ error[E0277]: the size for values of type `dyn A` cannot be known at compilation
LL | b::bar::<fn() -> dyn A, _>();
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`, which is required by `fn() -> dyn A: Fn()`
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
= note: required because it appears within the type `fn() -> dyn A`
note: required by a bound in `b::bar`
--> $DIR/closure-return-type-must-be-sized.rs:28:19
@ -59,7 +59,7 @@ error[E0277]: the size for values of type `dyn A` cannot be known at compilation
LL | b::baz::<fn() -> dyn A>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`, which is required by `fn() -> dyn A: FnOnce()`
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
= note: required because it appears within the type `fn() -> dyn A`
error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
@ -68,7 +68,7 @@ error[E0277]: the size for values of type `dyn A` cannot be known at compilation
LL | c::foo::<fn() -> dyn A>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`, which is required by `fn() -> dyn A: FnOnce()`
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
= note: required because it appears within the type `fn() -> dyn A`
error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
@ -77,7 +77,7 @@ error[E0277]: the size for values of type `dyn A` cannot be known at compilation
LL | c::bar::<fn() -> dyn A, _>();
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`, which is required by `fn() -> dyn A: FnMut()`
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
= note: required because it appears within the type `fn() -> dyn A`
note: required by a bound in `c::bar`
--> $DIR/closure-return-type-must-be-sized.rs:42:19
@ -91,7 +91,7 @@ error[E0277]: the size for values of type `dyn A` cannot be known at compilation
LL | c::baz::<fn() -> dyn A>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`, which is required by `fn() -> dyn A: FnOnce()`
= help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
= note: required because it appears within the type `fn() -> dyn A`
error: aborting due to 9 previous errors

View File

@ -19,7 +19,7 @@ error[E0277]: the size for values of type `OpaqueListContents` cannot be known a
LL | pub struct List<'tcx, T>(Interned<'tcx, ListS<T>>);
| ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `ListS<T>`, the trait `Sized` is not implemented for `OpaqueListContents`, which is required by `ListS<T>: Sized`
= help: within `ListS<T>`, the trait `Sized` is not implemented for `OpaqueListContents`
note: required because it appears within the type `ListS<T>`
--> $DIR/deep-bad-copy-reason.rs:7:12
|

View File

@ -2,7 +2,7 @@ error[E0277]: `NotParam` can't be used as a const parameter type
--> $DIR/const_param_ty_bad_empty_array.rs:10:13
|
LL | check::<[NotParam; 0]>();
| ^^^^^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `NotParam`, which is required by `[NotParam; 0]: ConstParamTy_`
| ^^^^^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `NotParam`
|
= note: required for `[NotParam; 0]` to implement `ConstParamTy_`
note: required by a bound in `check`

View File

@ -2,7 +2,7 @@ error[E0277]: `NotParam` can't be used as a const parameter type
--> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:10:13
|
LL | check::<&NotParam>();
| ^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `NotParam`, which is required by `&NotParam: UnsizedConstParamTy`
| ^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `NotParam`
|
= note: required for `&NotParam` to implement `UnsizedConstParamTy`
note: required by a bound in `check`
@ -15,7 +15,7 @@ error[E0277]: `NotParam` can't be used as a const parameter type
--> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:11:13
|
LL | check::<[NotParam]>();
| ^^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `NotParam`, which is required by `[NotParam]: UnsizedConstParamTy`
| ^^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `NotParam`
|
= note: required for `[NotParam]` to implement `UnsizedConstParamTy`
note: required by a bound in `check`
@ -28,7 +28,7 @@ error[E0277]: `NotParam` can't be used as a const parameter type
--> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:12:13
|
LL | check::<[NotParam; 17]>();
| ^^^^^^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `NotParam`, which is required by `[NotParam; 17]: UnsizedConstParamTy`
| ^^^^^^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `NotParam`
|
= note: required for `[NotParam; 17]` to implement `UnsizedConstParamTy`
note: required by a bound in `check`

View File

@ -64,7 +64,7 @@ LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
LL | nested: &'static Bar<dyn std::fmt::Debug>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`, which is required by `&&'static Bar<(dyn Debug + 'static)>: Debug`
= help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
= help: the trait `Debug` is implemented for `Bar<T>`
note: required for `Bar<(dyn Debug + 'static)>` to implement `Debug`
--> $DIR/unsizing-wfcheck-issue-126272.rs:20:10
@ -96,7 +96,7 @@ LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)]
| -- in this derive macro expansion
...
LL | nested: &'static Bar<dyn std::fmt::Debug>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `dyn Debug`, which is required by `&'static Bar<dyn Debug>: Eq`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `dyn Debug`
|
= help: the trait `Eq` is implemented for `Bar<T>`
note: required for `Bar<dyn Debug>` to implement `Eq`

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `(): _Contains<&C>` is not satisfied
--> $DIR/issue-85848.rs:24:29
|
LL | writes_to_specific_path(&cap);
| ----------------------- ^^^^ the trait `_Contains<&C>` is not implemented for `()`, which is required by `&C: Delegates<()>`
| ----------------------- ^^^^ the trait `_Contains<&C>` is not implemented for `()`
| |
| required by a bound introduced by this call
|

View File

@ -32,7 +32,7 @@ error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
--> $DIR/issue-67185-2.rs:21:6
|
LL | impl Foo for FooImpl {}
| ^^^ the trait `Bar` is not implemented for `[u16; 3]`, which is required by `<u8 as Baz>::Quaks: Bar`
| ^^^ the trait `Bar` is not implemented for `[u16; 3]`
|
= help: the following other types implement trait `Bar`:
[[u16; 3]; 3]
@ -50,7 +50,7 @@ error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
--> $DIR/issue-67185-2.rs:21:6
|
LL | impl Foo for FooImpl {}
| ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`, which is required by `[<u8 as Baz>::Quaks; 2]: Bar`
| ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
|
= help: the following other types implement trait `Bar`:
[[u16; 3]; 3]

View File

@ -18,7 +18,7 @@ error[E0277]: the trait bound `KeyHolder<0>: SubsetExcept<_>` is not satisfied
--> $DIR/kind_mismatch.rs:22:45
|
LL | let map: KeyHolder<0> = remove_key::<_, _>();
| ^ the trait `ContainsKey<0>` is not implemented for `KeyHolder<0>`, which is required by `KeyHolder<0>: SubsetExcept<_>`
| ^ the trait `ContainsKey<0>` is not implemented for `KeyHolder<0>`
|
note: required for `KeyHolder<0>` to implement `SubsetExcept<_>`
--> $DIR/kind_mismatch.rs:15:28

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `Bar: Copy` is not satisfied
--> $DIR/fn-call-in-non-const.rs:14:32
|
LL | let _: [Option<Bar>; 2] = [no_copy(); 2];
| ^^^^^^^^^ the trait `Copy` is not implemented for `Bar`, which is required by `Option<Bar>: Copy`
| ^^^^^^^^^ the trait `Copy` is not implemented for `Bar`
|
= note: required for `Option<Bar>` to implement `Copy`
= note: the `Copy` trait is required because this value will be copied for each element of the array

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `Bar: Copy` is not satisfied
--> $DIR/migrate-fail.rs:11:38
|
LL | let arr: [Option<Bar>; 2] = [x; 2];
| ^ the trait `Copy` is not implemented for `Bar`, which is required by `Option<Bar>: Copy`
| ^ the trait `Copy` is not implemented for `Bar`
|
= note: required for `Option<Bar>` to implement `Copy`
= note: the `Copy` trait is required because this value will be copied for each element of the array
@ -18,7 +18,7 @@ error[E0277]: the trait bound `Bar: Copy` is not satisfied
--> $DIR/migrate-fail.rs:17:38
|
LL | let arr: [Option<Bar>; 2] = [x; 2];
| ^ the trait `Copy` is not implemented for `Bar`, which is required by `Option<Bar>: Copy`
| ^ the trait `Copy` is not implemented for `Bar`
|
= note: required for `Option<Bar>` to implement `Copy`
= note: the `Copy` trait is required because this value will be copied for each element of the array

View File

@ -2,7 +2,7 @@ error[E0277]: the trait bound `Bar: Copy` is not satisfied
--> $DIR/nll-fail.rs:11:38
|
LL | let arr: [Option<Bar>; 2] = [x; 2];
| ^ the trait `Copy` is not implemented for `Bar`, which is required by `Option<Bar>: Copy`
| ^ the trait `Copy` is not implemented for `Bar`
|
= note: required for `Option<Bar>` to implement `Copy`
= note: the `Copy` trait is required because this value will be copied for each element of the array
@ -18,7 +18,7 @@ error[E0277]: the trait bound `Bar: Copy` is not satisfied
--> $DIR/nll-fail.rs:17:38
|
LL | let arr: [Option<Bar>; 2] = [x; 2];
| ^ the trait `Copy` is not implemented for `Bar`, which is required by `Option<Bar>: Copy`
| ^ the trait `Copy` is not implemented for `Bar`
|
= note: required for `Option<Bar>` to implement `Copy`
= note: the `Copy` trait is required because this value will be copied for each element of the array

View File

@ -4,7 +4,7 @@ error[E0277]: the trait bound `String: Copy` is not satisfied
LL | [Foo(String::new()); 4];
| ^^^^^^^^^^^^^^^^^^
| |
| the trait `Copy` is not implemented for `String`, which is required by `Foo<String>: Copy`
| the trait `Copy` is not implemented for `String`
| help: create an inline `const` block: `const { Foo(String::new()) }`
|
note: required for `Foo<String>` to implement `Copy`

View File

@ -4,7 +4,7 @@ error[E0277]: the trait bound `String: Copy` is not satisfied
LL | static _MAYBE_STRINGS: [Option<String>; 5] = [None; 5];
| ^^^^
| |
| the trait `Copy` is not implemented for `String`, which is required by `Option<String>: Copy`
| the trait `Copy` is not implemented for `String`
| help: create an inline `const` block: `const { None }`
|
= note: required for `Option<String>` to implement `Copy`
@ -27,7 +27,7 @@ error[E0277]: the trait bound `String: Copy` is not satisfied
LL | let _maybe_strings: [Option<String>; 5] = [None; 5];
| ^^^^
| |
| the trait `Copy` is not implemented for `String`, which is required by `Option<String>: Copy`
| the trait `Copy` is not implemented for `String`
| help: create an inline `const` block: `const { None }`
|
= note: required for `Option<String>` to implement `Copy`

View File

@ -5,7 +5,7 @@ LL | move || {
| ------- within this `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}`
...
LL | check_copy(&gen_clone_0);
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}`, the trait `Copy` is not implemented for `Vec<u32>`, which is required by `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}: Copy`
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}`, the trait `Copy` is not implemented for `Vec<u32>`
|
note: captured value does not implement `Copy`
--> $DIR/clone-impl.rs:47:14
@ -25,7 +25,7 @@ LL | move || {
| ------- within this `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}`
...
LL | check_copy(&gen_clone_0);
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}`, the trait `Copy` is not implemented for `Vec<char>`, which is required by `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}: Copy`
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:43:5: 43:12}`, the trait `Copy` is not implemented for `Vec<char>`
|
note: coroutine does not implement `Copy` as this value is used across a yield
--> $DIR/clone-impl.rs:45:9
@ -47,7 +47,7 @@ LL | move || {
| ------- within this `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}`
...
LL | check_copy(&gen_clone_1);
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}`, the trait `Copy` is not implemented for `Vec<u32>`, which is required by `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}: Copy`
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}`, the trait `Copy` is not implemented for `Vec<u32>`
|
note: captured value does not implement `Copy`
--> $DIR/clone-impl.rs:68:14
@ -67,7 +67,7 @@ LL | move || {
| ------- within this `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}`
...
LL | check_copy(&gen_clone_1);
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}`, the trait `Copy` is not implemented for `Vec<char>`, which is required by `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}: Copy`
| ^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:58:5: 58:12}`, the trait `Copy` is not implemented for `Vec<char>`
|
note: coroutine does not implement `Copy` as this value is used across a yield
--> $DIR/clone-impl.rs:64:9
@ -90,7 +90,7 @@ LL | move || {
| ------- within this `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}`
...
LL | check_copy(&gen_non_clone);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}`, the trait `Copy` is not implemented for `NonClone`, which is required by `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}: Copy`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}`, the trait `Copy` is not implemented for `NonClone`
|
note: captured value does not implement `Copy`
--> $DIR/clone-impl.rs:81:14
@ -115,7 +115,7 @@ LL | move || {
| ------- within this `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}`
...
LL | check_clone(&gen_non_clone);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}`, the trait `Clone` is not implemented for `NonClone`, which is required by `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}: Clone`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `{coroutine@$DIR/clone-impl.rs:79:5: 79:12}`, the trait `Clone` is not implemented for `NonClone`
|
note: captured value does not implement `Clone`
--> $DIR/clone-impl.rs:81:14

View File

@ -13,7 +13,7 @@ LL | | };
LL | | );
| |_____- in this macro invocation
|
= help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `derived_drop::Client`, which is required by `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:34: 17:41}: Send`
= help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `derived_drop::Client`
note: coroutine is not `Send` as this value is used across a yield
--> $DIR/drop-tracking-parent-expression.rs:21:22
|
@ -53,7 +53,7 @@ LL | | };
LL | | );
| |_____- in this macro invocation
|
= help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `significant_drop::Client`, which is required by `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:34: 17:41}: Send`
= help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `significant_drop::Client`
note: coroutine is not `Send` as this value is used across a yield
--> $DIR/drop-tracking-parent-expression.rs:21:22
|
@ -93,7 +93,7 @@ LL | | };
LL | | );
| |_____- in this macro invocation
|
= help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `insignificant_dtor::Client`, which is required by `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:34: 17:41}: Send`
= help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `insignificant_dtor::Client`
note: coroutine is not `Send` as this value is used across a yield
--> $DIR/drop-tracking-parent-expression.rs:21:22
|

View File

@ -9,7 +9,7 @@ LL | | yield;
LL | | })
| |______^ coroutine is not `Send`
|
= help: within `{coroutine@$DIR/drop-yield-twice.rs:7:30: 7:32}`, the trait `Send` is not implemented for `Foo`, which is required by `{coroutine@$DIR/drop-yield-twice.rs:7:30: 7:32}: Send`
= help: within `{coroutine@$DIR/drop-yield-twice.rs:7:30: 7:32}`, the trait `Send` is not implemented for `Foo`
note: coroutine is not `Send` as this value is used across a yield
--> $DIR/drop-yield-twice.rs:9:9
|

View File

@ -29,7 +29,7 @@ LL | || {
| -- within this `{coroutine@$DIR/issue-105084.rs:15:5: 15:7}`
...
LL | let mut h = copy(g);
| ^^^^^^^ within `{coroutine@$DIR/issue-105084.rs:15:5: 15:7}`, the trait `Copy` is not implemented for `Box<(i32, ())>`, which is required by `{coroutine@$DIR/issue-105084.rs:15:5: 15:7}: Copy`
| ^^^^^^^ within `{coroutine@$DIR/issue-105084.rs:15:5: 15:7}`, the trait `Copy` is not implemented for `Box<(i32, ())>`
|
note: coroutine does not implement `Copy` as this value is used across a yield
--> $DIR/issue-105084.rs:22:22

View File

@ -4,7 +4,7 @@ error: coroutine cannot be sent between threads safely
LL | require_send(send_gen);
| ^^^^^^^^^^^^^^^^^^^^^^ coroutine is not `Send`
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{coroutine@$DIR/issue-68112.rs:33:33: 33:35}: Send`
= help: the trait `Sync` is not implemented for `RefCell<i32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
note: coroutine is not `Send` as this value is used across a yield
--> $DIR/issue-68112.rs:36:9
@ -26,7 +26,7 @@ error[E0277]: `RefCell<i32>` cannot be shared between threads safely
LL | require_send(send_gen);
| ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{coroutine@$DIR/issue-68112.rs:60:33: 60:35}: Send`
= help: the trait `Sync` is not implemented for `RefCell<i32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Arc<RefCell<i32>>` to implement `Send`
note: required because it's used within this coroutine

View File

@ -9,7 +9,7 @@ LL | | drop(a);
LL | | });
| |______^ coroutine is not `Sync`
|
= help: within `{coroutine@$DIR/not-send-sync.rs:14:30: 14:32}`, the trait `Sync` is not implemented for `NotSync`, which is required by `{coroutine@$DIR/not-send-sync.rs:14:30: 14:32}: Sync`
= help: within `{coroutine@$DIR/not-send-sync.rs:14:30: 14:32}`, the trait `Sync` is not implemented for `NotSync`
note: coroutine is not `Sync` as this value is used across a yield
--> $DIR/not-send-sync.rs:17:9
|
@ -34,7 +34,7 @@ LL | | drop(a);
LL | | });
| |______^ coroutine is not `Send`
|
= help: within `{coroutine@$DIR/not-send-sync.rs:21:30: 21:32}`, the trait `Send` is not implemented for `NotSend`, which is required by `{coroutine@$DIR/not-send-sync.rs:21:30: 21:32}: Send`
= help: within `{coroutine@$DIR/not-send-sync.rs:21:30: 21:32}`, the trait `Send` is not implemented for `NotSend`
note: coroutine is not `Send` as this value is used across a yield
--> $DIR/not-send-sync.rs:24:9
|

View File

@ -13,7 +13,7 @@ LL | | };
LL | | );
| |_____- in this macro invocation
|
= help: within `{coroutine@$DIR/parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `derived_drop::Client`, which is required by `{coroutine@$DIR/parent-expression.rs:17:34: 17:41}: Send`
= help: within `{coroutine@$DIR/parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `derived_drop::Client`
note: coroutine is not `Send` as this value is used across a yield
--> $DIR/parent-expression.rs:21:22
|
@ -53,7 +53,7 @@ LL | | };
LL | | );
| |_____- in this macro invocation
|
= help: within `{coroutine@$DIR/parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `significant_drop::Client`, which is required by `{coroutine@$DIR/parent-expression.rs:17:34: 17:41}: Send`
= help: within `{coroutine@$DIR/parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `significant_drop::Client`
note: coroutine is not `Send` as this value is used across a yield
--> $DIR/parent-expression.rs:21:22
|
@ -93,7 +93,7 @@ LL | | };
LL | | );
| |_____- in this macro invocation
|
= help: within `{coroutine@$DIR/parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `insignificant_dtor::Client`, which is required by `{coroutine@$DIR/parent-expression.rs:17:34: 17:41}: Send`
= help: within `{coroutine@$DIR/parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `insignificant_dtor::Client`
note: coroutine is not `Send` as this value is used across a yield
--> $DIR/parent-expression.rs:21:22
|

View File

@ -4,7 +4,7 @@ error: coroutine cannot be sent between threads safely
LL | require_send(send_gen);
| ^^^^^^^^^^^^^^^^^^^^^^ coroutine is not `Send`
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{test1::{closure#0} upvar_tys=() witness={test1::{closure#0}}}: Send`
= help: the trait `Sync` is not implemented for `RefCell<i32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
note: coroutine is not `Send` as this value is used across a yield
--> $DIR/coroutine-print-verbose-1.rs:35:9
@ -25,7 +25,7 @@ error[E0277]: `RefCell<i32>` cannot be shared between threads safely
LL | require_send(send_gen);
| ^^^^^^^^^^^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`, which is required by `{test2::{closure#0} upvar_tys=() witness={test2::{closure#0}}}: Send`
= help: the trait `Sync` is not implemented for `RefCell<i32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Arc<RefCell<i32>>` to implement `Send`
note: required because it's used within this coroutine

View File

@ -9,7 +9,7 @@ LL | | drop(a);
LL | | });
| |______^ coroutine is not `Sync`
|
= help: within `{main::{closure#0} upvar_tys=() witness={main::{closure#0}}}`, the trait `Sync` is not implemented for `NotSync`, which is required by `{main::{closure#0} upvar_tys=() witness={main::{closure#0}}}: Sync`
= help: within `{main::{closure#0} upvar_tys=() witness={main::{closure#0}}}`, the trait `Sync` is not implemented for `NotSync`
note: coroutine is not `Sync` as this value is used across a yield
--> $DIR/coroutine-print-verbose-2.rs:20:9
|
@ -34,7 +34,7 @@ LL | | drop(a);
LL | | });
| |______^ coroutine is not `Send`
|
= help: within `{main::{closure#1} upvar_tys=() witness={main::{closure#1}}}`, the trait `Send` is not implemented for `NotSend`, which is required by `{main::{closure#1} upvar_tys=() witness={main::{closure#1}}}: Send`
= help: within `{main::{closure#1} upvar_tys=() witness={main::{closure#1}}}`, the trait `Send` is not implemented for `NotSend`
note: coroutine is not `Send` as this value is used across a yield
--> $DIR/coroutine-print-verbose-2.rs:27:9
|

View File

@ -10,7 +10,7 @@ LL | | let _x = x;
LL | | });
| |_____^ coroutine is not `Send`
|
= help: the trait `Sync` is not implemented for `*mut ()`, which is required by `{coroutine@$DIR/ref-upvar-not-send.rs:15:30: 15:37}: Send`
= help: the trait `Sync` is not implemented for `*mut ()`
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
--> $DIR/ref-upvar-not-send.rs:19:18
|
@ -34,7 +34,7 @@ LL | | let _y = y;
LL | | });
| |_____^ coroutine is not `Send`
|
= help: within `{coroutine@$DIR/ref-upvar-not-send.rs:23:30: 23:37}`, the trait `Send` is not implemented for `*mut ()`, which is required by `{coroutine@$DIR/ref-upvar-not-send.rs:23:30: 23:37}: Send`
= help: within `{coroutine@$DIR/ref-upvar-not-send.rs:23:30: 23:37}`, the trait `Send` is not implemented for `*mut ()`
note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send`
--> $DIR/ref-upvar-not-send.rs:27:18
|

View File

@ -0,0 +1,34 @@
// Regression test for 132104
#![feature(coroutine_trait, coroutines)]
use std::ops::Coroutine;
use std::{thread, time};
fn demo<'not_static>(s: &'not_static str) -> thread::JoinHandle<()> {
let mut generator = Box::pin({
#[coroutine]
move |_ctx| {
let ctx: &'not_static str = yield;
yield;
dbg!(ctx);
}
});
// exploit:
generator.as_mut().resume("");
generator.as_mut().resume(s); // <- generator hoards it as `let ctx`.
//~^ ERROR borrowed data escapes outside of function
thread::spawn(move || {
thread::sleep(time::Duration::from_millis(200));
generator.as_mut().resume(""); // <- resumes from the last `yield`, running `dbg!(ctx)`.
})
}
fn main() {
let local = String::from("...");
let thread = demo(&local);
drop(local);
let _unrelated = String::from("UAF");
thread.join().unwrap();
}

View File

@ -0,0 +1,17 @@
error[E0521]: borrowed data escapes outside of function
--> $DIR/resume-arg-outlives-2.rs:20:5
|
LL | fn demo<'not_static>(s: &'not_static str) -> thread::JoinHandle<()> {
| ----------- - `s` is a reference that is only valid in the function body
| |
| lifetime `'not_static` defined here
...
LL | generator.as_mut().resume(s); // <- generator hoards it as `let ctx`.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| `s` escapes the function body here
| argument requires that `'not_static` must outlive `'static`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0521`.

View File

@ -0,0 +1,27 @@
// Regression test for 132104
#![feature(coroutine_trait, coroutines)]
use std::ops::Coroutine;
use std::pin::Pin;
fn demo<'not_static>(s: &'not_static str) -> Pin<Box<impl Coroutine<&'not_static str> + 'static>> {
let mut generator = Box::pin({
#[coroutine]
move |ctx: &'not_static str| {
yield;
dbg!(ctx);
}
});
generator.as_mut().resume(s);
generator
//~^ ERROR lifetime may not live long enough
}
fn main() {
let local = String::from("...");
let mut coro = demo(&local);
drop(local);
let _unrelated = String::from("UAF");
coro.as_mut().resume("");
}

View File

@ -0,0 +1,20 @@
error: lifetime may not live long enough
--> $DIR/resume-arg-outlives.rs:17:5
|
LL | fn demo<'not_static>(s: &'not_static str) -> Pin<Box<impl Coroutine<&'not_static str> + 'static>> {
| ----------- lifetime `'not_static` defined here
...
LL | generator
| ^^^^^^^^^ returning this value requires that `'not_static` must outlive `'static`
|
help: consider changing `impl Coroutine<&'not_static str> + 'static`'s explicit `'static` bound to the lifetime of argument `s`
|
LL | fn demo<'not_static>(s: &'not_static str) -> Pin<Box<impl Coroutine<&'not_static str> + 'not_static>> {
| ~~~~~~~~~~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn demo<'not_static>(s: &'static str) -> Pin<Box<impl Coroutine<&'not_static str> + 'static>> {
| ~~~~~~~~~~~~
error: aborting due to 1 previous error

View File

@ -8,7 +8,7 @@ LL | let s = std::array::from_fn(|_| ()).await;
| | help: remove the `.await`
| this call returns `[(); _]`
|
= help: the trait `Future` is not implemented for `[(); _]`, which is required by `[(); _]: IntoFuture`
= help: the trait `Future` is not implemented for `[(); _]`
= note: [(); _] must be a future or must implement `IntoFuture` to be awaited
= note: required for `[(); _]` to implement `IntoFuture`

View File

@ -21,7 +21,7 @@ error[E0277]: `{integer}` is not an iterator
LL | yield || for i in 0 { }
| ^ `{integer}` is not an iterator
|
= help: the trait `Iterator` is not implemented for `{integer}`, which is required by `{integer}: IntoIterator`
= help: the trait `Iterator` is not implemented for `{integer}`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
= note: required for `{integer}` to implement `IntoIterator`

View File

@ -7,7 +7,7 @@ LL | #[derive(Debug)]
LL | x: Error
| ^^^^^^^^ `Error` cannot be formatted using `{:?}`
|
= help: the trait `Debug` is not implemented for `Error`, which is required by `&Error: Debug`
= help: the trait `Debug` is not implemented for `Error`
= note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Debug)]`

View File

@ -7,7 +7,7 @@ LL | #[derive(Debug)]
LL | Error
| ^^^^^ `Error` cannot be formatted using `{:?}`
|
= help: the trait `Debug` is not implemented for `Error`, which is required by `&Error: Debug`
= help: the trait `Debug` is not implemented for `Error`
= note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Debug)]`

View File

@ -7,7 +7,7 @@ LL | struct Struct {
LL | x: Error
| ^^^^^^^^ `Error` cannot be formatted using `{:?}`
|
= help: the trait `Debug` is not implemented for `Error`, which is required by `&Error: Debug`
= help: the trait `Debug` is not implemented for `Error`
= note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Debug)]`

View File

@ -7,7 +7,7 @@ LL | struct Struct(
LL | Error
| ^^^^^ `Error` cannot be formatted using `{:?}`
|
= help: the trait `Debug` is not implemented for `Error`, which is required by `&Error: Debug`
= help: the trait `Debug` is not implemented for `Error`
= note: add `#[derive(Debug)]` to `Error` or manually `impl Debug for Error`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Debug)]`

Some files were not shown because too many files have changed in this diff Show More