about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2019-12-21Use Arena inside hir::Item.Camille GILLOT-10/+10
2019-12-21Use Arena inside hir::Crate.Camille GILLOT-1/+1
2019-12-19is_binding_pat: treat or-pat like tuple-patMazdak Farrokhzad-1/+2
2019-12-19is_binding_pat: don't use _ armMazdak Farrokhzad-1/+8
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-6/+16
functions with a `const` modifier
2019-12-13Reuse the `staged_api` feature for `rustc_const_unstable`Oliver Scherer-1/+6
2019-12-03Move NativeLibraryKind to rustc_sessionMark Rousskov-15/+1
2019-12-01Remove ord lang itemcad97-1/+0
2019-11-30Rollup merge of #66895 - Centril:rustc_feature, r=oli-obkMazdak Farrokhzad-10/+14
Feature gating *declarations* => new crate `rustc_feature` This PR moves the data-oriented parts of feature gating into its own crate, `rustc_feature`. The parts consist of some data types as well as `accepted`, `active`, `removed`, and `builtin_attrs`. Feature gate checking itself remains in `syntax::feature_gate::check`. The parts which define how to emit feature gate errors could probably be moved to `rustc_errors` or to the new `rustc_session` crate introduced in #66878. The visitor itself could probably be moved as a pass in `rustc_passes` depending on how the dependency edges work out. The PR also contains some drive-by cleanup of feature gate checking. As such, the PR probably best read commit-by-commit. r? @oli-obk cc @petrochenkov cc @Mark-Simulacrum
2019-11-30move GateIssue to rustc_feature & simplify emit_feature_errMazdak Farrokhzad-10/+14
2019-11-28rustc: Move some queries to `rustc_metadata`Vadim Petrochenkov-5/+1
2019-11-28rustc_metadata: Move `has_global_allocator` from session to cstoreVadim Petrochenkov-0/+1
2019-11-28rustc_metadata: Privatize `CrateMetadata::extern_crate`Vadim Petrochenkov-0/+7
2019-11-27Move ExprUseVisitor and mem_categorization to rustc_typeckMatthew Jasper-1339/+0
`MemCategorizationContext` is now private, the remaining types and traits remain public for Clippy.
2019-11-27Remove remaining uses of "cmt"Matthew Jasper-48/+50
2019-11-27Simplify `mem_categorization`Matthew Jasper-937/+183
* `Place` is no longer recursive. * The `cmt` type alias is removed * `Upvar` places no longer include the dereferences of the environment closure or of by reference captures. * All non-dereference projections are combined to a single variant. * Various unnecessary types and methods have been removed.
2019-11-27Simplify fields of `MemCategorizationContext`Matthew Jasper-137/+54
2019-11-27Rename `cmt_` to `Place`Matthew Jasper-40/+40
2019-11-24Add raw address of expressions to the AST and HIRMatthew Jasper-3/+3
2019-11-21reduce size of hir::ExprKindMazdak Farrokhzad-3/+3
2019-11-19More HashStable.Camille GILLOT-26/+4
2019-11-14Clean some error codes diagnosticsGuillaume Gomez-16/+28
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-0/+9
2019-11-13Rollup merge of #66334 - Mark-Simulacrum:sess-cstore, r=petrochenkovYuki Okushi-0/+3
Move Session fields to CrateStore `allocator_kind` and `injected_panic_runtime` are both query-like, this moves them out of Session and into CrateStore, avoiding the `Once` they previously had by clearing separating initialization and de-initialization.
2019-11-12Rollup merge of #66299 - rossmacarthur:fix-41260-avoid-issue-0, r=varkorYuki Okushi-6/+7
support issue = "none" in unstable attributes This works towards fixing #41260. This PR allows the use of `issue = "none"` in unstable attributes and makes changes to internally store the issue number as an `Option<NonZeroU32>`. For example: ```rust #[unstable(feature = "unstable_test_feature", issue = "none")] fn unstable_issue_none() {} ``` It was not made optional because feedback seen here #60860 suggested that people might forget the issue field if it was optional. I could not remove the current uses of `issue = "0"` (of which there are a lot) because the stage 0 compiler expects the old syntax. Once this is available in the stage 0 compiler we can replace all uses of `"0"` with `"none"` and no longer allow `"0"`. This is my first time contributing, so I'm not sure what the protocol is with two-part things like this, so some guidance would be appreciated. r? @varkor
2019-11-11Move allocator_kind to CrateStoreMark Rousskov-0/+2
Similarly to the previous commit, there's no need for this to be in Session and have a Once around it.
2019-11-11Move injected_panic_runtime to CrateStoreMark Rousskov-0/+1
This was essentially a "query" previously (with no key, just always run once when resolving the crate dependencies), and remains so, just now in a way that isn't on Session. This removes the need for the `Once` as well.
2019-11-11support issue = "none" in unstable attributesRoss MacArthur-6/+7
- Use `Option<NonZeroU32>` to represent issue numbers.
2019-11-10Merge hir::Mutability into ast::Mutability.Camille GILLOT-6/+6
2019-11-08hir::ItemKind::Fn: use hir::MethodSigMazdak Farrokhzad-7/+7
2019-11-05use American spelling for `pluralize!`Andy Russell-2/+2
2019-11-04Auto merge of #65835 - Mark-Simulacrum:lockless-lintbuffer, r=nikomatsakisbors-2/+2
Remove LintBuffer from Session This moves the `LintBuffer` from `Session` into the `Resolver`, where it is used until lowering is done and then consumed by early lint passes. This also happily removes the failure mode of buffering lints too late where it would have previously lead to ICEs; it is statically no longer possible to do so. I suspect that with a bit more work a similar move could be done for the lint buffer inside `ParseSess`, but this PR doesn't touch it (in part to keep itself small). The last commit is the "interesting" commit -- the ones before it don't work (though they compile) as they sort of prepare the various crates for the lint buffer to be passed in rather than accessed through Session.
2019-11-03Migrate resolver over to internal lint bufferMark Rousskov-2/+2
2019-11-03Make Emscripten unwinding use a valid type_infoAmanieu d'Antras-1/+1
This allows catch_panic to ignore C++ exceptions.
2019-10-31Implement dual proc macro hashingmsizanoen-0/+1
This changes the mechanism of `-Z dual-proc-macro` to record the host proc macro hash in the transistive dependency information and use it during dependency resolution instead of resolving only by name.
2019-10-28Rollup merge of #65664 - anp:panic-location, r=eddybMazdak Farrokhzad-0/+1
`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N) [Tracking issue](https://github.com/rust-lang/rust/issues/47809) [RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md) @eddyb suggested doing this intrinsic implementation ahead of actually implementing the `#[track_caller]` attribute so that there's an easily tested intermediate step between adding the shim and wiring up the attribute.
2019-10-27Implement core::intrinsics::caller_location.Adam Perry-0/+1
Returns a `&core::panic::Location` corresponding to where it was called, also making `Location` a lang item.
2019-10-25Migrate from `#[structural_match]` attribute a lang-item trait.Felix S. Klock II-0/+4
(Or more precisely, a pair of such traits: one for `derive(PartialEq)` and one for `derive(Eq)`.) ((The addition of the second marker trait, `StructuralEq`, is largely a hack to work-around `fn (&T)` not implementing `PartialEq` and `Eq`; see also issue rust-lang/rust#46989; otherwise I would just check if `Eq` is implemented.)) Note: this does not use trait fulfillment error-reporting machinery; it just uses the trait system to determine if the ADT was tagged or not. (Nonetheless, I have kept an `on_unimplemented` message on the new trait for structural_match check, even though it is currently not used.) Note also: this does *not* resolve the ICE from rust-lang/rust#65466, as noted in a comment added in this commit. Further work is necessary to resolve that and other problems with the structural match checking, especially to do so without breaking stable code (adapted from test fn-ptr-is-structurally-matchable.rs): ```rust fn r_sm_to(_: &SM) {} fn main() { const CFN6: Wrap<fn(&SM)> = Wrap(r_sm_to); let input: Wrap<fn(&SM)> = Wrap(r_sm_to); match Wrap(input) { Wrap(CFN6) => {} Wrap(_) => {} }; } ``` where we would hit a problem with the strategy of unconditionally checking for `PartialEq` because the type `for <'a> fn(&'a SM)` does not currently even *implement* `PartialEq`. ---- added review feedback: * use an or-pattern * eschew `return` when tail position will do. * don't need fresh_expansion; just add `structural_match` to appropriate `allow_internal_unstable` attributes. also fixed example in doc comment so that it actually compiles.
2019-10-24rustc_metadata: Minimize use of `Lrc` in crate storeVadim Petrochenkov-3/+3
Crate metadatas are still stored as `Lrc<CrateMetadata>` in `CStore` because crate store has to be cloneable due to `Resolver::clone_outputs`.
2019-10-24rustc: Add a convenience alias for `dyn MetadataLoader + Sync`Vadim Petrochenkov-0/+2
2019-10-21Rollup merge of #65647 - nnethercote:rm-unnecessary-traits, r=CentrilMazdak Farrokhzad-6/+6
Remove unnecessary trait bounds and derivations This PR removes unnecessary trait bounds and derivations from many types. r? @nikomatsakis
2019-10-21Remove many unnecessary trait derivations.Nicholas Nethercote-6/+6
2019-10-21Rollup merge of #65460 - sinkuu:contains_insert, r=varkorYuki Okushi-2/+1
Clean up `contains()` `insert()` chains on HashSet They can be merged to a single `insert()` call, which may avoid double-hashing/lookup of the value.
2019-10-16Make use of the return value of `HashSet::insert`Shotaro Yamada-2/+1
2019-10-15Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasperTyler Mandry-1/+7
Reducing spurious unused lifetime warnings. Fixes #61115, fixes #64493.
2019-10-15Avoid unused lifetime warning for lifetimes introduced when desugering async.Giles Cope-1/+7
2019-10-14rustc_metadata: Remove resolutions for extern crate items from `CStore`Vadim Petrochenkov-1/+0
Use a more traditional scheme with providing them as a resolver output
2019-10-14rustc_metadata: Use `CrateSource` where appropriateVadim Petrochenkov-0/+6
2019-10-10stability: Do not use `buffer_lint` after lowering to HIRVadim Petrochenkov-3/+11
2019-10-07Address review comments.Charles Lew-1/+1