about summary refs log tree commit diff
path: root/src/test/ui/test-attrs
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-1066/+0
2022-12-27Fix some totally useless suggestionsMichael Goulet-8/+1
2022-12-27Dont clobber `as ..` rename in import suggestionMichael Goulet-2/+2
2022-12-23Move testsCaio-0/+30
2022-10-28libtest: run all tests in their own thread, if supported by the hostRalf Jung-2/+2
2022-10-20Adjusting test to needs-unwind, with linking issueAndrew Pollack-1/+1
2022-10-18Rollup merge of #103023 - andrewpollack:i-fuchsia-finals, r=tmandryYuki Okushi-2/+5
Adding `fuchsia-ignore` and `needs-unwind` to compiler test cases Final tests covering missing privileges r? ``@tmandry`` cc. ``@djkoloski``
2022-10-13Adding fuchsia-ignore and needs-unwind to compiler test casesAndrew Pollack-2/+5
2022-10-10suggest candidates for unresolved importSparrowLii-4/+10
2022-10-02Fix duplicate usage of `a` article.Petr Portnov-12/+12
This fixes a typo first appearing in #94624 in which test-macro diagnostic uses "a" article twice. Since I searched sources for " a a " sequences, I also fixed the same issue in a few source files where I found it. Signed-off-by: Petr Portnov <gh@progrm-jarvis.ru>
2022-09-23Restore ignore tagFlorian Bartels-2/+0
This test case actually requires std::process.
2022-06-22Auto merge of #97853 - TaKO8Ki:emit-only-one-note-per-unused-struct-field, ↵bors-2/+2
r=estebank Collapse multiple dead code warnings into a single diagnostic closes #97643
2022-06-21Move some tests to more reasonable directoriesCaio-0/+15
2022-06-19collapse dead code warnings into a single diagnosticTakayuki Maeda-2/+2
add comments in `store_dead_field_or_variant` support multiple log level add a item ident label fix ui tests fix a ui test fix a rustdoc ui test use let chain refactor: remove `store_dead_field_or_variant` fix a tiny bug
2022-03-29Auto merge of #94566 - yanganto:show-ignore-message, r=m-ou-sebors-4/+3
Show ignore message in console and json output - Provide ignore the message in console and JSON output - Modify the ignore message style in the log file related: #92714
2022-03-19Add needs-unwind directive to tests where necessarybjorn3-0/+1
2022-03-11Add tests for JSON and console outputMark Rousskov-4/+3
2022-03-04Downgrade `#[test]` on macro call to warningEsteban Kuber-27/+15
Follow up to #92959. Address #94508.
2022-02-18Rollup merge of #92959 - asquared31415:test-non-fn-help, r=estebankMatthias Krüger-21/+265
Add more info and suggestions to use of #[test] on invalid items This pr changes the diagnostics for using `#[test]` on an item that can't be used as a test to explain that the attribute has no meaningful effect on non-functions and suggests the use of `#[cfg(test)]` for conditional compilation instead. Example change: ```rs #[test] mod test {} ``` previously output ``` error: only functions may be used as tests --> src/lib.rs:2:1 | 2 | mod test {} | ^^^^^^^^^^^ ``` now outputs ``` error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:3:1 | LL | #[test] | ^^^^^^^ LL | mod test {} | ----------- expected a non-associated function, found a module | = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions help: replace with conditional compilation to make the item only exist when tests are being run | LL | #[cfg(test)] | ~~~~~~~~~~~~ ```
2022-01-28remove allow_fail test flagyuhaixin.hx-17/+0
2022-01-17add more info to invalid use of #[test] on invalid itemsasquared31415-21/+265
2021-12-09Add needs-unwind to tests that depend on panickingDavid Koloski-0/+1
This directive isn't automatically set by compiletest or x.py, but can be turned on manually for targets that require it.
2021-11-06Move some tests to more reasonable directoriesCaio-0/+5
2021-10-03Practice diagnostic message conventionHirochika Matsumoto-4/+4
2021-09-15Move some tests to more reasonable directoriesCaio-0/+9
2021-06-30Move some UI tests to more suitable subdirsYuki Okushi-0/+363
2021-05-16remove mode for run and ignore testsAliénore Bouttefeux-4/+4
2021-05-03change based on reviewAliénore Bouttefeux-5/+5
2021-05-03proof of concept add test type on printsAliénore Bouttefeux-2/+38
2021-04-16Remove #[main] attribute.Charles Lew-4/+4
2021-02-08Rollup merge of #81356 - ehuss:libtest-filters, r=m-ou-seMara Bos-0/+24
libtest: allow multiple filters Libtest ignores any filters after the first. This changes it so that if multiple filters are passed, it will test against all of them. This also affects compiletest to do the same. Closes #30422
2021-01-31Move some tests to more reasonable directoriesCaio-0/+36
2021-01-24libtest: allow multiple filtersEric Huss-0/+24
2020-11-09Add `#[cfg(panic = "...")]`David Hewitt-1/+2
2020-07-28Make closures and generators a must use typesTomasz Miąsko-2/+2
Warn about unused expressions with closure or generator type. This follows existing precedence of must use annotations present on `FnOnce`, `FnMut`, `Fn` traits, which already indirectly apply to closures in some cases, e.g.,: ```rust fn f() -> impl FnOnce() { || {} } fn main() { // an existing warning: unused implementer of `std::ops::FnOnce` that must be used: f(); // a new warning: unused closure that must be used: || {}; } ```
2020-05-06Move tests from `test/run-fail` to UIYuki Okushi-0/+12
2020-04-23Moving more build-pass tests to check-passVal Markovic-1/+1
One or two tests became build-pass without the FIXME because they really needed build-pass (were failing without it). Helps with #62277
2020-04-11rustc: Add a warning count upon completionRoccoDev-0/+4
2020-03-24defatalize expand_test_or_benchMazdak Farrokhzad-2/+18
2020-01-24Normalise notes with the/isvarkor-1/+1
2020-01-12Diagnostics should start lowercasevarkor-4/+4
2019-11-10Make error and warning annotations mandatory in UI testsTomasz Miąsko-2/+2
This change makes error and warning annotations mandatory in UI tests. The only exception are tests that use error patterns to match compiler output and don't have any annotations.
2019-11-06Auto merge of #65830 - Quantumplation:master, r=davidtwco,estebankbors-2/+2
Use ident.span instead of def_span in dead-code pass Hello! First time contributor! :) This should fix #58729. According to @estebank in the duplicate #63064, def_span scans forward on the line until it finds a {, and if it can't find one, falls back to the span for the whole item. This was apparently written before the identifier span was explicitly tracked on each node. This means that if an unused function signature spans multiple lines, the entire function (potentially hundreds of lines) gets flagged as dead code. This could, for example, cause IDEs to add error squiggly's to the whole function. By using the span from the ident instead, we narrow the scope of this in most cases. In a wider sense, it's probably safe to use ident.span instead of def_span in most locations throughout the whole code base, but since this is my first contribution, I kept it small. Some interesting points that came up while I was working on this: - I reorganized the tests a bit to bring some of the dead code ones all into the same location - A few tests were for things unrelated to dead code (like the path-lookahead for parens), so I added #![allow(dead_code)] and cleaned up the stderr file to reduce noise in the future - The same fix doesn't apply to const and static declarations. I tried adding these cases to the match expression, but that created a much wider change to tests and error messages, so I left it off until I could get some code review to validate the approach.
2019-10-26Use ident instead of def_span in dead-code passPi Lanningham-2/+2
According to @estebank, def_span scans forward on the line until it finds a {, and if it can't find one, fallse back to the span for the whole item. This was apparently written before the identifier span was explicitly tracked on each node. This means that if an unused function signature spans multiple lines, the entire function (potentially hundreds of lines) gets flagged as dead code. This could, for example, cause IDEs to add error squiggly's to the whole function. By using the span from the ident instead, we narrow the scope of this in most cases. In a wider sense, it's probably safe to use ident.span instead of def_span in most locations throughout the whole code base, but since this is my first contribution, I kept it small. Some interesting points that came up while I was working on this: - I reorganized the tests a bit to bring some of the dead code ones all into the same location - A few tests were for things unrelated to dead code (like the path-lookahead for parens), so I added #![allow(dead_code)] and cleaned up the stderr file to reduce noise in the future - The same fix doesn't apply to const and static declarations. I tried adding these cases to the match expression, but that created a much wider change to tests and error messages, so I left it off until I could get some code review to validate the approach.
2019-10-25Re-enable Emscripten's exception handling supportThomas Lively-2/+2
Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests.
2019-10-16Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-2/+2
- Compatible with Emscripten 1.38.46-upstream or later upstream. - Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the old incorrect wasm32 C call ABI with the correct one, preserving the old one as wasm32_bindgen_compat for wasm-bindgen compatibility. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
2019-10-05Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, ↵Tyler Mandry-2/+2
r=alexcrichton" This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
2019-10-04Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-2/+2
- Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the incorrect wasm32 C call ABI with the old asmjs version, which is correct for both wasm32 and JS. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Temporarily makes Emscripten targets use panic=abort by default because supporting unwinding will require an LLVM patch.
2019-09-05Move tests for unit tests to their own directoryMatthew Jasper-0/+247
2019-09-05Make use of hygiene in AST passesMatthew Jasper-0/+52