about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-12/+12
2019-09-29remove ClosureSubsts with SubstsRefcsmoe-1/+1
2019-09-29clean ClosureSubsts in rustc::tycsmoe-21/+26
2019-09-29introduce from_ref helper for replacementcsmoe-6/+78
2019-09-29remove bit_set re-export from rustc_data_structurescsmoe-3/+3
2019-09-29Rollup merge of #64824 - Mark-Simulacrum:no-stable-hasher-result-everywhere, ↵Mazdak Farrokhzad-71/+24
r=michaelwoerister No StableHasherResult everywhere This removes the generic parameter on `StableHasher`, instead moving it to the call to `finish`. This has the side-effect of making all `HashStable` impls nicer, since we no longer need the verbose `<W: StableHasherResult>` that previously existed -- often forcing line wrapping. This is done for two reasons: * we should avoid false "generic" dependency on the result of StableHasher * we don't need to codegen two/three copies of all the HashStable impls when they're transitively used to produce a fingerprint, u64, or u128. I haven't measured, but this might actually make our artifacts somewhat smaller too. * Easier to understand/read/write code -- the result of the stable hasher is irrelevant when writing a hash impl.
2019-09-29Rollup merge of #64799 - Aaron1011:fix/double-panic, r=Mark-SimulacrumMazdak Farrokhzad-2/+6
Fix double panic when printing query stack during an ICE On the latest nightly, any call to `bug` or `span_bug` will result in two panics - the first one as a normal result of calling `bug` / `span_bug`, and the second as a result of trying to print the query stack from the panic handler. This is caused by the query-printing code attempting to acquire a lock on `HandlerInnder`, which is still being held by `bug`. This PR moves the actual panic out of `HandlerInner`, into `Handler`. This allows us to release the lock on `HandlerInner` before triggering the panic, ensuring that the panic handler will be able to acquire the lock if necessary.
2019-09-29Rollup merge of #63492 - eddyb:cvarargs, r=nagisa,matthewjasperMazdak Farrokhzad-33/+2
Remove redundancy from the implementation of C variadics. This cleanup was first described in https://github.com/rust-lang/rust/issues/44930#issuecomment-497163539: * AST doesn't track `c_variadic: bool` anymore, relying solely on a trailing `CVarArgs` type in fn signatures * HIR doesn't have a `CVarArgs` anymore, relying solely on `c_variadic: bool` * same for `ty::FnSig` (see tests for diagnostics improvements from that) * `{hir,mir}::Body` have one extra argument than the signature when `c_variadic == true` * `rustc_typeck` and `rustc_mir::{build,borrowck}` need to give that argument the right type (which no longer uses a lifetime parameter, but a function-internal scope) * `rustc_target::abi::call` doesn't need special hacks anymore (since it never sees the `VaListImpl` now, it's all inside the body) r? @nagisa / @rkruppe cc @dlrobertson @oli-obk
2019-09-28Rollup merge of #64678 - tomtau:fix/no-std-error, r=matthewjasperMazdak Farrokhzad-1/+1
added more context for duplicate lang item errors (fixes #60561) Some more information about #60561 -- these errors are pretty common when one works in restrictive environments with `no_std` or customized `std`, but they don't provide much context for debugging, as any transitive dependency could have brought in `std` crate. With that, currently, one needs to use something like `cargo tree` and investigate transitive dependencies one by one. It'll be more helpful to know at least the crate that uses `std` (which `cargo tree` doesn't show) to pin down this investigation when debugging. I'm not sure what the best way to get this context is inside rustc internals (I'm new to them). I found that `all_crate_nums` query returns the crates in some dependency order, so printing out the name of the preceding crate seems to do the trick. But I welcome suggestions if this can be done in a better way.
2019-09-28Switch over all StableHash impls to new formatMark Rousskov-71/+24
2019-09-28rustc: rely on c_variadic == true instead of CVarArgs in HIR/Ty fn signatures.Eduard-Mihai Burtescu-33/+2
2019-09-28Rollup merge of #64781 - Mark-Simulacrum:no-global-tcx, r=eddybMazdak Farrokhzad-35/+22
Remove stray references to the old global tcx
2019-09-28Move `get_slice_bytes` to `rustc::mir::interpret` so it can be reused.ben-18/+4
2019-09-28Add inline function `get_slice_bytes` to remove code duplication.ben-24/+18
2019-09-28Add support for relating slices in `super_relate_consts`.ben-3/+36
2019-09-27cleanup dead ast-borrowck / migrate-mode code.Mazdak Farrokhzad-7/+0
2019-09-27cleanup check_match wrt. SignalledError.Mazdak Farrokhzad-1/+1
2019-09-27Remove lift_to_globalMark Rousskov-7/+2
2019-09-27Remove global_tcx from TyCtxtMark Rousskov-29/+21
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-27getting more context for duplicate lang items (fixes #60561)Tomas Tauber-1/+1
Where possible, the error message includes the name of the crate that brought in the crate with duplicate lang items (which helps with debugging). This information is passed on from cstore using the `extern_crate` query.
2019-09-27Auto merge of #64813 - varkor:node-to-kind, r=Centrilbors-7/+7
Rename `*.node` to `*.kind`, and `hair::Pattern*` to `hair::Pat*` In both `ast::Expr` and `hir::Expr`: - Rename `Expr.node` to `Expr.kind`. - Rename `Pat.node` to `Pat.kind`. - Rename `ImplItem.node` to `ImplItem.kind`. - Rename `Lit.node` to `Lit.kind`. - Rename `TraitItem.node` to `TraitItem.kind`. - Rename `Ty.node` to `Ty.kind`. - Rename `Stmt.node` to `Stmt.kind`. - Rename `Item.node` to `Item.kind`. - Rename `ForeignItem.node` to `ForeignItem.kind`. - Rename `MetaItem.node` to `MetaItem.kind`. Also: - Rename `hair::FieldPattern` to `hair::FieldPat`. - Rename `hair::PatternKind` to `hair::PatKind`. - Rename `hair::PatternRange` to `hair::PatRange`. - Rename `PatternContext` to `PatCtxt`. - Rename `PatternTypeProjection` to `PatTyProj`. - Rename `hair::Pattern` to `hair::Pat`. These two sets of changes are grouped together to aid with merging. The only changes are renamings. r? @petrochenkov
2019-09-26Add note about global state in try_print_query_stackAaron Hill-0/+3
2019-09-26Auto merge of #64816 - Centril:rollup-gbeqot4, r=Centrilbors-11/+0
Rollup of 5 pull requests Successful merges: - #64221 ( Rust 2015: No longer downgrade NLL errors) - #64772 (Remove tx_to_llvm_workers from TyCtxt) - #64783 (Fix issue #64732) - #64787 (Fix ExitStatus on Fuchsia) - #64812 (Add test for E0543) Failed merges: r? @ghost
2019-09-26Use existing Handler to print query stackAaron Hill-2/+3
When the panic handler is run, the existing Handler may be in a weird state if it was responsible for triggering the panic. By using a freshly created Handler, we avoid trying to re-entrantly lock a HandlerInner, which was causing a double panic on ICEs.
2019-09-26Rename `Item.node` to `Item.kind`varkor-5/+5
2019-09-26Rename `Lit.node` to `Lit.kind`varkor-1/+1
2019-09-26Rename `Expr.node` to `Expr.kind`varkor-1/+1
For both `ast::Expr` and `hir::Expr`.
2019-09-26Rollup merge of #64772 - Mark-Simulacrum:no-tyctxt-tx, r=eddybMazdak Farrokhzad-11/+0
Remove tx_to_llvm_workers from TyCtxt This can be kept within the codegen backend crates entirely -- there's no reason for us to create it outside and attempt to hold it in the (global) context. Changes here aren't really too easily reviewable I suspect -- not sure if they can be cleaned up by splitting into more commits though, it's just hard to reason about `Box<Any>` in general. If there are thoughts though I'd be happy to hear them. The primary goal of this PR is to get rid of the field on `rustc_interface::Queries`.
2019-09-26Auto merge of #64515 - varkor:kindedterm, r=oli-obkbors-147/+157
Rename `subst::Kind` to `subst::GenericArg` And `subst::UnpackedKind` to `subst::GenericArgKind`. Individual variable names (e.g. `kind`) are not renamed, which would be an infeasible mission. Fixes https://github.com/rust-lang/rust/issues/64352. r? @eddyb
2019-09-26Rename some `_sty` variables to `_kind`varkor-8/+8
2019-09-26Rename `subst::Kind` to `subst::GenericArg`varkor-139/+149
2019-09-26Auto merge of #62661 - arielb1:never-reserve, r=nikomatsakisbors-11/+40
reserve `impl<T> From<!> for T` this is necessary for never-type stabilization. cc #57012 #35121 I think we wanted a crater run for this @nikomatsakis? r? @nikomatsakis
2019-09-26Auto merge of #64513 - varkor:sty-begone, r=eddybbors-135/+135
Rename `TyS.sty` to `TyS.kind` Fixes https://github.com/rust-lang/rust/issues/64353. r? @eddyb
2019-09-25Remove tx_to_llvm_workers from TyCtxtMark Rousskov-11/+0
This can be kept within the codegen backend crates entirely
2019-09-25Fix rebasevarkor-2/+2
2019-09-25Rename surviving uses of `sty`varkor-6/+6
2019-09-25Rename `sty` to `kind`varkor-129/+129
2019-09-25Snap cfgs to new betaMark Rousskov-3/+3
2019-09-25Rollup merge of #64746 - estebank:elide-impl-trait-obligations-on-err, ↵Mazdak Farrokhzad-3/+3
r=cramertj Remove blanket silencing of "type annotation needed" errors Remove blanket check for existence of other errors before emitting "type annotation needed" errors, and add some eager checks to avoid adding obligations when they refer to types that reference `[type error]` in order to reduce unneeded errors. Fix #64084.
2019-09-25Rollup merge of #64599 - csmoe:doc_async_reexport, r=nikomatsakisMazdak Farrokhzad-0/+17
Rustdoc render async function re-export Closes #63710 r? @nikomatsakis
2019-09-24Remove blanket silencing of "type annotation needed" errorsEsteban Küber-3/+3
Remove blanket check for existence of other errors before emitting "type annotation needed" errors, and add some eager checks to avoid adding obligations when they refer to types that reference `[type error]` in order to reduce unneded errors.
2019-09-24cite reservation impls tracking issueNiko Matsakis-0/+3
2019-09-24improve commentsAriel Ben-Yehuda-1/+1
2019-09-24resolve the rustc_reservation_impl attribute in 1 placeAriel Ben-Yehuda-14/+32
2019-09-24reserve `impl<T> From<!> for T`Ariel Ben-Yehuda-10/+18
this is necessary for never-type stabilization
2019-09-24bug-out asyncness query on non-local funtionscsmoe-10/+11
2019-09-23rustc: Fix mixing crates with different `share_generics`Alex Crichton-2/+2
This commit addresses #64319 by removing the `dylib` crate type from the list of crate type that exports generic symbols. The bug in #64319 arises because a `dylib` crate type was trying to export a symbol in an uptream crate but it miscalculated the symbol name of the uptream symbol. This isn't really necessary, though, since `dylib` crates aren't that heavily used, so we can just conservatively say that the `dylib` crate type never exports generic symbols, forcibly removing them from the exported symbol lists if were to otherwise find them. The fix here happens in two places: * First is in the `local_crate_exports_generics` method, indicating that it's now `false` for the `Dylib` crate type. Only rlibs actually export generics at this point. * Next is when we load exported symbols from upstream crate. If, for our compilation session, the crate may be included from a dynamic library, then its generic symbols are removed. When the crate was linked into a dynamic library its symbols weren't exported, so we can't consider them a candidate to link against. Overally this should avoid situations where we incorrectly calculate the upstream symbol names in the face of differnet `share_generics` options, ultimately... Closes #64319
2019-09-23Auto merge of #64272 - Mark-Simulacrum:parallel-handler, r=estebankbors-4/+3
Refactor librustc_errors::Handler API This should be reviewed by-commit. The last commit moves all fields into an inner struct behind a single lock; this is done to prevent possible deadlocks in a multi-threaded compiler, as well as inconsistent state observation.
2019-09-22On obligation errors point at the unfulfilled binding when possibleEsteban Küber-0/+4
2019-09-21Rollup merge of #63907 - estebank:assoc-type-mismatch, r=oli-obkMazdak Farrokhzad-4/+92
Add explanation to type mismatch involving type params and assoc types CC #63711