about summary refs log tree commit diff
path: root/src/librustc/traits/specialize
AgeCommit message (Collapse)AuthorLines
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-821/+0
2020-02-11Auto merge of #69062 - Dylan-DPC:rollup-7wpjpqu, r=Dylan-DPCbors-30/+43
Rollup of 8 pull requests Successful merges: - #66498 (Remove unused feature gates) - #68816 (Tweak borrow error on `FnMut` when `Fn` is expected) - #68824 (Enable Control Flow Guard in rustbuild) - #69022 (traits: preallocate 2 Vecs of known initial size) - #69031 (Use `dyn Trait` more in tests) - #69044 (Don't run coherence twice for future-compat lints) - #69047 (Don't rustfmt check the vendor directory.) - #69055 (Clean up E0307 explanation) Failed merges: r? @ghost
2020-02-11Run RustFmtjumbatm-5/+5
2020-02-11Invert control in struct_lint_level.jumbatm-51/+63
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-11Don't run coherence twice for future-compat lintsJonas Schievink-30/+43
2020-02-09Remove vestigial #43355-compat codeJonas Schievink-30/+7
This was previously a future-compat warning that has since been turned into hard error, but without actually removing all the code. Avoids a call to `traits::overlapping_impls`, which is expensive.
2020-02-06lint impls that will become incoherent when leak-check is removedNiko Matsakis-4/+26
2020-02-05Move specialization_graph definition in traits::types.Camille GILLOT-196/+4
2020-01-20Rollup merge of #68353 - Centril:code-liberation, r=petrochenkovDylan DPC-2/+0
Remove `rustc_error_codes` deps except in `rustc_driver` Remove dependencies on `rustc_error_codes` in all crates except for `rustc_driver`. This has some benefits: 1. Adding a new error code when hacking on the compiler only requires rebuilding at most `rustc_error_codes`, `rustc_driver`, and the reflexive & transitive closure of the crate where the new error code is being added and its reverse dependencies. This improves time-to-UI-tests (TTUT). 2. Adding an error description to an error code only requires rebuilding `rustc_error_codes` and `rustc_driver`. This should substantially improve TTUT. r? @petrochenkov cc @rust-lang/wg-diagnostics
2020-01-20Auto merge of #68057 - Aaron1011:fix/marker-trait-selection, r=matthewjasperbors-1/+1
Don't discard marker trait impls when inference variables are present Fixes #61651 Previously, we would unconditionally discard impl candidates for marker traits during trait selection. However, if the predicate had inference variables, this could have the effect of constrainting inference variables (due to a successful trait selection) when we would have otherwise failed due to mutliple applicable impls, This commit prevents marker trait impls from being discarded while the obligation predicate has any inference variables, ensuring that discarding impls will never cause us to incorrectly constraint inference variables.
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-2/+0
2020-01-11canonicalize some lint importsMazdak Farrokhzad-2/+2
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-1/+1
2020-01-09Don't discard marker trait impls when inference variables are presentAaron Hill-1/+1
Fixes #61651 Previously, we would unconditionally discard impl candidates for marker traits during trait selection. However, if the predicate had inference variables, this could have the effect of constrainting inference variables (due to a successful trait selection) when we would have otherwise failed due to mutliple applicable impls, This commit prevents marker trait impls from being discarded while the obligation predicate has any inference variables, ensuring that discarding impls will never cause us to incorrectly constraint inference variables.
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-0/+1
- remove syntax::{help!, span_help!, span_note!} - remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!} - lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints - inline syntax::{struct_span_warn!, diagnostic_used!} - stringify_error_code! -> error_code! & use it more. - find_plugin_registrar: de-fatalize an error - de-fatalize metadata errors - move type_error_struct! to rustc_typeck - struct_span_err! -> rustc_errors
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-2/+2
2020-01-04DefId{Map,Set} -> rustc::hir::def_idMazdak Farrokhzad-2/+1
2020-01-04canonicalize FxHash{Map,Set} importsMazdak Farrokhzad-1/+2
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-22Format the worldMark Rousskov-161/+166
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