summary refs log tree commit diff
path: root/src/librustc/traits/specialize
AgeCommit message (Collapse)AuthorLines
2019-11-29allow customising ty::TraitRef's printing behaviorMikhail Babenko-2/+2
fix clippy allow customising ty::TraitRef's printing behavior fix clippy stylistic fix
2019-11-19More HashStable.Camille GILLOT-6/+1
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-0/+2
2019-10-18rustc: arena-allocate the slice in `ty::GenericsPredicate`, not the whole ↵Eduard-Mihai Burtescu-1/+1
struct.
2019-10-05Add comment to `Type` and `OpaqueTy` matchJonas Schievink-1/+1
2019-10-05Deny specializing items not in the parent implJonas Schievink-25/+40
2019-09-28Switch over all StableHash impls to new formatMark Rousskov-5/+2
2019-09-27Remove global_tcx from TyCtxtMark Rousskov-1/+0
The non-global context was removed; there's only one context now. This is a noop method that only serves to confuse readers -- remove it.
2019-09-25Rename surviving uses of `sty`varkor-9/+9
2019-09-25Rename non-`TyS` uses of `sty`varkor-2/+2
2019-09-24Fix coherence checking for impl trait in type aliasesAaron Hill-1/+1
Fixes #63677 RFC #2071 (impl-trait-existential-types) does not explicitly state how impl trait type alises should interact with coherence. However, there's only one choice which makes sense - coherence should look at the underlying type (i.e. the 'defining' type of the impl trait) of the type alias, just like we do for non-impl-trait type aliases. Specifically, impl trait type alises which resolve to a local type should be treated like a local type with respect to coherence (e.g. impl trait type aliases which resolve to a forieign type should be treated as a foreign type, and those that resolve to a local type should be treated as a local type). Since neither inherent impls nor direct trait impl (i.e. `impl MyType` or `impl MyTrait for MyType`) are allowd for type aliases, this usually does not come up. Before we ever attempt to do coherence checking, we will have errored out if an impl trait type alias was used directly in an 'impl' clause. However, during trait selection, we sometimes need to prove bounds like 'T: Sized' for some type 'T'. If 'T' is an impl trait type alias, this requires to know the coherence behavior for impl trait type aliases when we perform coherence checking. Note: Since determining the underlying type of an impl trait type alias requires us to perform body type checking, this commit causes us to type check some bodies easlier than we otherwise would have. However, since this is done through a query, this shouldn't cause any problems For completeness, I've added an additional test of the coherence-related behavior of impl trait type aliases.
2019-08-04Revert "Rollup merge of #62696 - chocol4te:fix_#62194, r=estebank"Ariel Ben-Yehuda-7/+2
This reverts commit df21a6f040a7011d509769a61ac7af9502636b33, reversing changes made to cc16d0486933e02237190366de2eb43df2215c11.
2019-08-02Replace "existential" by "opaque"varkor-2/+2
2019-07-16Suggested changeFerdia McKeogh-4/+5
2019-07-16Check that trait is exported or public before adding intercrate ambiguity hintFerdia McKeogh-2/+6
2019-07-03Remove needless lifetimesJeremy Stucki-5/+5
2019-06-14Remove unnecessary lift callsJohn Kåre Alsaker-6/+1
2019-06-14Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-17/+14
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-19/+19
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-32/+29
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-12/+12
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-6/+6
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-13/+13
2019-05-28Rename `OpportunisticTypeResolver` to `OpportunisticVarResolver`varkor-1/+1
2019-05-26Rename "Associated*" to "Assoc*"Andrew Xu-5/+5
We are going to uniform the terminology of all associated items. Methods that may or may not have `self` are called "associated functions". Because `AssociatedFn` is a bit long, we rename `Associated` to `Assoc`.
2019-05-18Declare DefIndex with the newtype_index macroFabian Drinck-1/+1
2019-05-17Auto merge of #49799 - hdhoang:46205_deny_incoherent_fundamental_impls, ↵bors-19/+24
r=nikomatsakis lint: convert incoherent_fundamental_impls into hard error *Summary for affected authors:* If your crate depends on one of the following crates, please upgrade to a newer version: - gtk-rs: upgrade to at least 0.4 - rusqlite: upgrade to at least 0.14 - nalgebra: upgrade to at least 0.15, or the last patch version of 0.14 - spade: upgrade or refresh the Cargo.lock file to use version 1.7 - imageproc: upgrade to at least 0.16 (newer versions no longer use nalgebra) implement #46205 r? @nikomatsakis
2019-05-09cleanup: Remove `DefIndexAddressSpace`Vadim Petrochenkov-3/+1
2019-04-16lint: convert incoherent_fundamental_impls into hard errorHoàng Đức Hiếu-19/+24
Also remove it from lint listings.
2019-04-05Introduce an arena type which may be used to allocate a list of types with ↵John Kåre Alsaker-10/+8
destructors
2019-03-15rustc: print elided regions as '_ instead of nothing, and use a separate ↵Eduard-Mihai Burtescu-1/+1
check when optional.
2019-03-15rustc: always rely on '_ to be not printed by ty::Region itself.Eduard-Mihai Burtescu-1/+1
2019-03-01ty: HirIdify some lintsljedrz-2/+2
2019-02-27rename Substs to InternalSubstscsmoe-2/+2
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
2019-02-26replace &'tcx Substs with SubstsRefcsmoe-6/+6
2019-02-10rustc: doc commentsAlexander Regueiro-6/+6
2019-02-05move librustc to 2018Mark Mansi-15/+15
2019-01-04implement a hack to make traitobject 0.1.0 compileAriel Ben-Yehuda-12/+53
2019-01-04Revert "add coherence future-compat warnings for marker-only trait objects"Ariel Ben-Yehuda-55/+9
This reverts commit 760639635facb6c9a0926ac9278bcba71880b0b3.
2019-01-02try to detect affected code and direct people to #56105Niko Matsakis-0/+7
2018-12-25Remove licensesMark Rousskov-20/+0
2018-12-18Auto merge of #56481 - arielb1:dynamic-order, r=nikomatsakisbors-9/+55
add coherence future-compat warnings for marker-only trait objects The future-compat warnings break code that assumes that `dyn Send + Sync != dyn Sync + Send`, and are the first step in making them equal. cc #33140. Note: this lint should be made to default-warn before we merge. It is deny only for the crater run. r? @nikomatsakis / @scalexm . cc @Centril & @alexreg.
2018-12-14add coherence future-compat warnings for marker-only trait objectsAriel Ben-Yehuda-9/+55
The future-compat warnings break code that assumes that `dyn Send + Sync != dyn Sync + Send`, and are the first step in making them equal. cc #33140. It should be possible to revert this commit when we're done with the warnings.
2018-12-12specialize: remove Boxes used by Children::insertljedrz-8/+33
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-28/+29
2018-12-06Use a function to access the Hir map to be able to turn it into a query laterJohn Kåre Alsaker-1/+1
2018-12-03pass the parameter environment to `traits::find_associated_item`Ariel Ben-Yehuda-1/+11
dropping the param-env on the floor is obviously the wrong thing to do. The ICE was probably exposed by #54490 adding the problem-exposing use of `traits::find_associated_item`. Fixes #55380.
2018-11-26rustc-guide has movedMark Mansi-1/+1
2018-11-15Auto merge of #55974 - pietroalbini:rollup, r=pietroalbinibors-1/+1
Rollup of 17 pull requests Successful merges: - #55182 (Redox: Update to new changes) - #55211 (Add BufWriter::buffer method) - #55507 (Add link to std::mem::size_of to size_of intrinsic documentation) - #55530 (Speed up String::from_utf16) - #55556 (Use `Mmap` to open the rmeta file.) - #55622 (NetBSD: link libstd with librt in addition to libpthread) - #55750 (Make `NodeId` and `HirLocalId` `newtype_index`) - #55778 (Wrap some query results in `Lrc`.) - #55781 (More precise spans for temps and their drops) - #55785 (Add mem::forget_unsized() for forgetting unsized values) - #55852 (Rewrite `...` as `..=` as a `MachineApplicable` 2018 idiom lint) - #55865 (Unix RwLock: avoid racy access to write_locked) - #55901 (fix various typos in doc comments) - #55926 (Change sidebar selector to fix compatibility with docs.rs) - #55930 (A handful of hir tweaks) - #55932 (core/char: Speed up `to_digit()` for `radix <= 10`) - #55956 (add tests for some fixed ICEs) Failed merges: r? @ghost
2018-11-15Auto merge of #54906 - qnighy:fix-issue-50452, r=nikomatsakisbors-8/+19
Reattach all grandchildren when constructing specialization graph. Specialization graphs are constructed by incrementally adding impls in the order of declaration. If the impl being added has its specializations in the graph already, they should be reattached under the impl. However, the current implementation only reattaches the one found first. Therefore, in the following specialization graph, ``` Tr1 | I3 / \ I1 I2 ``` If `I1`, `I2`, and `I3` are declared in this order, the compiler mistakenly constructs the following graph: ``` Tr1 / \ I3 I2 | I1 ``` This patch fixes the reattach procedure to include all specializing grandchildren-to-be. Fixes #50452.