-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #55318 - Aaron1011:fix/final-auto-trait-resolve, r=<try>
Ensure that Rustdoc discovers all necessary auto trait bounds Fixes #50159 This commit makes several improvements to AutoTraitFinder: * Call infcx.resolve_type_vars_if_possible before processing new predicates. This ensures that we eliminate inference variables wherever possible. * Process all nested obligations we get from a vtable, not just ones with depth=1. * The 'depth=1' check was a hack to work around issues processing certain predicates. The other changes in this commit allow us to properly process all predicates that we encounter, so the check is no longer necessary, * Ensure that we only display predicates *without* inference variables to the user, and only attempt to unify predicates that *have* an inference variable as their type. Additionally, the internal helper method is_of_param now operates directly on a type, rather than taking a Substs. This allows us to use the 'self_ty' method, rather than directly dealing with Substs.
- Loading branch information
Showing
2 changed files
with
86 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
|
||
pub trait Signal { | ||
type Item; | ||
} | ||
|
||
pub trait Signal2 { | ||
type Item2; | ||
} | ||
|
||
impl<B, C> Signal2 for B where B: Signal<Item = C> { | ||
type Item2 = C; | ||
} | ||
|
||
// @has issue_50159/struct.Switch.html | ||
// @has - '//code' 'impl<B> Send for Switch<B> where <B as Signal>::Item: Send' | ||
// @has - '//code' 'impl<B> Sync for Switch<B> where <B as Signal>::Item: Sync' | ||
// @count - '//*[@id="implementations-list"]/*[@class="impl"]' 0 | ||
// @count - '//*[@id="synthetic-implementations-list"]/*[@class="impl"]' 2 | ||
pub struct Switch<B: Signal> { | ||
pub inner: <B as Signal2>::Item2, | ||
} |