about summary refs log tree commit diff
path: root/src/librustc_passes
AgeCommit message (Collapse)AuthorLines
2020-04-27Change return type of `entry_fn` query to return a `LocalDefId`marmeladema-9/+11
2020-04-27Use `LocalDefId` in `typeck_tables_of` and `used_trait_imports` queriesmarmeladema-4/+4
2020-04-26Rollup merge of #70043 - mark-i-m:def-kind-more, r=eddybDylan DPC-36/+20
Add all remaining `DefKind`s. r? @eddyb or @Centril ~~I'm not sure if this is what you were thinking of. There are also a few places where I'm not sure what the correct choice is because I don't fully understand the meaning of some variants.~~ ~~In general, it feels a bit odd to add some of these as `DefKind`s (e.g. `Arm`) because they don't feel like definitions. Are there things that it makes sense not to add?~~
2020-04-24Avoid unused Option::map resultsJosh Stone-1/+3
These are changes that would be needed if we add `#[must_use]` to `Option::map`, per #71484.
2020-04-24fix a couple more uses of def_kindmark-2/+2
2020-04-24Remove redundant `descr`/`descriptive_variant` methods from HIR.Eduard-Mihai Burtescu-36/+20
2020-04-23Address comments from reviewmarmeladema-3/+2
2020-04-23Modify `as_local_hir_id` to return a bare `HirId`marmeladema-23/+15
2020-04-23Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`marmeladema-15/+24
2020-04-23librustc_middle: return LocalDefId instead of DefId in local_def_idmarmeladema-14/+14
2020-04-20Remove unused dependenciesShotaro Yamada-2/+0
2020-04-19Auto merge of #71331 - Dylan-DPC:rollup-5rn1isc, r=Dylan-DPCbors-1/+3
Rollup of 4 pull requests Successful merges: - #71026 (Fix false "never constructed" warnings for `Self::` variant paths) - #71310 (Do not show DefId in diagnostics) - #71317 (miri-unleash test for llvm_asm) - #71324 (Fix some tests failing in `--pass check` mode) Failed merges: r? @ghost
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-19/+21
2020-04-19Fix false "never constructed" warnings for `Self::` variant pathsseiya-1/+3
2020-04-17Rollup merge of #69642 - ecstatic-morse:issue-69615, r=oli-obkDylan DPC-7/+7
Use query to determine whether function needs const checking Resolves #69615. The HIR const-checker was checking the `constness` of a function's `fn_sig` to determine whether a function needed const-checking. Now that const trait impls are a thing, this is no longer enough. All code should use the `is_const_fn_raw` query instead, which takes the constness of the impl block into account. r? @oli-obk
2020-04-16rustc: fix check_attr() for methods, closures and foreign functionsMatthias Schiffer-1/+4
UI tests are updated with additional error messages that were missing before.
2020-04-16don't clone types that are copy (clippy::clone_on_copy)Matthias Krüger-1/+1
2020-04-14Remove `DUMMY_HIR_ID`marmeladema-10/+0
2020-04-12Rollup merge of #71069 - marmeladema:dummy-hir-id-obligation-clause, r=eddybDylan DPC-11/+10
Remove some usage of `DUMMY_HIR_ID` Use `ObligationClause::dummy()` when appropriate or replace `hir::DUMMY_HIR_ID`by `hir::CRATE_HIR_ID`, as used in `ObligationClause::dummy()`.
2020-04-12Rollup merge of #67766 - sapir:fix-unused-in-or-pattern-warning, r=matthewjasperDylan DPC-26/+49
Fix warning for unused variables in or pattern (issue #67691) Is this a good way to fix it? Also, the tests fail, the "fixed" code output says `{ i, j }` instead of `{ i, j: _ }`, how can I fix that?
2020-04-12Remove usage of `DUMMY_HIR_ID` in `CheckAttrVisitor::check_inline`marmeladema-3/+2
2020-04-12Remove usage of `DUMMY_HIR_ID` in `CheckLoopVisitor`marmeladema-8/+8
2020-04-11Auto merge of #70161 - cjgillot:query-arena, r=nikomatsakisbors-3/+2
Allocate some query results on an arena This avoids a cloning few `Lrc` and `Vec`s in the queries.
2020-04-10librustc_middle: return LocalDefId instead of DefId in get_parent_didmarmeladema-4/+4
2020-04-10librustc_middle: return LocalDefId instead of DefId in body_owner_def_idmarmeladema-2/+2
2020-04-10Replace non-shorthand variables with _, not _varsapir-8/+12
2020-04-10Try to fix warning for unused variables in or patterns, issue #67691sapir-26/+45
2020-04-09Use `is_const_fn_raw` query for HIR const-checkingDylan MacKenzie-7/+7
2020-04-09Rollup merge of #70916 - Centril:track-caller-ffi, r=eddybMazdak Farrokhzad-12/+2
Support `#[track_caller]` on functions in `extern "Rust" { ... }` Fixes https://github.com/rust-lang/rust/issues/70830 which is the follow-up to @eddyb's suggestion in https://github.com/rust-lang/rust/pull/69251#discussion_r380791634 to allow `#[track_caller]` on `fn`s in FFI imports, that is, on functions in `extern "Rust" { ... }` blocks. This requires that the other side, the FFI export, also have the `#[track_caller]` attribute. Otherwise, undefined behavior is triggered and the blame lies, as usual, with the `unsafe { ... }` block which called the FFI imported function. After this PR, all forms of `fn` items with the right ABI (`"Rust"`) support `#[track_caller]`. As a drive-by, the PR also hardens the check rejecting `#[naked] #[track_caller]` such that methods and other forms of `fn` items are also considered. r? @eddyb cc @rust-lang/lang
2020-04-09Rollup merge of #70367 - nikomatsakis:issue-69307, r=Aaron1011Mazdak Farrokhzad-0/+9
save/restore `pessimistic_yield` when entering bodies This flag is used to make the execution order around `+=` operators pessimistic. Failure to save/restore the flag was causing independent async blocks to effect one another, leading to strange ICEs and failed assumptions. Fixes #69307 r? @Zoxc
2020-04-09track_caller: support on FFI importsMazdak Farrokhzad-11/+1
2020-04-08comment pessimistic yield and saving/restoring stateNiko Matsakis-0/+7
2020-04-08track_caller: harden naked interactionsMazdak Farrokhzad-1/+1
2020-04-06tweak rustc_layout debug outputRalf Jung-1/+1
2020-04-05Rollup merge of #70815 - RalfJung:layout-debug, r=jonas-schievinkDylan DPC-2/+3
Enable layout debugging for `impl Trait` type aliases I also made it print the actual type name that the alias picks under the hood.
2020-04-05also print type typeRalf Jung-1/+1
2020-04-05also print rustc_layout on impl trait type aliasesRalf Jung-1/+2
2020-04-05Remove unneeded Lrc in query results.Camille GILLOT-3/+2
2020-04-05Stop importing int/float modules in librustc_*Linus Färnstrand-1/+1
2020-04-03Minor follow-up after renaming librustc(_middle)Yuki Okushi-3/+3
2020-04-02direct imports for langitem stuffMazdak Farrokhzad-1/+1
2020-04-02nix rustc_target::abi::* reexport in ty::layoutMazdak Farrokhzad-10/+5
2020-03-30Use if let instead of match when only matching a single variant ↵Matthias Krüger-6/+3
(clippy::single_match) Makes code more compact and reduces nestig.
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-46/+46
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-63/+63
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-2/+2
2020-03-27Rename TyLayout to TyAndLayout.Ana-Maria Mihalache-3/+3
2020-03-27Auto merge of #68404 - Amanieu:llvm-asm, r=estebankbors-3/+3
Rename asm! to llvm_asm! As per https://github.com/rust-lang/rfcs/pull/2843, this PR renames `asm!` to `llvm_asm!`. It also renames the compiler's internal `InlineAsm` data structures to `LlvmInlineAsm` in preparation for the new `asm!` functionality specified in https://github.com/rust-lang/rfcs/pull/2850. This PR doesn't actually deprecate `asm!` yet, it just makes it redirect to `llvm_asm!`. This is necessary because we first need to update the submodules (in particular stdarch) to use `llvm_asm!`.
2020-03-27Rollup merge of #70344 - Centril:hir-pretty, r=eddybDylan DPC-14/+4
Decouple `rustc_hir::print` into `rustc_hir_pretty` High level summary: - The HIR pretty printer, `rustc_hir::print` is moved into a new crate `rustc_hir_pretty`. - `rustc_ast_pretty` and `rustc_errors` are dropped as `rustc_hir` dependencies. - The dependence on HIR pretty is generally reduced, leaving `rustc_save_analysis`, `rustdoc`, `rustc_metadata`, and `rustc_driver` as the remaining clients. The main goal here is to reduce `rustc_hir`'s dependencies and its size such that it can start and finish earlier, thereby working towards https://github.com/rust-lang/rust/issues/65031. r? @Zoxc
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-3/+3
asm! is left as a wrapper around llvm_asm! to maintain compatibility.