about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-08-29Fix tests due to stricter invalid_value5225225-0/+1
2022-08-29Rollup merge of #101131 - RalfJung:ctfe-no-needs-rfc, r=oli-obkMatthias Krüger-2/+5
CTFE: exposing pointers and calling extern fn is just impossible The remaining "needs RFC" errors are just needlessly confusing, I think -- time to get rid of that error variant. They are anyway only reachable with miri-unleashed (if at all). r? `@oli-obk`
2022-08-29Rollup merge of #100898 - compiler-errors:too-many-expr-fields, r=spastorinoMatthias Krüger-16/+73
Do not report too many expr field candidates When considering "this expressions' field has a {field/method}" suggestions: 1. Don't report methods that are out of scope 2. Use `span_suggestions` instead of reporting each field candidate, which caps the number of suggestions to 4 4. Blacklist some common traits like `Clone` and `Deref` Fixes #100894
2022-08-29Point at the string inside literal and mention if we need string interpolationYiming Lei-0/+59
modified: compiler/rustc_passes/src/liveness.rs new file: src/test/ui/type/issue-100584.rs new file: src/test/ui/type/issue-100584.stderr
2022-08-29unix_sigpipe: Skip some tests on android; libc has no `signal` functionMartin Nordholts-1/+6
If we don't skip these tests, they will fail in CI when `python3 ../x.py --stage 2 test --host= --target arm-linux-androideabi` runs. The failure is: auxiliary/libsigpipe_utils.so: error: undefined reference to 'signal'
2022-08-29Display raw pointer as `*{mut,const} T` instead of `*-ptr` in errorsnils-7/+7
The `*-ptr` is rather confusing, and we have the full information for properly displaying the information.
2022-08-29Revert let_chains stabilizationNilstrieb-371/+693
This reverts commit 326646074940222d602f3683d0559088690830f4. This is the revert against master, the beta revert was already done in #100538.
2022-08-29Try normalizing types without RevealAll in ParamEnv in mir validationNilstrieb-0/+25
Before, the MIR validator used RevealAll in its ParamEnv for type checking. This could cause false negatives in some cases due to RevealAll ParamEnvs not always use all predicates as expected here. Since some MIR passes like inlining use RevealAll as well, keep using it in the MIR validator too, but when it fails usign RevealAll, also try the check without it, to stop false negatives.
2022-08-29Make the trait bound is not satisfied specify kindObei Sideg-32/+81
2022-08-29Rollup merge of #101000 - m-ou-se:count-is-star, r=nagisaDylan DPC-1/+14
Separate CountIsStar from CountIsParam in rustc_parse_format. `rustc_parse_format`'s parser would result in the exact same output for `{:.*}` and `{:.0$}`, making it hard for diagnostics to handle these cases properly. This splits those cases by adding a new `CountIsStar` enum variant. This fixes #100995 Prerequisite for https://github.com/rust-lang/rust/pull/100996
2022-08-29Rollup merge of #100897 - RalfJung:const-not-to-mutable, r=lcnrMatthias Krüger-10/+10
extra sanity check against consts pointing to mutable memory This should be both unreachable and redundant (since we already ensure that validation only reads from read-only memory, when validating consts), but I feel like we cannot be paranoid enough here, and also if this ever fails it'll be a nicer error than the "cannot read from mutable memory" error.
2022-08-29Rollup merge of #100437 - compiler-errors:better-const-mismatch-err, r=oli-obkMatthias Krüger-42/+164
Improve const mismatch `FulfillmentError` Fixes #100414
2022-08-29Improve HIR stats collector.Nicholas Nethercote-20/+52
Adds and removes some `visit_*` methods accordingly, improving coverage, and avoiding some double counting. Brings it in line with the AST stats collector.
2022-08-29Add prefix to every line of `-Zhir-stats` output.Nicholas Nethercote-151/+145
This is based on `-Zprint-type-sizes` which does the same thing. It makes the output provenance clearer, and helps with post-processing. E.g. if you have `-Zhir-stats` output from numerous compiler invocations you can now easily extract the pre-expansion stats separately from the post-expansion stats.
2022-08-28Support `#[unix_sigpipe = "inherit|sig_dfl|sig_ign"]` on `fn main()`Martin Nordholts-0/+256
This makes it possible to instruct libstd to never touch the signal handler for `SIGPIPE`, which makes programs pipeable by default (e.g. with `./your-program | head -n 1`) without `ErrorKind::BrokenPipe` errors.
2022-08-28entirely get rid of NeedsRfc CTFE errorsRalf Jung-0/+3
2022-08-28CTFE: exposing pointers and calling extern fn doesn't need an RFC, it is ↵Ralf Jung-2/+2
just impossible
2022-08-28Remove `register_attr`-related testsYuki Okushi-473/+183
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-08-28Support method callsHirochika Matsumoto-12/+45
2022-08-28Rollup merge of #101055 - TaKO8Ki:use-smaller-span, r=compiler-errorsMatthias Krüger-12/+20
Use smaller span for suggestions
2022-08-28Rollup merge of #101038 - RalfJung:interning-alignment, r=oli-obkMatthias Krüger-0/+17
no alignment check during interning This should fix https://github.com/rust-lang/rust/issues/101034 r? `@oli-obk` Unfortunately we don't have a self-contained testcase for this problem. I am not sure how it can be triggered...
2022-08-28Rollup merge of #101002 - estebank:hashmap-idx, r=davidtwcoMatthias Krüger-10/+36
Provide structured suggestion for `hashmap[idx] = val`
2022-08-28Use hir::Map to prevent false positivesHirochika Matsumoto-14/+4
2022-08-28Add test for APITMichael Goulet-3/+23
2022-08-28More descriptive argument placeholdersMichael Goulet-40/+40
2022-08-28Suggest calling when operator types mismatchMichael Goulet-24/+16
2022-08-27Suggest calling trait objects and parameters too, when possibleMichael Goulet-16/+93
2022-08-27adjust testsRalf Jung-28/+311
2022-08-27Add testMichael Goulet-0/+45
2022-08-27Only suggest call on nonexistent fields and methods if they make senseMichael Goulet-69/+62
2022-08-27Use autoderefMichael Goulet-0/+27
2022-08-27Review updates: simpler MWE and docsMatthew Kelly-50/+19
- use the simpler minimum working example from the review - add an alterate "fix" that helps make the cause of the error more clear - attempt to add an improved description of what is going on
2022-08-27Auto merge of #100989 - lcnr:implied-bounds-uwu, r=spastorinobors-0/+48
no unnormalized types for implied bounds outside borrowck fixes #100910 - introduced in https://github.com/rust-lang/rust/pull/100676 - by only considering normalized types for wf. r? types
2022-08-27use smaller span for suggestionsTakayuki Maeda-12/+20
2022-08-27Auto merge of #101074 - JohnTitor:rollup-zwznihq, r=JohnTitorbors-15/+6
Rollup of 11 pull requests Successful merges: - #96240 (Stabilize `const_ptr_offset_from`.) - #99784 (Make forward compatibility lint deprecated_cfg_attr_crate_type_name deny by default) - #100811 (Fix wrong compiletest filters on Windows) - #100924 (Smaller improvements of tidy and the unicode generator) - #100953 (Update documentation for `write!` and `writeln!`) - #101018 (rustdoc: omit start/end tags for empty item description blocks) - #101044 (rustdoc: remove unused CSS for `hidden-by-*-hider`) - #101046 (rustdoc: remove incorrect CSS selector `.impl-items table td`) - #101057 (Merge implementations of HIR fn_decl and fn_sig.) - #101062 (rustdoc: remove empty extern_crates and type="text/javascript" on script) - #101063 (Merge duplicated CSS rules) Failed merges: - #101055 (Use smaller span for suggestions) r? `@ghost` `@rustbot` modify labels: rollup
2022-08-27Rollup merge of #99784 - est31:deny_cfg_attr_crate_type_name, r=Mark-SimulacrumYuki Okushi-11/+5
Make forward compatibility lint deprecated_cfg_attr_crate_type_name deny by default Turns the forward compatibility lint added by #83744 to deprecate `cfg_attr` usage with `#![crate_type]` and `#![crate_name]` attributes into deny by default. Copying the example from #83744: ```Rust #![crate_type = "lib"] // remains working #![cfg_attr(foo, crate_type = "bin")] // will stop working ``` Over 8 months have passed since #83744 was merged so I'd say this gives ample time for people to have been warned, so we can make the warning stronger. No usage was found via grep.app except for one, which was in an unmaintained code base that didn't seem to be used in the open source eco system. The crater run conducted in #83744 also didn't show up anything. cc #91632 - tracking issue for the lint
2022-08-27Rollup merge of #96240 - fee1-dead-contrib:stabilize_const_offset_from, ↵Yuki Okushi-4/+1
r=Mark-Simulacrum Stabilize `const_ptr_offset_from`. Stabilization has been completed [here](https://github.com/rust-lang/rust/issues/92980#issuecomment-1065644848) with a FCP. Closes #92980.
2022-08-27SadMichael Goulet-0/+16
2022-08-27Auto merge of #100732 - dpaoliello:import_name_type, r=wesleywiserbors-6/+184
Implementation of import_name_type Fixes #96534 by implementing https://github.com/rust-lang/compiler-team/issues/525 Symbols that are exported or imported from a binary on 32bit x86 Windows can be named in four separate ways, corresponding to the [import name types](https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#import-name-type) from the PE-COFF spec. The exporting and importing binaries must use the same name encoding, otherwise mismatches can lead to link failures due to "missing symbols" or to 0xc0000139 (`STATUS_ENTRYPOINT_NOT_FOUND`) errors when the executable/library is loaded. For details, see the comments on the raw-dylib feature's https://github.com/rust-lang/rust/issues/58713. To generate the correct import libraries for these DLLs, therefore, rustc must know the import name type for each `extern` function, and there is currently no way for users to provide this information. This change adds a new `MetaNameValueStr` key to the `#[link]` attribute called `import_name_type`, and which accepts one of three values: `decorated`, `noprefix`, and `undecorated`. A single DLL is likely to export all its functions using the same import type name, hence `import_name_type` is a parameter of `#[link]` rather than being its own attribute that is applied per-function. It is possible to have a single DLL that exports different functions using different import name types, but users could express such cases by providing multiple export blocks for the same DLL, each with a different import name type. Note: there is a fourth import name type defined in the PE-COFF spec, `IMPORT_ORDINAL`. This case is already handled by the `#[link_ordinal]` attribute. While it could be merged into `import_type_name`, that would not make sense as `#[link_ordinal]` provides per-function information (namely the ordinal itself). Design decisions (these match the MCP linked above): * For GNU, `decorated` matches the PE Spec and MSVC rather than the default behavior of `dlltool` (i.e., there will be a leading `_` for `stdcall`). * If `import_name_type` is not present, we will keep our current behavior of matching the environment (MSVC vs GNU) default for decorating. * Using `import_name_type` on architectures other than 32bit x86 will result in an error. * Using `import_name_type` with link kinds other than `"raw-dylib"` will result in an error.
2022-08-27Revert "Remove deferred sized checks"Michael Goulet-25/+202
This reverts commit 33212bf7f527798a8cfa2bbb38781742f4ca718a.
2022-08-27Auto merge of #101064 - compiler-errors:rollup-fwm5m5f, r=compiler-errorsbors-0/+37
Rollup of 9 pull requests Successful merges: - #100724 (Migrate ast lowering to session diagnostic) - #100735 (Migrate `rustc_ty_utils` to `SessionDiagnostic`) - #100738 (Diagnostics migr const eval) - #100744 (Migrate rustc_mir_dataflow to diagnostic structs) - #100776 (Migrate `rustc_lint` errors to `SessionDiagnostic`) - #100817 (sugg: suggest the usage of boolean value when there is a typo in the keyword) - #100836 (Migrate `rustc_attr` crate diagnostics) - #100890 (Migrate rustc_driver to SessionDiagnostic) - #100900 (on `region_errors.rs`) Failed merges: - #100831 (Migrate `symbol_mangling` module to new diagnostics structs) r? `@ghost` `@rustbot` modify labels: rollup
2022-08-26Rollup merge of #100817 - vincenzopalazzo:macros/bool_spelling_sugg, r=davidtwcoMichael Goulet-0/+37
sugg: suggest the usage of boolean value when there is a typo in the keyword Fixes https://github.com/rust-lang/rust/issues/100686 This adds a new suggestion when there is a well-known typo With the following program ```rust fn main() { let x = True; } ``` Now we have the following suggestion ``` error[E0425]: cannot find value `True` in this scope --> test.rs:2:13 | 2 | let x = True; | ^^^^ not found in this scope | help: you may want to use a bool value instead | 2 | let x = true; | ~~~~ error: aborting due to previous error ``` Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-08-26Auto merge of #100043 - RalfJung:scalar-always-init, r=RalfJungbors-429/+282
interpret: remove support for uninitialized scalars With Miri no longer supporting `-Zmiri-allow-uninit-numbers`, we no longer need to support storing uninit data in a `Scalar`. We anyway already only use this representation for types with *initialized* `Scalar` layout (and we have to, due to partial initialization), so let's get rid of the `ScalarMaybeUninit` type entirely. I tried to stage this into meaningful commits, but the one that changes `read_immediate` to always trigger UB on uninit is the largest chunk of the PR and I don't see how it could be subdivided. Fixes https://github.com/rust-lang/miri/issues/2187 r? `@oli-obk`
2022-08-26More tests for invalid_value lint5225225-7/+49
2022-08-26Make invalid-value trigger on uninit primitives5225225-10/+23
2022-08-26make read_immediate error immediately on uninit, so ImmTy can carry ↵Ralf Jung-429/+282
initialized Scalar
2022-08-26Implementation of import_name_typeDaniel Paoliello-6/+184
2022-08-26Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiserbors-1/+2
session: stabilize split debuginfo on linux Stabilize the `-Csplit-debuginfo` flag... - ...on Linux for all values of the flag. Split DWARF has been implemented for a few months, hasn't had any bug reports and has had some promising benchmarking for incremental debug build performance. - ..on other platforms for the default value. It doesn't make any sense that `-Csplit-debuginfo=packed` is unstable on Windows MSVC when that's the default behaviour, but keep the other values unstable.
2022-08-26add a testRalf Jung-0/+17
2022-08-26Auto merge of #100944 - nnethercote:shrink-thir-Expr, r=cjgillotbors-9/+12
Shrink `thir::Expr` r? `@cjgillot`