about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2020-01-12Split `rustc_mir::{build, hair, lints}` into their own crateMatthew Jasper-1/+1
2020-01-12Rollup merge of #68045 - Centril:liberate-lints, r=Mark-SimulacrumMazdak Farrokhzad-47/+25
Move more of `rustc::lint` into `rustc_lint` Based on https://github.com/rust-lang/rust/pull/67806. Here we try to consolidate more of the linting infra into `rustc::lint`. Some high-level notes: - We now store an `Lrc<dyn Any + Send + Sync>` as opposed to `Lrc<LintStore>` in the `GlobalCtxt`. This enables us to avoid referring to the type, breaking a cyclic dependency, and so we can move things from `rustc::lint` to `rustc_lint`. - `in_derive_expansion` is, and needs to, be moved as a method on `Span`. - We reduce the number of ways on `tcx` to emit a lint so that the developer UX is more streamlined. - `LintLevelsBuilder` is moved to `rustc_lint::levels`, leaving behind `LintLevelMap/Set` in a purified form due to current constraints (hopefully fixable in the future after https://github.com/rust-lang/rust/pull/68133). - `struct_lint_level` is moved to `rustc::lint` due to current dependency constraints. - `rustc::lint::context` is moved to `rustc_lint::context`. - The visitors in `rustc::lint` are moved to `rustc_lint::passes`.
2020-01-11Move some queries from rustc::ty to librustc_passes.Camille GILLOT-354/+2
2020-01-11Auto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obkbors-32/+42
Promote references to constants instead of statics r? @oli-obk
2020-01-11Use Arena for interningJohn Kåre Alsaker-20/+10
2020-01-11Lift using interners instead of in_arenaJohn Kåre Alsaker-17/+22
2020-01-11pacify the parallel compilerMazdak Farrokhzad-2/+3
2020-01-11inline maybe_lint_level_rootMazdak Farrokhzad-8/+6
2020-01-11move LintSource to levelsMazdak Farrokhzad-3/+3
2020-01-11GlobalCtxt: Erase `LintStore` type.Mazdak Farrokhzad-3/+7
2020-01-11reduce diversity in linting methodsMazdak Farrokhzad-26/+0
2020-01-11canonicalize some lint importsMazdak Farrokhzad-16/+17
2020-01-11Rollup merge of #68050 - Centril:canon-error, r=Mark-SimulacrumYuki Okushi-7/+5
Canonicalize rustc_error imports r? @Mark-Simulacrum
2020-01-11Rollup merge of #67258 - Centril:open-ended-ranges, r=oli-obkYuki Okushi-22/+73
Introduce `X..`, `..X`, and `..=X` range patterns Tracking issue: https://github.com/rust-lang/rust/issues/67264 Feature gate: `#![feature(half_open_range_patterns)]` --------------------------- In this PR, we introduce range-from (`X..`), range-to (`..X`), and range-to-inclusive (`..=X`) patterns. These correspond to the `RangeFrom`, `RangeTo`, and `RangeToInclusive` expression forms introduced with the same syntaxes. The correspondence is both syntactic and semantic (in the sense that e.g. a `X..` pattern matching on a scrutinee `s` holds exactly when `(X..).contains(&s)` holds). --------------------------- Noteworthy: - The compiler complexity added with this PR is around 10 lines (discounting new tests, which account for the large PR size). - `...X` is accepted syntactically with the same meaning as `..=X`. This is done primarily to simplify and unify the implementation & spec. If-and-when we decide to make `X...Y` a hard error on a new edition, we can do the same for `...X` patterns as well. - `X...` and `X..=` is rejected syntactically just like it is for the expression equivalents. We should perhaps make these into semantic restrictions (cc @petrochenkov). - In HAIR, these half-open ranges are represented by inserting the max/min values for the approprate types. That is, `X..` where `X: u8` would become `X..=u8::MAX` in HAIR (note the `..=` since `RangeFrom` includes the end). - Exhaustive integer / char matching does not (yet) allow for e.g. exhaustive matching on `0usize..` or `..5usize | 5..` (same idea for `isize`). This would be a substantially more invasive change, and could be added in some other PR. - The issues with slice pattern syntax has been resolved as we decided to use `..` to mean a "rest-pattern" and `[xs @ ..]` to bind the rest to a name in a slice pattern. - Like with https://github.com/rust-lang/rust/pull/35712, which provided `X..Y` range patterns, this is not yet backed up by an RFC. I'm providing this experimental implementation now to have something concrete to discuss. I would be happy to provide an RFC for this PR as well as for #35712 to finalize and confirm the ideas with the larger community. Closes https://github.com/rust-lang/rfcs/issues/947. --------------------------- r? @varkor cc @matthewjasper @oli-obk I would recommend reviewing this (in particular HAIR-lowering and pattern parsing changes) with whitespace changes ignored.
2020-01-10Fix some rebasing fallout.Michael Woerister-1/+1
2020-01-10Run 'x.py fmt'.Michael Woerister-71/+31
2020-01-10self-profile: Fix issue with handling query blocking.Michael Woerister-11/+27
2020-01-10Initial support for recording query keys in self-profiling data.Michael Woerister-36/+308
2020-01-10self-profile: Switch to new approach for event_id generation that enables ↵Michael Woerister-59/+63
query-invocation-specific event_ids.
2020-01-10Remove PlaceBase enum and make Place base field be local: LocalSantiago Pastorino-3/+3
2020-01-10Remove Static from PlaceBaseSantiago Pastorino-1/+1
2020-01-10Promote `Ref`s to constants instead of staticSantiago Pastorino-29/+39
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-7/+5
2020-01-10Introduce `#![feature(half_open_range_patterns)]`.Mazdak Farrokhzad-22/+73
This feature adds `X..`, `..X`, and `..=X` patterns.
2020-01-10Rollup merge of #67922 - Centril:lowering-cleanup, r=petrochenkovMazdak Farrokhzad-4/+3
rustc_ast_lowering: misc cleanup & rustc dep reductions - The first two commits do some code simplification. - The next three do some file splitting (getting `lib.rs` below the 3kloc tidy lint). - The remaining commits reduce the number of `rustc::` imports. This works towards making lowering independent of the `rustc` crate. r? @oli-obk cc @Zoxc
2020-01-10Rollup merge of #68040 - sinkuu:unused, r=petrochenkovYuki Okushi-13/+0
Cleanup
2020-01-09Don't discard marker trait impls when inference variables are presentAaron Hill-4/+9
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-09{rustc::util -> rustc_data_structures}::capturesMazdak Farrokhzad-4/+3
2020-01-09Fix copy_from_slice which should be extend_from_sliceMarkus Westerlind-1/+1
2020-01-09Change -Z time event naming scheme and make them generic activitiesJohn Kåre Alsaker-3/+3
2020-01-09Remove unused `struct ClosureUpvar`Shotaro Yamada-13/+0
2020-01-09Rollup merge of #67986 - JohnTitor:fix-ice-rust-call, r=varkorMazdak Farrokhzad-5/+9
Display more informative ICE Fixes #66696
2020-01-09Rollup merge of #67630 - oli-obk:extern_ptr_dangling, r=spastorinoMazdak Farrokhzad-2/+0
Treat extern statics just like statics in the "const pointer to static" representation fixes #67612 r? @spastorino cc @RalfJung this does not affect runtime promotion at all. This is just about promotion within static item bodies.
2020-01-08perf: Avoid creating a SmallVec if nothing changes during a foldMarkus Westerlind-17/+30
Not sure if this helps but in theory it should be less work than what the current micro optimization does for `ty::Predicate` lists. (It would explain the overhead I am seeing from `perf`.)
2020-01-09Rollup merge of #67781 - cjgillot:passes-const, r=oli-obkYuki Okushi-158/+0
Move `is_min_const_fn` query to librustc_mir. The only two uses of the associated methods are in `librustc_mir` and `librustdoc`. Please tell me if there is a better choice. cc #65031
2020-01-08Move `is_min_const_fn` query to librustc_mir.Camille GILLOT-2/+0
The only two uses of the associated methods are in librustc_mir and librustdoc. Please tell me if there is a better choice.
2020-01-08Move constness.rs to librustc_mir.Camille GILLOT-156/+0
2020-01-08Display more informative ICEYuki Okushi-5/+9
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-5/+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-07Move magic traits queries to rustc::traits::drop.Camille GILLOT-199/+1
2020-01-07Move required_region_bounds to rustc::infer::opaque_types.Camille GILLOT-64/+0
2020-01-07Move free_region_map to rustc::ty.Camille GILLOT-1/+98
2020-01-07Move structural_match to rustc::traits.Camille GILLOT-222/+0
2020-01-07Move ty::wf to traits.Camille GILLOT-747/+0
2020-01-07Make traits::util::* free functions.Camille GILLOT-1/+1
2020-01-07Move subst_and_normalize_erasing_regionsto rustc::ty.Camille GILLOT-0/+24
2020-01-07Move normalize_erasing_regions to rustc::ty.Camille GILLOT-0/+79
2020-01-07Remove private methods from TyCtxt impl block: rustc::ty::print::pretty.Camille GILLOT-16/+16
2020-01-07Remove private methods from TyCtxt impl block: rustc::ty::outlives.Camille GILLOT-27/+23
2020-01-07Remove trivial function.Camille GILLOT-6/+2