mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
rustdoc: synthetic auto: filter out clauses from the implementor's ParamEnv
not just the ones from the elaborated clauses.
This commit is contained in:
parent
0e5f520788
commit
114e88c9d0
@ -168,7 +168,7 @@ fn clean_param_env<'tcx>(
|
||||
|
||||
// FIXME(#111101): Incorporate the explicit predicates of the item here...
|
||||
let item_predicates: FxIndexSet<_> =
|
||||
tcx.predicates_of(item_def_id).predicates.iter().map(|(pred, _)| pred).collect();
|
||||
tcx.param_env(item_def_id).caller_bounds().iter().collect();
|
||||
let where_predicates = param_env
|
||||
.caller_bounds()
|
||||
.iter()
|
||||
|
14
tests/rustdoc/synthetic_auto/supertrait-bounds.rs
Normal file
14
tests/rustdoc/synthetic_auto/supertrait-bounds.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// Check that we don't add bounds to synthetic auto trait impls that are
|
||||
// already implied by the item (like supertrait bounds).
|
||||
|
||||
// In this case we don't want to add the bounds `T: Copy` and `T: 'static`
|
||||
// to the auto trait impl because they're implied by the bound `T: Bound`
|
||||
// on the implementor `Type`.
|
||||
|
||||
pub struct Type<T: Bound>(T);
|
||||
|
||||
// @has supertrait_bounds/struct.Type.html
|
||||
// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl"]//h3[@class="code-header"]' \
|
||||
// "impl<T> Send for Type<T>where T: Send,"
|
||||
|
||||
pub trait Bound: Copy + 'static {}
|
Loading…
Reference in New Issue
Block a user