about summary refs log tree commit diff
path: root/tests/ui/extern
AgeCommit message (Collapse)AuthorLines
2025-10-02mir-opt: Eliminate trivial unnecessary storage annotationsdianqk-0/+5
2025-09-26Ignore more failing ui tests for GCC backendGuillaume Gomez-0/+3
2025-08-21refactor target checking, move out of context.rs and rename MaybeWarn to PolicyJana Dönszelmann-6/+6
2025-08-20Rollup merge of #140794 - karolzwolak:allow-unused-doc-65464, r=davidtwcoJacob Pratt-1/+1
mention lint group in default level lint note ### Summary This PR updates lint diagnostics so that default-level notes now mention the lint group they belong to, if any. Fixes: rust-lang/rust#65464. ### Example ```rust fn main() { let x = 5; } ``` Before: ``` = note: `#[warn(unused_variables)]` on by default ``` After: ``` = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default ``` ### Unchanged Cases Messages remain the same when the lint level is explicitly set, e.g.: * Attribute on the lint `#[warn(unused_variables)]`: ``` note: the lint level is defined here LL | #[warn(unused_variables)] | ^^^^^^^^^^^^^^^^ ``` * Attribute on the group `#[warn(unused)]:`: ``` = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` ``` * CLI option `-W unused`: ``` = note: `-W unused-variables` implied by `-W unused` = help: to override `-W unused` add `#[allow(unused_variables)]` ``` * CLI option `-W unused-variables`: ``` = note: requested on the command line with `-W unused-variables` ```
2025-08-19bless tests with new lint messagesKarol Zwolak-1/+1
2025-08-19Auto merge of #145600 - jieyouxu:rollup-jw0bpnt, r=jieyouxubors-3/+6
Rollup of 15 pull requests Successful merges: - rust-lang/rust#145338 (actually provide the correct args to coroutine witnesses) - rust-lang/rust#145429 (Couple of codegen_fn_attrs improvements) - rust-lang/rust#145452 (Do not strip binaries in bootstrap everytime if they are unchanged) - rust-lang/rust#145464 (Stabilize `const_pathbuf_osstring_new` feature) - rust-lang/rust#145474 (Properly recover from parenthesized use-bounds (precise capturing lists) plus small cleanups) - rust-lang/rust#145486 (Fix `unicode_data.rs` mention message) - rust-lang/rust#145490 (Trace some basic I/O operations in bootstrap) - rust-lang/rust#145493 (remove `should_render` in `PrintAttribute` derive) - rust-lang/rust#145500 (Port must_use to the new target checking) - rust-lang/rust#145505 (Simplify span caches) - rust-lang/rust#145510 (Visit and print async_fut local for async drop.) - rust-lang/rust#145511 (Rust build fails on OpenBSD after using file_lock feature) - rust-lang/rust#145532 (resolve: debug for block module) - rust-lang/rust#145533 (Reorder `lto` options from most to least optimizing) - rust-lang/rust#145537 (Do not consider a `T: !Sized` candidate to satisfy a `T: !MetaSized` obligation.) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-19Update uitestsJonathan Brouwer-3/+6
2025-08-17Rehome tests/ui/issues/ tests [5/?]Oneirical-0/+25
2025-08-14Update uitestsJonathan Brouwer-50/+43
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-11Add more docs to templates for attrs with incorrect argumentsEsteban Küber-0/+3
2025-08-10Rollup merge of #144403 - Kivooeo:issue4, r=jieyouxuStuart Cook-0/+13
`tests/ui/issues/`: The Issues Strike Back [4/N] Some `tests/ui/issues/` housekeeping, to trim down number of tests directly under `tests/ui/issues/`. Part of https://github.com/rust-lang/rust/issues/133895. r? ````````@jieyouxu````````
2025-08-09commentsKivooeo-0/+2
2025-08-07Rollup merge of #143929 - petrochenkov:depresolve, r=lcnrStuart Cook-4/+15
Mark all deprecation lints in name resolution as deny-by-default and report-in-deps This affects the next lints: - `MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS` - https://github.com/rust-lang/rust/issues/144408 - `LEGACY_DERIVE_HELPERS` - https://github.com/rust-lang/rust/issues/79202 - `PRIVATE_MACRO_USE` - https://github.com/rust-lang/rust/issues/120192 - `OUT_OF_SCOPE_MACRO_CALLS` - https://github.com/rust-lang/rust/issues/144406
2025-08-06Print thread ID in panic message if thread name is unknownTrevor Gross-3/+3
`panic!` does not print any identifying information for threads that are unnamed. However, in many cases, the thread ID can be determined. This changes the panic message from something like this: thread '<unnamed>' panicked at src/main.rs:3:5: explicit panic To something like this: thread '<unnamed>' (0xff9bf) panicked at src/main.rs:3:5: explicit panic Stack overflow messages are updated as well. This change applies to both named and unnamed threads. The ID printed is the OS integer thread ID rather than the Rust thread ID, which should also be what debuggers print.
2025-08-05Mark all deprecation lints in name resolution as deny-by-default and ↵Vadim Petrochenkov-4/+15
report-in-deps
2025-08-01Rollup merge of #144397 - Kivooeo:issue2, r=jieyouxuRalf Jung-0/+49
`tests/ui/issues/`: The Issues Strike Back [2/N] Some `tests/ui/issues/` housekeeping, to trim down number of tests directly under `tests/ui/issues/`. Part of https://github.com/rust-lang/rust/issues/133895. r? ``@jieyouxu``
2025-07-31commentsKivooeo-39/+49
2025-07-28Rollup merge of #144151 - Kivooeo:issue1, r=jieyouxuMatthias Krüger-0/+71
`tests/ui/issues/`: The Issues Strike Back [1/N] I believe I’ve finally brought [my program](https://github.com/Kivooeo/test-manager) to life -- it now handles multiple test moves in one go: plain moves first, then a gentle touch on each file depends on given options. The process should be much smoother now. Of course, I won’t rush through everything in a few days -- that would be unkind to `@Oneirical.` I’ll pace myself. And also I can't have more than one such PR because `issues.txt` will conflict with previous parts after merging them which is not fun as well. This PR is just that: first commit - moves; second - regression comments and the occasional .stderr reblesses, also issue.txt and tidy changes. Nothing special, but progress nonetheless. This is for the purpose of preserving test file history during restructuring Part of https://github.com/rust-lang/rust/issues/133895. r? `@jieyouxu`
2025-07-25Check statics' type in type_of.Camille GILLOT-12/+2
2025-07-25commentsKivooeo-0/+50
2025-07-25move 28 testsKivooeo-0/+21
2025-07-25moved 34 tests to organized locationsKivooeo-0/+11
2025-07-24moved 35 tests to organized locationsKivooeo-0/+39
2025-07-19tests: Require `run-fail` ui tests to have an exit code (`SIGABRT` not ok)Martin Nordholts-1/+1
And introduce two new directives for ui tests: * `run-crash` * `run-fail-or-crash` Normally a `run-fail` ui test like tests that panic shall not be terminated by a signal like `SIGABRT`. So begin having that as a hard requirement. Some of our current tests do terminate by a signal/crash however. Introduce and use `run-crash` for those tests. Note that Windows crashes are not handled by signals but by certain high bits set on the process exit code. Example exit code for crash on Windows: `0xc000001d`. Because of this, we define "crash" on all platforms as "not exit with success and not exit with a regular failure code in the range 1..=127". Some tests behave differently on different targets: * Targets without unwind support will abort (crash) instead of exit with failure code 101 after panicking. As a special case, allow crashes for `run-fail` tests for such targets. * Different sanitizer implementations handle detected memory problems differently. Some abort (crash) the process while others exit with failure code 1. Introduce and use `run-fail-or-crash` for such tests.
2025-07-16trait_sel: `MetaSized` always holds temporarilyDavid Wood-126/+5
As a temporary measure while a proper fix for `tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs` is implemented, make `MetaSized` obligations always hold. In effect, temporarily reverting the `sized_hierarchy` feature. This is a small change that can be backported.
2025-07-10Rework borrowing suggestions to use `Expr` instead of just `Span`Esteban Küber-4/+4
In the suggestion machinery for borrowing expressions and types, always use the available obligation `Span` to find the appropriate `Expr` to perform appropriateness checks no the `ExprKind` instead of on the textual snippet corresponding to the `Span`. Unify the logic for the case where `&` *and* `&mut` are appropriate with the logic for only one of those cases. Handle the case when `S::foo()` should have been `<&S>::foo()` (instead of suggesting the prior `&S::foo()`.
2025-07-01Auto merge of #143287 - GuillaumeGomez:rollup-fdjcti9, r=GuillaumeGomezbors-5/+1
Rollup of 12 pull requests Successful merges: - rust-lang/rust#136801 (Implement `Random` for tuple) - rust-lang/rust#141867 (Describe Future invariants more precisely) - rust-lang/rust#142760 (docs(fs): Touch up grammar on lock api) - rust-lang/rust#143181 (Improve testing and error messages for malformed attributes) - rust-lang/rust#143210 (`tests/ui`: A New Order [19/N] ) - rust-lang/rust#143212 (`tests/ui`: A New Order [20/N]) - rust-lang/rust#143230 ([COMPILETEST-UNTANGLE 2/N] Make some compiletest errors/warnings/help more visually obvious) - rust-lang/rust#143240 (Port `#[rustc_object_lifetime_default]` to the new attribute parsing …) - rust-lang/rust#143255 (Do not enable LLD by default in the dist profile) - rust-lang/rust#143262 (mir: Mark `Statement` and `BasicBlockData` as `#[non_exhaustive]`) - rust-lang/rust#143269 (bootstrap: make comment more clear) - rust-lang/rust#143279 (Remove `ItemKind::descr` method) Failed merges: - rust-lang/rust#143237 (Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-01Fix duplicate help on export_name and othersJonathan Brouwer-5/+1
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-30Don't look at static items' HIR for wfcheckOli Scherer-2/+2
2025-06-28Port `#[link_name]` to the new attribute parsing infrastructureJonathan Brouwer-25/+8
Co-authored-by: Anne Stijns <anstijns@gmail.com> Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-16trait_sel: skip elaboration of sizedness supertraitDavid Wood-2/+30
As a performance optimization, skip elaborating the supertraits of `Sized`, and if a `MetaSized` obligation is being checked, then look for a `Sized` predicate in the parameter environment. This makes the `ParamEnv` smaller which should improve compiler performance as it avoids all the iteration over the larger `ParamEnv`.
2025-06-16tests: bless remaining testsDavid Wood-6/+59
These tests just need blessing, they don't have any interesting behaviour changes. Some of these tests have new errors because `LegacyReceiver` cannot be proven to be implemented now that it is also testing for `MetaSized` - but this is just a consequence of the other errors in the test.
2025-06-16tests: `PointeeSized` bounds with extern typesDavid Wood-39/+82
These tests necessarily need to change now that `?Sized` is not sufficient to accept extern types and `PointeeSized` is now necessary. In addition, the `size_of_val`/`align_of_val` test can now be changed to expect an error.
2025-06-13Unimplement unsized_localsmejrs-0/+31
2025-06-07const-eval error: always say in which item the error occurredRalf Jung-1/+1
also adjust the wording a little so that we don't say "the error occurred here" for two different spans
2025-06-02Clarify why we are talking about a failed const eval at a random placeOli Scherer-1/+1
2025-06-02Use the informative error as the main const eval error messageOli Scherer-3/+3
2025-05-21Avoid creating an empty identifer in `Symbol::to_ident_string`.Nicholas Nethercote-0/+18
Because that causes an assertion failure in debug builds. Fixes #140884.
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-6/+6
2025-04-06update/bless testsBennet Bleßmann-30/+0
2025-03-20Use def_path_str for def id arg in UnsupportedOpInfoMichael Goulet-1/+1
2025-03-03Tweak error code for sized checks of const/staticMichael Goulet-0/+1
2025-02-23Auto merge of #137225 - RalfJung:vectorcall, r=nnethercotebors-0/+1
vectorcall ABI: require SSE2 According to the official docs at https://learn.microsoft.com/en-us/cpp/cpp/vectorcall, SSE2 is required for this ABI. Add a check that enforces this. I put this together with the other checks ensuring the target features required for a function are present... however, since the ABI is known pre-monomorphization, it would be possible to do this check earlier, which would have the advantage of checking even in `cargo check`. It would have the disadvantage of spreading this code in yet more places. The first commit just does a little refactoring of the mono-time ABI check to make it easier to add the new check. Cc `@workingjubilee` try-job: dist-i586-gnu-i586-i686-musl
2025-02-21More sophisticated span trimmingMichael Goulet-3/+2
2025-02-20vectorcall ABI: error if sse2 is not availableRalf Jung-0/+1
2025-02-14Trim suggestion parts to the subset that is purely additiveMichael Goulet-2/+2
2025-02-14Use underline suggestions for purely 'additive' replacementsMichael Goulet-6/+4
2025-02-11Auto merge of #136845 - matthiaskrgr:rollup-ol4np4z, r=matthiaskrgrbors-0/+14
Rollup of 7 pull requests Successful merges: - #136107 (Introduce CoercePointeeWellformed for coherence checks at typeck stage) - #136155 (Enable sanitizers on MSVC CI jobs) - #136524 (Delay bug when method confirmation cannot upcast object pick of self) - #136584 (Prevent generic pattern types from being used in libstd) - #136603 (compiler: gate `extern "{abi}"` in ast_lowering) - #136821 (assign marcoieni and jdno to infra-ci PRs) - #136825 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-18/+27
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2025-02-09compiler: gate `extern "{abi}"` in ast_loweringJubilee Young-0/+14
By moving this stability check into AST lowering, we effectively make it impossible to accidentally miss, as it must happen to generate HIR. Also, we put the ABI-stability code next to code that actually uses it! This allows code that wants to reason about backend ABI implementations to stop worrying about high-level concerns like syntax stability, while still leaving it as the authority on what ABIs actually exist. It also makes it easy to refactor things to have more consistent errors. For now, we only apply this to generalize the existing messages a bit.