Skip to content

Commit 0c79c86

Browse files
authored
Rollup merge of rust-lang#95069 - GuillaumeGomez:auto-traits-rustdoc, r=oli-obk
Fix auto traits in rustdoc Fixes rust-lang#90324. cc `@matthewjasper` r? `@Aaron1011`
2 parents af19a50 + 7c53ae0 commit 0c79c86

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

compiler/rustc_trait_selection/src/traits/select/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12701270
// the master cache. Since coherence executes pretty quickly,
12711271
// it's not worth going to more trouble to increase the
12721272
// hit-rate, I don't think.
1273-
if self.intercrate {
1273+
if self.intercrate || self.allow_negative_impls {
12741274
return false;
12751275
}
12761276

@@ -1287,7 +1287,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12871287
// mode, so don't do any caching. In particular, we might
12881288
// re-use the same `InferCtxt` with both an intercrate
12891289
// and non-intercrate `SelectionContext`
1290-
if self.intercrate {
1290+
if self.intercrate || self.allow_negative_impls {
12911291
return None;
12921292
}
12931293
let tcx = self.tcx();
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![crate_name = "foo"]
2+
3+
// @has 'foo/struct.Foo.html'
4+
// @has - '//*[@id="impl-Send"]' 'impl !Send for Foo'
5+
// @has - '//*[@id="impl-Sync"]' 'impl !Sync for Foo'
6+
pub struct Foo(*const i8);
7+
pub trait Whatever: Send {}
8+
impl<T: Send + ?Sized> Whatever for T {}

0 commit comments

Comments
 (0)