about summary refs log tree commit diff
path: root/tests/ui-fulldeps
AgeCommit message (Collapse)AuthorLines
2023-12-22Auto merge of #119097 - nnethercote:fix-EmissionGuarantee, r=compiler-errorsbors-11/+11
Fix `EmissionGuarantee` There are some problems with the `DiagCtxt` API related to `EmissionGuarantee`. This PR fixes them. r? `@compiler-errors`
2023-12-20Add `ItemKind::Ctor` to stable mirCelina G. Val-2/+8
2023-12-20Add a small test for the case that was crashingCelina G. Val-0/+78
2023-12-19Fix c_variadic flag and add opaque info to PassModeCelina G. Val-4/+30
We should expand the information in PassMode later.
2023-12-19Add `level` arg to `into_diagnostic`.Nicholas Nethercote-11/+11
And make all hand-written `IntoDiagnostic` impls generic, by using `DiagnosticBuilder::new(dcx, level, ...)` instead of e.g. `dcx.struct_err(...)`. This means the `create_*` functions are the source of the error level. This change will let us remove `struct_diagnostic`. Note: `#[rustc_lint_diagnostics]` is added to `DiagnosticBuilder::new`, it's necessary to pass diagnostics tests now that it's used in `into_diagnostic` functions.
2023-12-18Add function ABI and type layout to StableMIRCelina G. Val-4/+120
This change introduces a new module to StableMIR named `abi` with information from `rustc_target::abi` and `rustc_abi`, that allow users to retrieve more low level information required to perform bit-precise analysis. The layout of a type can be retrieved via `Ty::layout`, and the instance ABI can be retrieved via `Instance::fn_abi()`. To properly handle errors while retrieve layout information, we had to implement a few layout related traits.
2023-12-18Fix up some `ui-fulldeps` tests.Nicholas Nethercote-22/+22
2023-12-15Add a method to check if type is a CStrCelina G. Val-0/+22
2023-12-14Address PR commentsCelina G. Val-1/+1
- Remove `fn_sig()` from Instance. - Change return value of `AssertMessage::description` to `Cow<>`. - Add assert to instance `ty()`. - Generalize uint / int type creation.
2023-12-10remove redundant importssurechen-1/+1
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-12-08Rollup merge of #118694 - celinval:smir-alloc-methods, r=ouz-aMatthias Krüger-5/+139
Add instance evaluation and methods to read an allocation in StableMIR The instance evaluation is needed to handle intrinsics such as `type_id` and `type_name`. Since we now use Allocation to represent all evaluated constants, provide a few methods to help process the data inside an allocation. I've also started to add a structured way to get information about the compilation target machine. For now, I've only added information needed to process an allocation. r? ``````@ouz-a``````
2023-12-08coro_kind -> coroutine_kindMichael Goulet-1/+1
2023-12-07Add a test to evaluate type intrinsic.Celina G. Val-3/+36
2023-12-07Add tests to allocation methods and fix is_null()Celina G. Val-5/+90
2023-12-07Fix conversion to StaticDef and add testCelina G. Val-0/+16
2023-12-06Rollup merge of #118681 - celinval:fix-foreign-item, r=ouz-aMatthias Krüger-2/+6
Fix is_foreign_item for StableMIR instance Change the implementation of `Instance::is_foreign_item` to directly query the compiler for the instance `def_id` instead of incorrectly relying on the conversion to `CrateItem`. I also added a method to check if the instance has body, since the function already existed and it just wasn't exposed via public APIs. This makes it much cheaper for the user to check if the instance has body. ## Background: - In pull https://github.com/rust-lang/rust/pull/118524, I fixed the conversion from Instance to CrateItem to avoid the conversion if the instance didn't have a body available. This broke the `is_foreign_item`. r? `@ouz-a`
2023-12-06Also add an API to check if an instance has bodyCelina G. Val-3/+6
This is much cheaper than building a body just for the purpose of checking if the body exists.
2023-12-06Fix `is_foreign_item` for StableMIR instanceCelina G. Val-1/+2
Change the implementation of `Instance::is_foreign_item` to directly query the compiler for the instance `def_id` instead of incorrectly relying on the conversion to `CrateItem`. Background: - In pull https://github.com/rust-lang/rust/pull/118524, I fixed the conversion from Instance to CrateItem to avoid the conversion if the instance didn't have a body available. This broke the `is_foreign_item`.
2023-12-06Rollup merge of #118516 - celinval:smir-variants, r=ouz-aMatthias Krüger-0/+115
Add ADT variant infomation to StableMIR and finish implementing TyKind::internal() Introduce a `VariantDef` type and a mechanism to retrieve the definition from an `AdtDef`. The `VariantDef` representation itself is just a combination of `AdtDef` and `VariantIdx`, which allow us to retrieve further information of a variant. I don't think we need to cache extra information for now, and we can translate on an on demand manner. I am leaving the fields public today due to https://github.com/rust-lang/project-stable-mir/issues/56, but they shouldn't. For this PR, I've only added a method to retrieve the variant name, and its fields. I also added an implementation of `RustcInternal` that allow users to retrieve more information using Rust internal APIs. I have also finished the implementation of `RustcInternal` for `TyKind` which fixes https://github.com/rust-lang/project-stable-mir/issues/46. ## Motivation Both of these changes are needed in order to properly interpret things like projections. For example, - The variant definition is used to find out which variant we are downcasting to. - Being able to create `Ty` from `TyKind` helps for example processing each stage of a projection, like the code in `place.ty()`.
2023-12-05Change ty_with_args to return Ty instead of ResultCelina G. Val-0/+115
Although, we would like to avoid crashes whenever possible, and that's why I wanted to make this API fallible. It's looking pretty hard to do proper validation. I think many of our APIs will unfortunately depend on the user doing the correct thing since at the MIR level we are working on, we expect types to have been checked already.
2023-12-04Fix some broken testsEric Holk-1/+1
2023-12-01Add more information to stable InstanceCelina G. Val-1/+27
- Retrieve `FnSig`. - Implement CrateDef for InstanceDef. - Add VTable index for Virtual instances.
2023-11-26Use `rustc_fluent_macro::fluent_messages!` directly.Nicholas Nethercote-269/+243
Currently we always do this: ``` use rustc_fluent_macro::fluent_messages; ... fluent_messages! { "./example.ftl" } ``` But there is no need, we can just do this everywhere: ``` rustc_fluent_macro::fluent_messages! { "./example.ftl" } ``` which is shorter.
2023-11-26Avoid need for `{D,Subd}iagnosticMessage` imports.Nicholas Nethercote-1/+1
The `fluent_messages!` macro produces uses of `crate::{D,Subd}iagnosticMessage`, which means that every crate using the macro must have this import: ``` use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage}; ``` This commit changes the macro to instead use `rustc_errors::{D,Subd}iagnosticMessage`, which avoids the need for the imports.
2023-11-24Auto merge of #118138 - Nilstrieb:one-previous-error, r=WaffleLapkinbors-11/+18
Fixes error count display is different when there's only one error left Supersedes #114759 ### What did I do? I did the small change in `rustc_errors` by hand. Then I did the other changes in `/compiler` by hand, those were just find replace on `*.rs` in the workspace. The changes in run-make are find replace for `run-make` in the workspace. All other changes are blessed using `x test TEST --bless`. I blessed the tests that were blessed in #114759. ### how to review this nightmare ping bors with an `r+`. You should check that my logic is sound and maybe quickly scroll through the diff, but fully verifying it seems fairly hard to impossible. I did my best to do this correctly. Thank you `@adrianEffe` for bringing this up and your initial implementation. cc `@flip1995,` you said you want to do a subtree sync asap cc `@RalfJung` maybe you want to do a quick subtree sync afterwards as well for Miri r? `@WaffleLapkin`
2023-11-24Bless ui-fulldepsNilstrieb-11/+18
We have to ignore some tests in stage1.
2023-11-22Add CrateDef trait and methods to get def namesCelina G. Val-0/+109
2023-11-21Add allocation test and a bit more documentationCelina G. Val-0/+119
2023-11-20Add place.ty() and Ty build from a kind to smirCelina G. Val-10/+19
2023-11-16Add more APIs and fix `Instance::body`Celina G. Val-11/+21
Add more APIs to retrieve information about types, and add more instance resolution options. Make `Instance::body()` return an Option<Body>, since not every instance might have an available body. For example, foreign instances, virtual instances, dependencies.
2023-11-15Bump cfg(bootstrap)sMark Rousskov-4/+2
2023-11-09Remove rich UserTypeProjection projections in SMIRKirby Linvill-1/+1
It's not clear to me (klinvill) that UserTypeProjections are produced anymore with the removal of type ascriptions as per https://github.com/rust-lang/rfcs/pull/3307. Furthermore, it's not clear to me which variants of ProjectionElem could appear in such projections. For these reasons, I'm reverting projections in UserTypeProjections to simple strings until I can get more clarity on UserTypeProjections.
2023-11-09Replace match assertions against empty slices with is_empty assertionsKirby Linvill-8/+6
Asserting is_empty is slightly more concise.
2023-11-09Move SMIR projections tests to new fileKirby Linvill-103/+175
2023-11-09Add stable MIR Projections support based on MIR structureKirby Linvill-0/+103
This commit includes richer projections for both Places and UserTypeProjections. However, the tests only touch on Places. There are also outstanding TODOs regarding how projections should be resolved to produce Place types, and regarding if UserTypeProjections should just contain ProjectionElem<(),()> objects as in MIR.
2023-11-04add `fn visit_capture_by` to MutVisitor and fix pprust-expr-roundtrip.rsDinu Blanovschi-1/+1
2023-11-04Remove support for compiler plugins.Nicholas Nethercote-1084/+0
They've been deprecated for four years. This commit includes the following changes. - It eliminates the `rustc_plugin_impl` crate. - It changes the language used for lints in `compiler/rustc_driver_impl/src/lib.rs` and `compiler/rustc_lint/src/context.rs`. External lints are now called "loaded" lints, rather than "plugins" to avoid confusion with the old plugins. This only has a tiny effect on the output of `-W help`. - E0457 and E0498 are no longer used. - E0463 is narrowed, now only relating to unfound crates, not plugins. - The `plugin` feature was moved from "active" to "removed". - It removes the entire plugins chapter from the unstable book. - It removes quite a few tests, mostly all of those in `tests/ui-fulldeps/plugin/`. Closes #29597.
2023-11-02Minimize `pub` usage in `source_map.rs`.Nicholas Nethercote-4/+4
Most notably, this commit changes the `pub use crate::*;` in that file to `use crate::*;`. This requires a lot of `use` items in other crates to be adjusted, because everything defined within `rustc_span::*` was also available via `rustc_span::source_map::*`, which is bizarre. The commit also removes `SourceMap::span_to_relative_line_string`, which is unused.
2023-10-30Add a stable MIR visitorCelina G. Val-0/+148
Add a few utility functions as well and extend most `mir` and `ty` ADTs to implement `PartialEq` and `Eq`.
2023-10-26Add test for smir localsKirby Linvill-0/+31
2023-10-26Update Place and Operand to take slicesKirby Linvill-13/+13
The latest locals() method in stable MIR returns slices instead of vecs. This commit also includes fixes to the existing tests that previously referenced the private locals field.
2023-10-25Add a public API to get all body localsKirby Linvill-1/+1
This is particularly helpful for the ui tests, but also could be helpful for Stable MIR users who just want all the locals without needing to concatenate responses
2023-10-24Remove fold code and add Const::internal()Celina G. Val-34/+12
We are not planning to support user generated constant in the foreseeable future, so we are removing the Fold logic for now in favor of the Instance::resolve logic. The Instance::resolve was however incomplete, since we weren't handling internalizing constants yet. Thus, I added that. I decided to keep the Const fields private in case we decide to translate them lazily.
2023-10-23Add test and remove double refCelina G. Val-15/+82
2023-10-23Try to work around 32 bit mingw issuesOli Scherer-0/+3
2023-10-23Avoid having `rustc_smir` depend on `rustc_interface` or `rustc_driver`Oli Scherer-11/+17
2023-10-22Auto merge of #116932 - Kobzol:fix-stage1-tests, r=Mark-Simulacrumbors-2/+4
Fix x86_64-gnu-llvm-15 CI tests The CI script was broken - if there was a test failure in the first command chain (inside the `if`), CI would not report the failure. It happened because there were two command chains separated by `&&` in the script, and since `set -e` doesn't exit for chained commands, if the first chain has failed, the script would happily continue forward, ignoring any test failures. This could be fixed e.g. by adding some `|| exit 1` to the first chain, but I suppose that the `&&` chaining is unnecessary here anyway. Reported [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/test.20failure.20didn't.20stop.20CI). Fixes: https://github.com/rust-lang/rust/issues/116867
2023-10-21Rollup merge of #116964 - celinval:smir-mono-body, r=oli-obkMatthias Krüger-1/+25
Add stable Instance::body() and RustcInternal trait The `Instance::body()` returns a monomorphized body. For that, we had to implement visitor that monomorphize types and constants. We are also introducing the RustcInternal trait that will allow us to convert back from Stable to Internal. Note that this trait is not yet visible for our users as it depends on Tables. We should probably add a new trait that can be exposed. The tests here are very simple, and I'm planning on creating more exhaustive tests in the project-mir repo. But I was hoping to get some feedback here first. r? ```@oli-obk```
2023-10-20bless ui-fulldepsOli Scherer-2/+2
2023-10-20s/Generator/Coroutine/Oli Scherer-2/+2