about summary refs log tree commit diff
path: root/src/librustc_middle
AgeCommit message (Collapse)AuthorLines
2020-07-01Rollup merge of #73449 - ehuss:duplicate-lang-item, r=matthewjasperManish Goregaokar-0/+5
Provide more information on duplicate lang item error. This gives some notes on the location of the files where the lang items were loaded from. Some duplicate lang item errors can be a little confusing, and this might help in diagnosing what has happened. Here's an example when hitting a bug with Cargo's build-std: ``` error: duplicate lang item in crate `core` (which `rustc_std_workspace_core` depends on): `try`. | = note: the lang item is first defined in crate `core` (which `z10` depends on) = note: first definition in `core` loaded from /Users/eric/Proj/rust/cargo/scratch/z10/target/target/debug/deps/libcore-a764da499c7385f4.rmeta = note: second definition in `core` loaded from /Users/eric/Proj/rust/cargo/scratch/z10/target/target/debug/deps/libcore-5b082675aea34986.rmeta ```
2020-07-01Review fixDan Aloni-1/+1
2020-07-01Insert NoDelim groups around nonterminals when lowering macro_rulesAaron Hill-0/+1
2020-07-01Rollup merge of #73776 - aszenz:refactor_mir_module, r=wesleywiserManish Goregaokar-492/+509
Move terminator to new module Moves terminator types from `librustc_middle/mir/mod.rs` into submodule Fixes #73723
2020-07-01Rollup merge of #73705 - lcnr:skip_binder, r=nikomatsakisManish Goregaokar-176/+116
stop taking references in Relate Adds a `Copy` bound to `Relate` and changes the type signatures to `T` from `&T`. While the `Copy` bound is not strictly necessary (i.e. the `Clone` bound of `TypeRelation` would be good enough), we don't need non `Copy` types and it simplifies the implementation. Removes the afaict unused impls for `Vec<ty::PolyExistentialProjection<'tcx>>`, `Rc<T>` and `Box<T>`. If they end up being relevant again the bound of `Relate` can be reduced to `T: Clone`. This also changes signature of `Binder::skip_binder` to `fn skip_binder(self) -> T`. `TypeError::ProjectionBoundsLength` was never used and is also removed in this PR. r? @nikomatsakis maybe :thinking: feel free to reassign
2020-06-30Stabilize `#[track_caller]`.Adam Perry-1/+1
Does not yet make its constness stable, though. Use of `Location::caller` in const contexts is still gated by `#![feature(const_caller_location)]`.
2020-07-01Add missing backtick in `ty_error_with_message`Yuki Okushi-1/+1
2020-06-30Switch crate_extern_paths to a query, and tweak wording.Eric Huss-10/+5
2020-06-30Provide more information on duplicate lang item error.Eric Huss-0/+10
2020-06-30Stabilize casts and coercions to `&[T]` in const fnOliver Scherer-1/+1
2020-06-30remove unused `TypeError::ProjectionBoundsLength`Bastian Kauschke-10/+0
2020-06-30change `skip_binder` to use T by valueBastian Kauschke-27/+23
2020-06-30stop taking references in RelateBastian Kauschke-141/+95
2020-06-29Fix try_print_visible_def_path for Rust 2018Dan Aloni-17/+18
The recursive check of `try_print_visible_def_path` did not properly handle the Rust 2018 case of crate-paths without 'extern crate'. Instead, it returned a "not found" via (false, self). This fixes issue #56175.
2020-06-29add spans to injected coverage countersRich Kadel-17/+55
added regions with counter expressions and counters. Added codegen_llvm/coverageinfo mod for upcoming coverage map Move coverage region collection to CodegenCx finalization Moved from `query coverageinfo` (renamed from `query coverage_data`), as discussed in the PR at: https://github.com/rust-lang/rust/pull/73684#issuecomment-649882503 Address merge conflict in MIR instrument_coverage test The MIR test output format changed for int types. moved debug messages out of block.rs This makes the block.rs calls to add coverage mapping data to the CodegenCx much more concise and readable. move coverage intrinsic handling into llvm impl I realized that having half of the coverage intrinsic handling in `rustc_codegen_ssa` and half in `rustc_codegen_llvm` meant that any non-llvm backend would be bound to the same decisions about how the coverage-related MIR terminators should be handled. To fix this, I moved the non-codegen portion of coverage intrinsic handling into its own trait, and implemented it in `rustc_codegen_llvm` alongside `codegen_intrinsic_call`. I also added the (required?) stubs for the new intrinsics to `IntrepretCx::emulate_intrinsic()`, to ensure calls to this function do not fail if called with these new but known intrinsics. address PR Feedback on 28 June 2020 2:48pm PDT
2020-06-28Auto merge of #72437 - ecstatic-morse:stabilize-const-if-match, r=oli-obkbors-14/+1
Stabilize `#![feature(const_if_match)]` Quoting from the [stabilization report](https://github.com/rust-lang/rust/issues/49146#issuecomment-616301045): > `if` and `match` expressions as well as the short-circuiting logic operators `&&` and `||` will become legal in all [const contexts](https://doc.rust-lang.org/reference/const_eval.html#const-context). A const context is any of the following: > > - The initializer of a `const`, `static`, `static mut` or enum discriminant. > - The body of a `const fn`. > - The value of a const generic (nightly only). > - The length of an array type (`[u8; 3]`) or an array repeat expression (`[0u8; 3]`). > > Furthermore, the short-circuiting logic operators will no longer be lowered to their bitwise equivalents (`&` and `|` respectively) in `const` and `static` initializers (see #57175). As a result, `let` bindings can be used alongside short-circuiting logic in those initializers. Resolves #49146. Ideally, we would resolve :whale: #66753 before this lands on stable, so it might be worth pushing this back a release. Also, this means we should get the process started for #52000, otherwise people will have no recourse except recursion for iterative `const fn`. r? @oli-obk
2020-06-28Remove `ignore-tidy-filelength`Dylan MacKenzie-2/+0
2020-06-28Remove `const_if_match` feature gate from librariesDylan MacKenzie-1/+1
2020-06-28Remove `control_flow_destroyed` and properly lower `&&` and `||`Dylan MacKenzie-11/+0
2020-06-28Rollup merge of #73833 - bjorn3:remove_gcx_enter_local, r=matthewjasperManish Goregaokar-27/+5
Remove GlobalCtxt::enter_local
2020-06-28Remove GlobalCtxt::enter_localbjorn3-27/+5
2020-06-27Rollup merge of #73796 - lcnr:LocalDefId, r=matthewjasperManish Goregaokar-27/+34
replace more `DefId`s with `LocalDefId` part of https://github.com/rust-lang/rust/issues/70853
2020-06-27Rollup merge of #73708 - Aaron1011:feature/reland-move-fn-self-msg, r=davidtwcoManish Goregaokar-7/+26
Explain move errors that occur due to method calls involving `self` (take two) This is a re-attempt of #72389 (which was reverted in #73594) Instead of using `ExpnKind::Desugaring` to represent operators, this PR checks the lang item directly.
2020-06-27more LocalDefId cleanupBastian Kauschke-8/+12
2020-06-27more LocalDefId in ty::contextBastian Kauschke-4/+7
2020-06-27use LocalDefId in module checkingBastian Kauschke-15/+15
2020-06-26Rollup merge of #73485 - estebank:dedup-preds, r=nikomatsakisManish Goregaokar-3/+13
Perform obligation deduplication to avoid buggy `ExistentialMismatch` Address #59326.
2020-06-26Explain move errors that occur due to method calls involving `self`Aaron Hill-1/+1
This is a re-attempt of #72389 (which was reverted in #73594) Instead of using `ExpnKind::Desugaring` to represent operators, this PR checks the lang item directly.
2020-06-26Make `fn_arg_names` return `Ident` instead of symbolAaron Hill-6/+25
Also, implement this query for the local crate, not just foreign crates.
2020-06-26removes unnecessary tidy ignoreroot-12/+2
2020-06-26moves terminator types to sub moduleroot-494/+519
2020-06-26Auto merge of #73513 - oli-obk:const_binop_overflow, r=estebankbors-60/+227
Show the values and computation that would overflow a const evaluation or propagation Fixes #71134 In contrast to the example in the issue it doesn't use individual spans for each operand. The effort required to implement that is quite high compared to the little (if at all) benefit it would bring to diagnostics. cc @shepmaster The way this is implemented it is also fairly easy to do the same for overflow panics at runtime, but that should be done in a separate PR since it may have runtime performance implications.
2020-06-26Show the values and computation that would overflow a const evaluation or ↵Oliver Scherer-60/+227
propagation
2020-06-26Rollup merge of #73748 - jyn514:doc-fix, r=ManishearthManish Goregaokar-0/+2
Add code block to code in documentation of `List::rebase_onto` Closes https://github.com/rust-lang/rust/issues/73676 @bors rollup=always
2020-06-26Rollup merge of #73681 - jackh726:chalk-0.14, r=nikomatsakisManish Goregaokar-1/+3
Update Chalk to 0.14 Not a ton here. Notable changes: - Update to `0.14.0` - New dependency on `tracing`, in `librustc_traits` only - `FnAbi` from Chalk is `rustc_target::spec::abi::Abi` - `Dynamic` actually lowers region - Actually lower closures, with some tests. This doesn't 100% work, but can't confirm that's *only* because of closure lowering. - Use `FxIndexSet` instead of `FxHashSet` in `chalk_fulfill`, which seems to have fixed the non-deterministic test error ordering. Guess we'll see on CI - Actually implement `opaque_ty_data`, though I don't think this is sufficient for tests for them (I haven't added any) - Uncomment some of the chalk tests that now work r? @nikomatsakis
2020-06-25Add code block to code in documentation of `List::rebase_onto`Joshua Nelson-0/+2
2020-06-24Improve GeneratorLayout debug outputTyler Mandry-2/+59
2020-06-24Allow calling GeneratorSubsts::variant_name() without substsTyler Mandry-1/+1
2020-06-24Emit line info for generator variantsTyler Mandry-0/+4
2020-06-24Update ChalkJack Huey-1/+3
2020-06-23Rollup merge of #73488 - richkadel:llvm-coverage-map-gen, r=tmandryManish Goregaokar-5/+62
code coverage foundation for hash and num_counters This PR is the next iteration after PR #73011 (which is still waiting on bors to merge). @wesleywiser - PTAL r? @tmandry (FYI, I'm also working on injecting the coverage maps, in another branch, while waiting for these to merge.) Thanks!
2020-06-23Auto merge of #73643 - Manishearth:rollup-68dr8fz, r=Manishearthbors-36/+28
Rollup of 9 pull requests Successful merges: - #72271 (Improve compiler error message for wrong generic parameter order) - #72493 ( move leak-check to during coherence, candidate eval) - #73398 (A way forward for pointer equality in const eval) - #73472 (Clean up E0689 explanation) - #73496 (Account for multiple impl/dyn Trait in return type when suggesting `'_`) - #73515 (Add second message for LiveDrop errors) - #73567 (Clarify --extern documentation.) - #73572 (Fix typos in doc comments) - #73590 (bootstrap: no `config.toml` exists regression) Failed merges: r? @ghost
2020-06-23Rollup merge of #73496 - estebank:opaque-missing-lts-in-fn-3, r=nikomatsakisManish Goregaokar-36/+28
Account for multiple impl/dyn Trait in return type when suggesting `'_` Make `impl` and `dyn` Trait lifetime suggestions a bit more resilient. Follow up to #72804. r? @nikomatsakis
2020-06-22PR no longer requires u32 impl TypeFoldableRich Kadel-1/+0
2020-06-22moves coverage data computation from pass to queryRich Kadel-20/+16
2020-06-23Rollup merge of #73586 - RalfJung:switch-ty, r=oli-obkDylan DPC-0/+2
switch_ty is redundant This field is redundant, but we cannot remove it currently as pretty-printing relies on it (and it does not have access to `mir::Body` to compute the type itself). Cc @oli-obk @matthewjasper @jonas-schievink
2020-06-23Rollup merge of #73578 - RalfJung:ty-ctxt-at, r=jonas-schievinkDylan DPC-11/+5
Make is_freeze and is_copy_modulo_regions take TyCtxtAt Make is_freeze and is_copy_modulo_regions take TyCtxtAt instead of separately taking TyCtxt and Span. This is consistent with is_sized.
2020-06-22review commentsEsteban Küber-1/+2
2020-06-22Address remaining feedback itemsRich Kadel-2/+2
2020-06-22implemented query for coverage dataRich Kadel-0/+6
This commit adds a query that allows the CoverageData to be pulled from a call on tcx, avoiding the need to change the `codegen_intrinsic_call()` signature (no need to pass in the FunctionCx or any additional arguments. The commit does not change where/when the CoverageData is computed. It's still done in the `pass`, and saved in the MIR `Body`. See discussion (in progress) here: https://github.com/rust-lang/rust/pull/73488#discussion_r443825646