Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 14 pull requests #81780

Closed
wants to merge 39 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a072ecb
Don't build remote-test-server with the stage0 toolchain
Jan 20, 2021
b5482a8
Preserve existing LD_LIBRARY_PATH in remote-test-server
Jan 20, 2021
a2f5c72
Fix has_body for trait methods
CraftSpider Jan 24, 2021
1c60d27
Remove leading newline
CraftSpider Jan 24, 2021
3106de5
Remove struct_type from union output and bump format
CraftSpider Jan 24, 2021
c34faad
rustdoc: Move `display_fn` struct inside `display_fn`
camelid Jan 29, 2021
5882cce
Expose correct symlink API on WASI
RReverser Jan 30, 2021
6e6608d
Add additional benchmarks to bit_set
JulianKnodt Feb 2, 2021
1578f2e
Keep old symlink; expose new symlink_path
RReverser Feb 3, 2021
f4b1bef
Restore comment as it was
RReverser Feb 3, 2021
82914a5
Add more information to the error code for 'crate not found'
jyn514 Feb 2, 2021
3b5d018
Handle `Span`s for byte and raw strings and add more detail
estebank Jan 23, 2021
50e394a
relax adt unsizing requirements
lcnr Jan 5, 2021
031cce8
add `relaxed_struct_unsize` feature gate
lcnr Feb 3, 2021
d06384a
make Allocator object-safe
RustyYato Feb 3, 2021
fdaf603
add generic args to hir::TypeBinding
b-naber Nov 30, 2020
16af7bf
hir pretty printing
b-naber Nov 30, 2020
760a665
lowering of generic args in AssocTyConstraint
b-naber Nov 30, 2020
da2cf9b
substitutions in trait predicates
b-naber Nov 30, 2020
6a68966
use generic arguments of associated item in trait_ref method
b-naber Nov 30, 2020
9e92015
remove subst_supertrait call
b-naber Nov 30, 2020
b080d1c
Cleanup rustdoc pass descriptions a bit
camelid Feb 4, 2021
12d411f
add tests
b-naber Nov 30, 2020
0c3a7d8
Update LayoutError/LayoutErr stability attributes
Feb 5, 2021
4253919
Indicate change in RSS from start to end of pass in time-passes output
tgnottingham Feb 5, 2021
9096865
Rollup merge of #79554 - b-naber:generic-associated-types-in-trait-pa…
m-ou-se Feb 5, 2021
e210a80
Rollup merge of #80726 - lcnr:unsize-query, r=oli-obk
m-ou-se Feb 5, 2021
e9fec38
Rollup merge of #81307 - estebank:invalid-byte-str-span, r=petrochenkov
m-ou-se Feb 5, 2021
d71f741
Rollup merge of #81318 - CraftSpider:json-trait-fix, r=jyn514
m-ou-se Feb 5, 2021
f0cd2e6
Rollup merge of #81456 - Amanieu:remote-test-server, r=Amanieu
m-ou-se Feb 5, 2021
0cc179f
Rollup merge of #81497 - camelid:rustdoc-display_fn-remove-cell, r=jy…
m-ou-se Feb 5, 2021
ea7274b
Rollup merge of #81500 - CraftSpider:union-kind, r=jyn514
m-ou-se Feb 5, 2021
a32b798
Rollup merge of #81542 - RReverser:wasi-symlink, r=alexcrichton
m-ou-se Feb 5, 2021
92b99a2
Rollup merge of #81676 - jyn514:crate-not-found, r=oli-obk
m-ou-se Feb 5, 2021
033bbea
Rollup merge of #81682 - JulianKnodt:bit_set_iter_benchmarks, r=oli-obk
m-ou-se Feb 5, 2021
becf861
Rollup merge of #81730 - RustyYato:object-safe-allocator, r=Amanieu
m-ou-se Feb 5, 2021
9f6f4ac
Rollup merge of #81763 - camelid:rustdoc-passes-desc-up, r=GuillaumeG…
m-ou-se Feb 5, 2021
539a386
Rollup merge of #81767 - exrook:layout-error-stability, r=Mark-Simula…
m-ou-se Feb 5, 2021
64f8920
Rollup merge of #81771 - tgnottingham:time-passes-rss-delta, r=oli-obk
m-ou-se Feb 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion compiler/rustc_middle/src/ty/sty.rs
Original file line number Diff line number Diff line change
@@ -1132,8 +1132,16 @@ impl<'tcx> ProjectionTy<'tcx> {
/// For example, if this is a projection of `<T as Iterator>::Item`,
/// then this function would return a `T: Iterator` trait reference.
pub fn trait_ref(&self, tcx: TyCtxt<'tcx>) -> ty::TraitRef<'tcx> {
// FIXME: This method probably shouldn't exist at all, since it's not
// clear what this method really intends to do. Be careful when
// using this method since the resulting TraitRef additionally
// contains the substs for the assoc_item, which strictly speaking
// is not correct
let def_id = tcx.associated_item(self.item_def_id).container.id();
ty::TraitRef { def_id, substs: self.substs.truncate_to(tcx, tcx.generics_of(def_id)) }
// Include substitutions for generic arguments of associated types
let assoc_item = tcx.associated_item(self.item_def_id);
let substs_assoc_item = self.substs.truncate_to(tcx, tcx.generics_of(assoc_item.def_id));
ty::TraitRef { def_id, substs: substs_assoc_item }
}

pub fn self_ty(&self) -> Ty<'tcx> {