about summary refs log tree commit diff
path: root/src/librustc/ty/mod.rs
AgeCommit message (Collapse)AuthorLines
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-3183/+0
2020-03-24normalize some imports, prefer direct ones.Mazdak Farrokhzad-4/+3
2020-03-23Split long derive lists into two derive attributes.Ana-Maria Mihalache-13/+2
2020-03-22Remove special-casing from TyCtxt::impl_of_method.Adam Perry-12/+2
We can do this now that opt_associated_item doesn't have any panicking paths.
2020-03-22Allow #[track_caller] in traits.Adam Perry-2/+2
The codegen implementation already works for this, so we're: * propagating track_caller attr from trait def to impl * relaxing errors * adding tests Approved in a recent lang team meeting: https://github.com/rust-lang/lang-team/blob/master/minutes/2020-01-09.md
2020-03-19Refactorings to begin getting rid of rustc_codegen_utilsMark Mansi-0/+1
2020-03-19rustc: use LocalDefId instead of DefIndex in hir::map::definitions.Eduard-Mihai Burtescu-3/+3
2020-03-19rustc: use LocalDefId instead of DefIndex in HirId.Eduard-Mihai Burtescu-2/+4
2020-03-18Rollup merge of #69920 - Centril:hir-cleanup, r=ZoxcMazdak Farrokhzad-2/+1
Remove some imports to the rustc crate - When we have `NestedVisitorMap::None`, we use `type Map = dyn intravisit::Map<'v>;` instead of the actual map. This doesn't actually result in dynamic dispatch (in the future we may want to use an associated type default to simplify the code). - Use `rustc_session::` imports instead of `rustc::{session, lint}`. r? @Zoxc
2020-03-18Rollup merge of #69899 - ecstatic-morse:const-idx-methods, r=oli-obkMazdak Farrokhzad-1/+1
Make methods declared by `newtype_index` macro `const` Crates that use the macro to define an `Idx` type need to enable `#![feature(const_if_match, const_panic)]`.
2020-03-17Rename `from_u32_const` -> `from_u32`Dylan MacKenzie-1/+1
2020-03-17Rollup merge of #69956 - matthewjasper:fix-region-flags, r=nikomatsakisMazdak Farrokhzad-12/+15
Ensure HAS_FREE_LOCAL_NAMES is set for ReFree This fixes a bug introduced by #69469. I don't have any ideas on how to reate a regression test for this.
2020-03-16Rollup merge of #69989 - petrochenkov:nolegacy, r=eddyb,matthewjasperDylan DPC-8/+10
resolve/hygiene: `macro_rules` are not "legacy" The "modern" vs "legacy" naming was introduced by jseyfried during initial implementation of macros 2.0. At this point it's clear that `macro_rules` are not going anywhere and won't be deprecated in the near future. So this PR changes the naming "legacy" (when it implies "macro_rules") to "macro_rules". This should also help people reading this code because it's wasn't obvious that "legacy" actually meant "macro_rules" in these contexts. The most contentious renaming here is probably ``` fn modern -> fn normalize_to_macros_2_0 fn modern_and_legacy -> fn normalize_to_macro_rules ``` Other alternatives that I could think of are `normalize_to_opaque`/`normalize_to_semitransparent`, or `strip_non_opaque`/`strip_transparent`, but they seemed less intuitive. The documentation to these functions can be found in `symbol.rs`. r? @matthewjasper
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-2/+1
2020-03-16hygiene: `modern` -> `normalize_to_macros_2_0`Vadim Petrochenkov-8/+10
`modern_and_legacy` -> `normalize_to_macro_rules`
2020-03-14Update `trait_impls`John Kåre Alsaker-2/+5
2020-03-12Ensure HAS_FREE_LOCAL_NAMES is set for ReFreeMatthew Jasper-12/+15
2020-03-12Rollup merge of #69674 - mark-i-m:assoc-fn, r=matthewjasperMazdak Farrokhzad-3/+3
Rename DefKind::Method and TraitItemKind::Method r? @eddyb, @Centril, or @matthewjasper cc #69498 #60163
2020-03-06Don't redundantly repeat field names (clippy::redundant_field_names)Matthias Krüger-2/+2
2020-03-03DefKind::Method -> DefKind::AssocFnMark Mansi-3/+3
2020-03-01Clean up TypeFlagsMatthew Jasper-61/+89
* Reorder flags to group similar ones together * Make some flags more granular * Compute `HAS_FREE_LOCAL_NAMES` from the other flags * Remove `HAS_TY_CLOSURE` * Add some more doc comments
2020-03-01Auto merge of #69380 - Zoxc:parent-module, r=michaelwoeristerbors-4/+2
Use a query to get parent modules Split out from https://github.com/rust-lang/rust/pull/69015 / https://github.com/rust-lang/rust/pull/68944. r? @michaelwoerister
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-2/+2
2020-02-29Add a `parent_module_from_def_id` queryJohn Kåre Alsaker-4/+2
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-1/+1
2020-02-27Auto merge of #68434 - varkor:astconv-mismatch-error, r=nikomatsakisbors-1/+11
Move generic arg/param validation to `create_substs_for_generic_args` to resolve various const generics issues This changes some diagnostics, but I think they're around as helpful as the previous ones, and occur infrequently regardless. Fixes https://github.com/rust-lang/rust/issues/68257. Fixes https://github.com/rust-lang/rust/issues/68398. r? @eddyb
2020-02-24librustc{, codegen_ssa,infer,mir_build}: don't clone types that are copyMatthias Krüger-1/+1
2020-02-22Make return value of `check_generic_arg_count` semantically clearervarkor-1/+1
2020-02-22Refactor `create_substs_for_generic_args` a littlevarkor-0/+10
2020-02-21Auto merge of #69242 - cjgillot:object_violations, r=Zoxcbors-0/+4
Querify object_safety_violations. Split from #69076 r? @Zoxc
2020-02-19Construct `AssociatedItems` from an iterator instead of a `Vec`Dylan MacKenzie-1/+1
2020-02-19Make lookup of associated item by name O(log n)Dylan MacKenzie-3/+79
2020-02-19Replace `rustc_typeck::Namespace` with `rustc_hir::def::Namespace`Dylan MacKenzie-1/+8
2020-02-19Make is_object_safe a method.Camille GILLOT-0/+4
2020-02-18Rollup merge of #69181 - skinny121:const-eval-return, r=oli-obkDylan DPC-3/+3
Change const eval to just return the value As discussed in https://github.com/rust-lang/rust/pull/68505#discussion_r370956535, the type of consts shouldn't be returned from const eval queries. r? @eddyb cc @nikomatsakis
2020-02-15Change const eval to return `ConstValue`, instead of `Const` as the type ↵Ben Lewis-3/+3
inside it shouldn't be used.
2020-02-14Add fast path to eq_opaque_type_and_typeMatthew Jasper-1/+4
2020-02-14Erase regions in opaque types in typeckMatthew Jasper-3/+7
2020-02-14Auto merge of #69100 - cjgillot:resolve_instance, r=Zoxcbors-0/+1
Move resolve_instance to rustc_ty. r? @Zoxc
2020-02-13Move resolve_instance to rustc_ty.Camille GILLOT-0/+1
2020-02-13Make TraitCandidate generic.Camille GILLOT-20/+2
2020-02-13Use HirId in TraitCandidate.Camille GILLOT-1/+19
2020-02-13Constness -> enum Const { Yes(Span), No }Mazdak Farrokhzad-2/+2
Same idea for `Unsafety` & use new span for better diagnostics.
2020-02-12Auto merge of #68679 - matthewjasper:needs-type-op, r=varkorbors-5/+17
Improve `ty.needs_drop` * Handle cycles in `needs_drop` correctly * Normalize types when computing `needs_drop` * Move queries from rustc to rustc_ty * Avoid query in simple cases reopens #65918
2020-02-10Add `#[repr(no_niche)]`.Felix S. Klock II-1/+7
This repr-hint makes a struct/enum hide any niche within from its surrounding type-construction context. It is meant (at least initially) as an implementation detail for resolving issue 68303. We will not stabilize the repr-hint unless someone finds motivation for doing so. (So, declaration of `no_niche` feature lives in section of file where other internal implementation details are grouped, and deliberately leaves out the tracking issue number.) incorporated review feedback, and fixed post-rebase.
2020-02-09Apply suggestions from code reviewmatthewjasper-1/+1
Co-Authored-By: varkor <github@varkor.com>
2020-02-08Make `provided_trait_methods` use `impl Iterator`Jonas Schievink-2/+1
2020-02-08Make `associated_items` query return a sliceJonas Schievink-21/+3
2020-02-06Rollup merge of #68837 - jonas-schievink:assoc-item-lookup-2, r=estebankDylan DPC-21/+10
Make associated item collection a query Before this change, every time associated items were iterated over (which rustc does *a lot* – this can probably be further optimized), there would be N+1 queries to fetch all assoc. items. Now there's just one after they've been computed once.
2020-02-05Auto merge of #68831 - Dylan-DPC:rollup-j6x15y9, r=Dylan-DPCbors-2/+1
Rollup of 7 pull requests Successful merges: - #68282 (Instrument C / C++ in MemorySanitizer example) - #68758 (Fix 59191 - ICE when macro replaces crate root with non-module item) - #68805 (bootstrap: fix clippy warnings) - #68810 (Remove Copy impl from OnceWith) - #68815 (remove redundant imports (clippy::single_component_path_imports)) - #68818 (fix couple of perf related clippy warnings) - #68819 (Suggest `split_at_mut` on multiple mutable index access) Failed merges: r? @ghost