mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-17 22:46:50 +00:00
Rollup merge of #95069 - GuillaumeGomez:auto-traits-rustdoc, r=oli-obk
Fix auto traits in rustdoc Fixes #90324. cc `@matthewjasper` r? `@Aaron1011`
This commit is contained in:
commit
0c79c862f0
@ -1270,7 +1270,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
// the master cache. Since coherence executes pretty quickly,
|
||||
// it's not worth going to more trouble to increase the
|
||||
// hit-rate, I don't think.
|
||||
if self.intercrate {
|
||||
if self.intercrate || self.allow_negative_impls {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1287,7 +1287,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
// mode, so don't do any caching. In particular, we might
|
||||
// re-use the same `InferCtxt` with both an intercrate
|
||||
// and non-intercrate `SelectionContext`
|
||||
if self.intercrate {
|
||||
if self.intercrate || self.allow_negative_impls {
|
||||
return None;
|
||||
}
|
||||
let tcx = self.tcx();
|
||||
|
8
src/test/rustdoc/auto-trait-not-send.rs
Normal file
8
src/test/rustdoc/auto-trait-not-send.rs
Normal file
@ -0,0 +1,8 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
// @has 'foo/struct.Foo.html'
|
||||
// @has - '//*[@id="impl-Send"]' 'impl !Send for Foo'
|
||||
// @has - '//*[@id="impl-Sync"]' 'impl !Sync for Foo'
|
||||
pub struct Foo(*const i8);
|
||||
pub trait Whatever: Send {}
|
||||
impl<T: Send + ?Sized> Whatever for T {}
|
Loading…
Reference in New Issue
Block a user