about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-09-18 16:55:05 +0000
committerbors <bors@rust-lang.org>2025-09-18 16:55:05 +0000
commit0c0c58b8e453f552ebd7f3a1545acdd109de028c (patch)
tree80fc20e71f5764072222045136debf7ce9297697 /compiler/rustc_trait_selection
parent4cd91ef8223ef54111d21aa9e9e71b3b26477dd3 (diff)
parent24d6259dce2040994897fc6ef765b06cf0270630 (diff)
downloadrust-0c0c58b8e453f552ebd7f3a1545acdd109de028c.tar.gz
rust-0c0c58b8e453f552ebd7f3a1545acdd109de028c.zip
Auto merge of #146727 - matthiaskrgr:rollup-98812uj, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#146434 (c-variadic: allow c-variadic inherent and trait methods)
 - rust-lang/rust#146487 (Improve `core::num` coverage)
 - rust-lang/rust#146597 (Add span for struct tail recursion limit error)
 - rust-lang/rust#146622 (Add regression test for issue rust-lang/rust#91831)
 - rust-lang/rust#146717 (Clean up universe evaluation during type test evaluation)
 - rust-lang/rust#146723 (Include patch in release notes)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_trait_selection')
-rw-r--r--compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs3
-rw-r--r--compiler/rustc_trait_selection/src/traits/project.rs1
2 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs b/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs
index bcd11d6918d..3260dd712b9 100644
--- a/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs
+++ b/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs
@@ -426,6 +426,9 @@ fn virtual_call_violations_for_method<'tcx>(
     if let Some(code) = contains_illegal_impl_trait_in_trait(tcx, method.def_id, sig.output()) {
         errors.push(code);
     }
+    if sig.skip_binder().c_variadic {
+        errors.push(MethodViolationCode::CVariadic);
+    }
 
     // We can't monomorphize things like `fn foo<A>(...)`.
     let own_counts = tcx.generics_of(method.def_id).own_counts();
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs
index 884d53732fe..042d6def84c 100644
--- a/compiler/rustc_trait_selection/src/traits/project.rs
+++ b/compiler/rustc_trait_selection/src/traits/project.rs
@@ -1057,6 +1057,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
                     Some(LangItem::PointeeTrait) => {
                         let tail = selcx.tcx().struct_tail_raw(
                             self_ty,
+                            &obligation.cause,
                             |ty| {
                                 // We throw away any obligations we get from this, since we normalize
                                 // and confirm these obligations once again during confirmation