about summary refs log tree commit diff
path: root/tests/ui
AgeCommit message (Collapse)AuthorLines
2023-10-20Rename lots of files that had `generator` in their nameOli Scherer-81/+81
2023-10-20Rename `Gen` to `Coro` in testsOli Scherer-12/+12
2023-10-20s/generator/coroutine/Oli Scherer-601/+601
2023-10-20s/Generator/Coroutine/Oli Scherer-292/+292
2023-10-20Mention `into_iter` on borrow errors suggestions when appropriateEsteban Küber-0/+4
If we encounter a borrow error on `vec![1, 2, 3].iter()`, suggest `into_iter`. Fix #68445.
2023-10-20Typo suggestion to change bindings with leading underscoreEsteban Küber-0/+24
When encountering a binding that isn't found but has a typo suggestion for a binding with a leading underscore, suggest changing the binding definition instead of the use place. Fix #60164.
2023-10-20Auto merge of #116965 - estebank:issue-65329, r=cjgillotbors-19/+64
Move where doc comment meant as comment check The new place makes more sense and covers more cases beyond individual statements. ``` error: expected one of `.`, `;`, `?`, `else`, or an operator, found doc comment `//!foo --> $DIR/doc-comment-in-stmt.rs:25:22 | LL | let y = x.max(1) //!foo | ^^^^^^ expected one of `.`, `;`, `?`, `else`, or an operator | help: add a space before `!` to write a regular comment | LL | let y = x.max(1) // !foo | + ``` Fix #65329.
2023-10-20Move `invalid-llvm-passes` test to `invalid-compile-flags` folderMiguel Ojeda-0/+0
Nowadays there is an `invalid-compile-flags` folder, thus move this one there. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-10-20Fix a span for one of the test casesGeorg Semmler-29/+15
2023-10-20Invalid `?` suggestion on mismatched `Ok(T)`Ethan Brierley-0/+21
2023-10-20Avoid a `track_errors` by bubbling up most errors from `check_well_formed`Oli Scherer-168/+142
2023-10-20Auto merge of #116899 - compiler-errors:closure-sig-infer, r=lcnrbors-0/+36
Add a test showing failing closure signature inference in new solver Been thinking a bit about how to make this test pass... but we don't actually have any good tests exercising this behavior in the suite. r? lcnr
2023-10-20Move where doc comment meant as comment checkEsteban Küber-19/+64
The new place makes more sense and covers more cases beyond individual statements. ``` error: expected one of `.`, `;`, `?`, `else`, or an operator, found doc comment `//!foo --> $DIR/doc-comment-in-stmt.rs:25:22 | LL | let y = x.max(1) //!foo | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected one of `.`, `;`, `?`, `else`, or an operator | help: add a space before `!` to write a regular comment | LL | let y = x.max(1) // !foo | + ``` Fix #65329.
2023-10-20Auto merge of #116838 - gurry:116836-dup-macro-invoc-diag, r=petrochenkovbors-42/+9
Fix duplicate labels emitted in `render_multispan_macro_backtrace()` This PR replaces the `Vec` used to store labels with an `FxIndexSet` in order to eliminate duplicates Fixes #116836
2023-10-19add non-regression test for issue 116657Rémy Rakic-0/+105
2023-10-19Auto merge of #115214 - Urgau:rfc-3127-trim-paths, r=compiler-errorsbors-1/+37
Implement rustc part of RFC 3127 trim-paths This PR implements (or at least tries to) [RFC 3127 trim-paths](https://github.com/rust-lang/rust/issues/111540), the rustc part. That is `-Zremap-path-scope` with all of it's components/scopes. `@rustbot` label: +F-trim-paths
2023-10-19Improve the warning messages for the `#[diagnostic::on_unimplemented]`Georg Semmler-17/+74
This commit improves warnings emitted for malformed on unimplemented attributes by: * Improving the span of the warnings * Adding a label message to them * Separating the messages for missing and unexpected options * Adding a help message that says which options are supported
2023-10-19Rollup merge of #116908 - estebank:issue-78206, r=compiler-errorsLeón Orell Valerian Liehr-50/+52
Tweak wording of type errors involving type params Fix #78206.
2023-10-19Rollup merge of #116829 - fmease:rust-aint-c, r=compiler-errorsLeón Orell Valerian Liehr-0/+62
Make `#[repr(Rust)]` incompatible with other (non-modifier) representation hints like `C` and `simd` Read more about this change here: https://github.com/rust-lang/rust/pull/116829#issuecomment-1768618240. Fixes [after backport] #116825.
2023-10-19Rollup merge of #116663 - compiler-errors:resolve-regions, r=lcnrLeón Orell Valerian Liehr-0/+28
Don't ICE when encountering unresolved regions in `fully_resolve` We can encounter unresolved regions due to unconstrained impl lifetime arguments because `collect_return_position_impl_trait_in_trait_tys` runs before WF actually checks that the impl is well-formed. Fixes #116525
2023-10-19Fix duplicate labels emitted in `render_multispan_macro_backtrace()`Gurinder Singh-42/+9
Using hash set instead of vec to weed out duplicates
2023-10-19Suggest relaxing implicit `type Assoc: Sized;` boundEsteban Küber-0/+44
Fix #85378.
2023-10-18Tweak wording of type errors involving type paramsEsteban Küber-50/+52
Fix #78206.
2023-10-18Don't ICE when encountering unresolved regions in fully_resolveMichael Goulet-0/+28
2023-10-18Add a test showing failing closure signature inference in new solverMichael Goulet-0/+36
2023-10-18Bump COINDUCTIVE_OVERLAP_IN_COHERENCEMichael Goulet-0/+25
2023-10-18Make `#[repr(Rust)]` and `#[repr(C)]` incompatible with one anotherLeón Orell Valerian Liehr-0/+62
2023-10-18Rollup merge of #116879 - aliemjay:revert-opaque-bubble, r=oli-obkAli MJ Al-Nasrawy-3/+82
revert #114586 Reverts #114586. cc #116877 (not closing until this gets a beta backport) fixes #116684 fixes https://github.com/rust-lang/rust/pull/114586#issuecomment-1751967321 r? `@oli-obk` or `@lcnr`
2023-10-18Rollup merge of #116865 - estebank:issue-46969, r=compiler-errorsAli MJ Al-Nasrawy-0/+44
Suggest constraining assoc types in more cases Fix #46969. ``` error[E0308]: mismatched types --> $DIR/suggest-contraining-assoc-type-because-of-assoc-const.rs:12:21 | LL | const N: C::M = 4u8; | ^^^ expected associated type, found `u8` | = note: expected associated type `<C as O>::M` found type `u8` help: consider constraining the associated type `<C as O>::M` to `u8` | LL | impl<C: O<M = u8>> U<C> for u16 { | ++++++++ ```
2023-10-18Rollup merge of #116856 - oli-obk:no_effects, r=compiler-errorsAli MJ Al-Nasrawy-0/+30
Disable effects in libcore again r? `@fee1-dead` This was accidentally allowed by https://github.com/rust-lang/rust/pull/114776 without feature gates
2023-10-18Rollup merge of #116812 - ↵Ali MJ Al-Nasrawy-0/+25
rmehri01:missing_copy_implementations_non_exhaustive, r=petrochenkov Disable missing_copy_implementations lint on non_exhaustive types Fixes #116766
2023-10-18revert rust-lang/rust#114586Ali MJ Al-Nasrawy-3/+82
2023-10-18Auto merge of #116713 - estebank:issue-116703, r=compiler-errorsbors-52/+528
Properly account for self ty in method disambiguation suggestion Fix #116703.
2023-10-17Automatically enable cross-crate inlining for small functionsBen Kimock-1/+1
2023-10-17Suggest constraining assoc types in more casesEsteban Küber-0/+44
Fix #46969.
2023-10-17Auto merge of #116767 - cjgillot:alloc-normalize, r=oli-obkbors-108/+108
Normalize alloc-id in tests. AllocIds are globally numbered in a rustc invocation. This makes them very sensitive to changes unrelated to what is being tested. This commit normalizes them by renumbering, in order of appearance in the output. The renumbering allows to keep the identity, that a simple `allocN` wouldn't. This is useful when we have memory dumps. cc `@saethlin` r? `@oli-obk`
2023-10-17Disable effects in libcore againOli Scherer-0/+30
2023-10-17Unify suggestion wordingEsteban Küber-123/+90
2023-10-17review comments + more testsEsteban Küber-12/+412
2023-10-17Properly account for self ty in method disambiguation suggestionEsteban Küber-0/+109
Fix #116703.
2023-10-17Rollup merge of #116717 - estebank:issue-9082, r=oli-obkMatthias Krüger-0/+267
Special case iterator chain checks for suggestion When encountering method call chains of `Iterator`, check for trailing `;` in the body of closures passed into `Iterator::map`, as well as calls to `<T as Clone>::clone` when `T` is a type param and `T: !Clone`. Fix #9082.
2023-10-17Rollup merge of #111072 - Urgau:check-cfg-new-syntax, r=petrochenkovMatthias Krüger-121/+746
Add new simpler and more explicit syntax for check-cfg <details> <summary> Old proposition (before the MCP) </summary> This PR adds a new simpler and more explicit syntax for check-cfg. It consist of two new form: - `exhaustive(names, values)` - `configure(name, "value1", "value2", ... "valueN")` The preview forms `names(...)` and `values(...)` have implicit meaning that are not strait-forward. In particular `values(foo)`&`values(bar)` and `names(foo, bar)` are not equivalent which has created [some confusions](https://github.com/rust-lang/rust/pull/98080). Also the `names()` and `values()` form are not clear either and again created some confusions where peoples believed that `values()`&`values(foo)` could be reduced to just `values(foo)`. To fix that the two new forms are made to be explicit and simpler. See the table of correspondence: - `names()` -> `exhaustive(names)` - `values()` -> `exhaustive(values)` - `names(foo)` -> `exhaustive(names)`&`configure(foo)` - `values(foo)` -> `configure(foo)` - `values(feat, "foo", "bar")` -> `configure(feat, "foo", "bar")` - `values(foo)`&`values(bar)` -> `configure(foo, bar)` - `names()`&`values()`&`values(my_cfg)` -> `exhaustive(names, values)`&`configure(my_cfg)` Another benefits of the new syntax is that it allow for further options (like conditional checking for --cfg, currently always on) without syntax change. The two previous forms are deprecated and will be removed once cargo and beta rustc have the necessary support. </details> This PR is the first part of the implementation of [MCP636 - Simplify and improve explicitness of the check-cfg syntax](https://github.com/rust-lang/compiler-team/issues/636). ## New `cfg` form It introduces the new [`cfg` form](https://github.com/rust-lang/compiler-team/issues/636) and deprecate the other two: ``` rustc --check-cfg 'cfg(name1, ..., nameN, values("value1", "value2", ... "valueN"))' ``` ## Default built-in names and values It also changes the default for the built-in names and values checking. - Built-in values checking would always be activated as long as a `--check-cfg` argument is present - Built-in names checking would always be activated as long as a `--check-cfg` argument is present **unless** if any `cfg(any())` arg is passed ~~**Note: depends on https://github.com/rust-lang/rust/pull/111068 but is reviewable (last two commits)!**~~ Resolve https://github.com/rust-lang/compiler-team/issues/636 r? `@petrochenkov`
2023-10-17disable missing_copy_implementations lint on non_exhaustive typesRyan Mehri-0/+25
use is_variant_list_non_exhaustive/is_field_list_non_exhaustive remove unused tcx inline non_exhaustive def/variant check
2023-10-17Auto merge of #116756 - fee1-dead-contrib:dupe-those-bounds, r=oli-obkbors-32/+563
Duplicate `~const` bounds with a non-const one in effects desugaring This should unblock #116058. r? `@oli-obk`
2023-10-17[RFC 3127 - Trim Paths]: Add test for -Zremap-path-scope=diagnosticsUrgau-1/+22
2023-10-17[RFC 3127 - Trim Paths]: Add test for -Zremap-path-scope=macroUrgau-0/+15
2023-10-17Flesh out tests moreMichael Goulet-7/+143
2023-10-16Rollup merge of #116800 - compiler-errors:rpitit-gat-outlives, r=jackh726Guillaume Gomez-0/+41
Fix implied outlives check for GAT in RPITIT We enforce certain `Self: 'lt` bounds for GATs to save space for more sophisticated implied bounds, but those currently operate on the HIR. Code was easily reworked to operate on def-ids so that we can properly let these suggestions propagate through synthetic associated types like RPITITs and AFITs. r? `@jackh726` or `@aliemjay` Fixes #116789
2023-10-16Stop trying to preserve pretty-printing.Camille GILLOT-66/+66
2023-10-16Rebless.Camille GILLOT-11/+11