about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2019-10-07Add feature gate for raw_dylib.Charles Lew-0/+2
2019-10-04middle::intrinsicck -> rustc_passesMark Rousskov-170/+0
2019-10-04middle::entry -> rustc_passesMark Rousskov-202/+0
2019-10-04middle::dead -> rustc_passesMark Rousskov-676/+0
2019-10-04move middle::liveness to rustc_passesMark Rousskov-1568/+0
2019-10-04Rollup merge of #65026 - petrochenkov:ice1, r=eddybMazdak Farrokhzad-3/+1
metadata: Some crate loading cleanup So, my goal was to fix caching of loaded crates which is broken and causes ICEs like #56935 or #64450. While investigating I found that the code is pretty messy and likes to confuse various things that look similar but are actually different. This PR does some initial cleanup in that area, I hope to get to the caching itself a bit later.
2019-10-04Rollup merge of #64874 - matthewjasper:simplify-euv, r=eddybMazdak Farrokhzad-449/+90
Simplify ExprUseVisitor * Remove HIR const qualification * Remove parts of ExprUseVisitor that aren't being used r? @eddyb
2019-10-04Rollup merge of #64817 - csmoe:closure, r=nikomatsakisMazdak Farrokhzad-4/+6
Replace ClosureSubsts with SubstsRef Addresses https://github.com/rust-lang/rust/issues/42340 part 3 https://github.com/rust-lang/rust/pull/59312 might benefit from this clean up. r? @nikomatsakis
2019-10-04metadata: Simplify interface of `resolve_crate`Vadim Petrochenkov-3/+1
2019-10-03generate ClosureSubsts from SubstsRefcsmoe-5/+6
2019-09-30Remove unused parts of ExprUseVisitorMatthew Jasper-380/+78
2019-09-30Remove HIR based const qualificationMatthew Jasper-69/+12
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-3/+3
2019-09-29remove ClosureSubsts with SubstsRefcsmoe-1/+2
2019-09-29introduce from_ref helper for replacementcsmoe-1/+1
2019-09-29Rollup merge of #64824 - Mark-Simulacrum:no-stable-hasher-result-everywhere, ↵Mazdak Farrokhzad-9/+4
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 #63492 - eddyb:cvarargs, r=nagisa,matthewjasperMazdak Farrokhzad-8/+0
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 #64763 - GuillaumeGomez:long-err-explanation-E0734, r=estebankMazdak Farrokhzad-2/+6
Add E0734 and its long explanation Part of https://github.com/rust-lang/rust/issues/61137
2019-09-28Rollup merge of #64678 - tomtau:fix/no-std-error, r=matthewjasperMazdak Farrokhzad-6/+37
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-9/+4
2019-09-28rustc: don't store a lifetime in hir::TyKind::CVarArgs.Eduard-Mihai Burtescu-8/+0
2019-09-28Rollup merge of #64781 - Mark-Simulacrum:no-global-tcx, r=eddybMazdak Farrokhzad-2/+2
Remove stray references to the old global tcx
2019-09-27cleanup dead ast-borrowck / migrate-mode code.Mazdak Farrokhzad-31/+0
2019-09-27Remove global_tcx from TyCtxtMark Rousskov-2/+2
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-6/+37
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-26Rename `MetaItem.node` to `MetaItem.kind`varkor-1/+1
2019-09-26Rename `ForeignItem.node` to `ForeignItem.kind`varkor-3/+3
2019-09-26Rename `Item.node` to `Item.kind`varkor-30/+29
2019-09-26Rename `Stmt.node` to `Stmt.kind`varkor-3/+3
2019-09-26Rename `Ty.node` to `Ty.kind`varkor-12/+12
2019-09-26Rename `TraitItem.node` to `TraitItem.kind`varkor-7/+7
2019-09-26Rename `ImplItem.node` to `ImplItem.kind`varkor-8/+8
2019-09-26Rename `Pat.node` to `Pat.kind`varkor-12/+12
2019-09-26Rename `Expr.node` to `Expr.kind`varkor-18/+18
For both `ast::Expr` and `hir::Expr`.
2019-09-26Auto merge of #64513 - varkor:sty-begone, r=eddybbors-15/+15
Rename `TyS.sty` to `TyS.kind` Fixes https://github.com/rust-lang/rust/issues/64353. r? @eddyb
2019-09-25Rename `sty` to `kind`varkor-15/+15
2019-09-25Rollup merge of #64508 - Centril:or-pat-hir, r=matthewjasperMazdak Farrokhzad-213/+134
or-patterns: Push `PatKind/PatternKind::Or` at top level to HIR & HAIR Following up on work in https://github.com/rust-lang/rust/pull/64111, https://github.com/rust-lang/rust/pull/63693, and https://github.com/rust-lang/rust/pull/61708, in this PR: - We change `hair::Arm.patterns: Vec<Pattern<'_>>` into `hir::Arm.pattern: Pattern<'_>`. - `fn hair::Arm::top_pats_hack` is introduced as a temporary crutch in MIR building to avoid more changes. - We change `hir::Arm.pats: HirVec<P<Pat>>` into `hir::Arm.pat: P<Pat>`. - The hacks in `rustc::hir::lowering` are removed since the representation hack is no longer necessary. - In some places, `fn hir::Arm::top_pats_hack` is introduced to leave some things as future work. - Misc changes: HIR pretty printing is adjusted to behave uniformly wrt. top/inner levels, rvalue promotion is adjusted, regionck, and dead_code is also. - Type checking is adjusted to uniformly handle or-patterns at top/inner levels. To make things compile, `p_0 | ... | p_n` is redefined as a "reference pattern" in [`fn is_non_ref_pat`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/struct.FnCtxt.html#method.is_non_ref_pat) for now. This is done so that reference types are not eagerly stripped from the `expected: Ty<'tcx>`. - Liveness is adjusted wrt. the `unused_variables` and `unused_assignments` lints to handle top/inner levels uniformly and the handling of `fn` parameters, `let` locals, and `match` arms are unified in this respect. This is not tested for now as exhaustiveness checks are reachable and will ICE. - In `check_match`, checking `@` and by-move bindings is adjusted. However, exhaustiveness checking is not adjusted the moment and is handled by @dlrobertson in https://github.com/rust-lang/rust/pull/63688. - AST borrowck (`construct.rs`) is not adjusted as AST borrowck will be removed soon. r? @matthewjasper cc @dlrobertson @varkor @oli-obk
2019-09-25Create new error code E0734 for stability attributes used outside of ↵Guillaume Gomez-2/+6
standard library
2019-09-23rustc: Convert `dependency_formats` to a queryAlex Crichton-372/+6
This commit converts a field of `Session`, `dependency_formats`, into a query of `TyCtxt`. This information then also needed to be threaded through to other remaining portions of the linker, but it's relatively straightforward. The only change here is that instead of `HashMap<CrateType, T>` the data structure changed to `Vec<(CrateType, T)>` to make it easier to deal with in queries.
2019-09-21Rollup merge of #64342 - glorv:master, r=varkorMazdak Farrokhzad-2/+2
factor out pluralisation remains after #64280 there are two case that doesn't not match the original macro pattern at [here](https://github.com/rust-lang/rust/blob/master/src/librustc_lint/unused.rs#L146) and [here](https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/diagnostics.rs#L539) as the provided param is already a bool or the check condition is not `x != 1`, so I change the macro accept a boolean expr instead of number to fit all the cases. @Centril please review Fixes #64238.
2019-09-21or-patterns: middle/dead: remove `top_pats_hack`.Mazdak Farrokhzad-14/+7
Also tweak walkers on `Pat`.
2019-09-20factor out pluralisation remains after #64280gaolei-2/+2
2019-09-18Fix backticks in documentationJoshua Groves-1/+1
2019-09-16or-patterns: liveness: `is_argument` -> `is_param`.Mazdak Farrokhzad-2/+2
Pacify `tidy`. It's also more correct in this context.
2019-09-16or-patterns: middle/dead: make a hack less hacky.Mazdak Farrokhzad-2/+2
2019-09-16or-patterns: euv/`walk_arm`: remove `top_pats_hack`.Mazdak Farrokhzad-3/+1
2019-09-16or-patterns: euv/`arm_move_mode`: remove `top_pats_hack`.Mazdak Farrokhzad-3/+1
2019-09-16or-patterns: liveness: generalize + remove `top_pats_hack`.Mazdak Farrokhzad-175/+113
2019-09-16or-patterns: liveness/`visit_arm`: remove `top_pats_hack`.Mazdak Farrokhzad-18/+11
2019-09-15or-patterns: use `top_pats_hack` to make things compile.Mazdak Farrokhzad-7/+8