about summary refs log tree commit diff
path: root/tests/ui/extern
AgeCommit message (Collapse)AuthorLines
2025-01-23tests: use `needs-threads` instead of `ignore-emscripten`许杰友 Jieyou Xu (Joe)-2/+2
2025-01-23tests: use `needs-subprocess` instead of `ignore-{wasm32,emscripten,sgx}`许杰友 Jieyou Xu (Joe)-1/+1
2025-01-21remove support for the #[start] attributeRalf Jung-4/+2
2025-01-07Update tests.Mara Bos-10/+11
2025-01-01Try to write the panic message with a single `write_all` callJohn Kåre Alsaker-0/+3
2024-12-27Remove the `-test` suffix from normalize directivesZalathar-4/+4
2024-12-12Tweak multispan renderingEsteban Küber-2/+1
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
2024-12-09Revert #131669 due to ICEs许杰友 Jieyou Xu (Joe)-4/+0
Revert <https://github.com/rust-lang/rust/pull/131669> due to ICE reports: - <https://github.com/rust-lang/rust/issues/134059> (real-world) - <https://github.com/rust-lang/rust/issues/134060> (fuzzing) The changes can be re-landed with those cases addressed. This reverts commit 703bb982303ecab02fec593899639b4c3faecddd, reversing changes made to f415c07494b98e4559e4b13a9c5f867b0e6b2444.
2024-12-06lint: rework some ImproperCTypes messages (especially around indirections to ↵niacdoial-0/+4
!Sized)
2024-12-02Allow fn pointers comparisons lint in UI testsUrgau-0/+3
2024-11-30bless tests for changed library pathRalf Jung-3/+3
2024-11-26tests: remove `//@ pretty-expanded` usages许杰友 Jieyou Xu (Joe)-11/+0
Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
2024-11-08remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic ↵Ralf Jung-7/+6
functions instead
2024-10-29Remove detail from label/note that is already available in other noteEsteban Küber-3/+3
Remove the "which is required by `{root_obligation}`" post-script in "the trait `X` is not implemented for `Y`" explanation in E0277. This information is already conveyed in the notes explaining requirements, making it redundant while making the text (particularly in labels) harder to read. ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ``` vs the prior ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`, which is required by `Option<NotCopy>: Copy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ```
2024-10-11Note what qualifierMichael Goulet-3/+3
2024-09-20TL note: current means targetJubilee Young-3/+3
2024-09-19Keep object-size-dependent tests failingJubilee Young-27/+9
These tests depend on the internal logic of rustc regarding handling very large objects. Fix them to reflect rustc_abi::obj_size_bound diffs.
2024-08-24Rollup merge of #128735 - jieyouxu:pr-120176-revive, r=cjgillotTrevor Gross-6/+6
Add a special case for `CStr`/`CString` in the `improper_ctypes` lint Revives #120176. Just needed to bless a test and fix an argument, but seemed reasonable to me otherwise. Instead of saying to "consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct", we now tell users to "Use `*const ffi::c_char` instead, and pass the value from `CStr::as_ptr()`" when the type involved is a `CStr` or a `CString`. The suggestion is not made for `&mut CString` or `*mut CString`. r? ``````@cjgillot`````` (since you were the reviewer of the original PR #120176, but feel free to reroll)
2024-08-16Use FnSig instead of raw FnDecl for ForeignItemKind::FnMichael Goulet-1/+1
2024-08-06Add a special case for CStr/CString in the improper_ctypes lintFlying-Toast-6/+6
Instead of saying to "consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct", we now tell users to "Use `*const ffi::c_char` instead, and pass the value from `CStr::as_ptr()`" when the type involved is a `CStr` or a `CString`. Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
2024-08-02Bless testsbjorn3-3/+3
2024-07-17Rollup merge of #125042 - long-long-float:suggest-move-arg-outside, r=fmeaseMatthias Krüger-1/+1
Use ordinal number in argument error Add an ordinal number to two argument errors ("unexpected" and "missing") for ease of understanding error. ``` error[E0061]: this function takes 3 arguments but 2 arguments were supplied --> test.rs:11:5 | 11 | f(42, 'a'); | ^ --- 2nd argument of type `f32` is missing | (snip) error[E0061]: this function takes 3 arguments but 4 arguments were supplied --> test.rs:12:5 | 12 | f(42, 42, 1.0, 'a'); | ^ ---- | | | | | unexpected 2nd argument of type `{integer}` | help: remove the extra argument ``` To get an ordinal number, I copied `ordinalize` from other crate `rustc_resolve` because I think it is too much to link `rustc_resolve` for this small function. Please let me know if there is a better way.
2024-07-14Use ordinal number in argument errorlong-long-float-1/+1
Fix error message Fix tests Format
2024-07-12Make parse error suggestions verbose and fix spansEsteban Küber-3/+5
Go over all structured parser suggestions and make them verbose style. When suggesting to add or remove delimiters, turn them into multiple suggestion parts.
2024-07-11Always use a colon in `//@ normalize-*:` headersZalathar-2/+2
2024-05-29Use parenthetical notation for `Fn` traitsEsteban Küber-1/+1
Always use the `Fn(T) -> R` format when printing closure traits instead of `Fn<(T,), Output = R>`. Fix #67100: ``` error[E0277]: expected a `Fn()` closure, found `F` --> file.rs:6:13 | 6 | call_fn(f) | ------- ^ expected an `Fn()` closure, found `F` | | | required by a bound introduced by this call | = note: wrap the `F` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `call_fn` --> file.rs:1:15 | 1 | fn call_fn<F: Fn() -> ()>(f: &F) { | ^^^^^^^^^^ required by this bound in `call_fn` help: consider further restricting this bound | 5 | fn call_any<F: std::any::Any + Fn()>(f: &F) { | ++++++ ```
2024-04-17Remove libc from rust_get_test_int usesBen Kimock-4/+1
2024-04-15Use the rustc_private libc less in testsBen Kimock-7/+7
2024-04-04Fix diagnostic for qualifier in extern blockArthur Carcano-7/+2
Closes: https://github.com/rust-lang/rust/issues/123306
2024-03-24add issue numbers via // issue: rust-lang/rust#ISSUE_NUM directiveMatthias Krüger-8/+11
2024-03-24add test for str as extern "C" arg causes compiler panic #80125Matthias Krüger-0/+50
Fixes #80125
2024-03-24add test for #52334Matthias Krüger-0/+35
Fixes #52334
2024-03-11Update test directives for `wasm32-wasip1`Alex Crichton-4/+1
* The WASI targets deal with the `main` symbol a bit differently than native so some `codegen` and `assembly` tests have been ignored. * All `ignore-emscripten` directives have been updated to `ignore-wasm32` to be more clear that all wasm targets are ignored and it's not just Emscripten. * Most `ignore-wasm32-bare` directives are now gone. * Some ignore directives for wasm were switched to `needs-unwind` instead. * Many `ignore-wasm32*` directives are removed as the tests work with WASI as opposed to `wasm32-unknown-unknown`.
2024-02-19Always evaluate free constants and statics, even if previous errors occurredOli Scherer-2/+10
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-104/+104
2024-02-14Auto merge of #120847 - oli-obk:track_errors9, r=compiler-errorsbors-2/+12
Continue compilation after check_mod_type_wf errors The ICEs fixed here were probably reachable through const eval gymnastics before, but now they are easily reachable without that, too. The new errors are often bugfixes, where useful errors were missing, because they were reported after the early abort. In other cases sometimes they are just duplication of already emitted errors, which won't be user-visible due to deduplication. fixes https://github.com/rust-lang/rust/issues/120860
2024-02-14Continue compilation after check_mod_type_wf errorsOli Scherer-2/+12
2024-02-13Move testsCaio-0/+64
2024-02-09Move some testsCaio-0/+119
2024-02-07Update testsr0cky-1/+11
2024-02-01review comment: change wordingEsteban Küber-4/+4
2024-02-01On E0277 be clearer about implicit `Sized` bounds on type params and assoc typesEsteban Küber-8/+8
``` error[E0277]: the size for values of type `[i32]` cannot be known at compilation time --> f100.rs:2:33 | 2 | let _ = std::mem::size_of::<[i32]>(); | ^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[i32]` note: required by an implicit `Sized` bound in `std::mem::size_of` --> /home/gh-estebank/rust/library/core/src/mem/mod.rs:312:22 | 312 | pub const fn size_of<T>() -> usize { | ^ required by the implicit `Sized` requirement on this bound in `size_of` ``` Fix #120178.
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-3/+3
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote: ``` error[E0277]: the trait bound `i32: Bar` is not satisfied --> f100.rs:6:6 | 6 | <i32 as Foo>::foo(); | ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo` | help: this trait has no implementations, consider adding one --> f100.rs:2:1 | 2 | trait Bar {} | ^^^^^^^^^ note: required for `i32` to implement `Foo` --> f100.rs:3:14 | 3 | impl<T: Bar> Foo for T {} | --- ^^^ ^ | | | unsatisfied trait bound introduced here ``` Fix #40120.
2024-01-21exclude unexported macro bindings from extern cratebohan-1/+47
2024-01-13Bless testsGeorge-lewis-0/+1
Update tests
2024-01-06Rollup merge of #118781 - RalfJung:core-panic-feature, r=the8472Matthias Krüger-1/+1
merge core_panic feature into panic_internals I don't know why those are two separate features, but it does not seem intentional. This merge is useful because with https://github.com/rust-lang/rust/pull/118123, panic_internals is recognized as an internal feature, but core_panic is not -- but core_panic definitely should be internal.
2024-01-05Stabilize THIR unsafeckMatthew Jasper-2/+2
2024-01-05Remove revisions for THIR unsafeckMatthew Jasper-15/+1
This is to make the diff when stabilizing it easier to review.
2023-12-12also test projecting to some sized fields at non-zero offset in structs with ↵Ralf Jung-3/+9
an extern type tail
2023-12-12test that both size_of_val and align_of_val panicRalf Jung-6/+16