about summary refs log tree commit diff
path: root/tests/ui/issues
AgeCommit message (Collapse)AuthorLines
2023-05-12Note base types of coercionMichael Goulet-4/+4
2023-05-09tidy check to find misc files in ui tests, and clean up the resultsasquared31415-7/+6
2023-05-09Rollup merge of #111021 - c410-f3r:dqewdas, r=petrochenkovMatthias Krüger-560/+0
Move some tests r? ``@petrochenkov``
2023-05-09Rollup merge of #110583 - Ezrashaw:tweak-make-mut-spans, r=estebankDylan DPC-5/+4
tweak "make mut" spans when assigning to locals Work towards fixing #106857 This PR just cleans up a lot of spans which is helpful before properly fixing the issues. Best reviewed commit-by-commit. r? `@estebank`
2023-05-09Rollup merge of #110504 - compiler-errors:tweak-borrow-sugg, r=cjgillotDylan DPC-25/+38
Tweak borrow suggestion span Avoids a `span_to_snippet` call when we don't need to surround the expression in parentheses. The fact that the suggestion was using the whole span of the expression rather than just appending a `&` was prevented me from using `// run-rustfix` in another PR (https://github.com/rust-lang/rust/pull/110432#discussion_r1170500484). Also some drive-by renames of functions that have been annoying me for a bit.
2023-05-08Move testsCaio-560/+0
2023-05-08Rollup merge of #111056 - JohnBobbo96:fix_box_suggestions, r=compiler-errorsDylan DPC-0/+46
Fix some suggestions where a `Box<T>` is expected. This fixes #111011, and also adds a suggestion for boxing a unit type when a `Box<T>` was expected and an empty block was found.
2023-05-08Make suggest_deref_or_ref return a multipart suggestionMichael Goulet-8/+12
2023-05-08Tweak borrow suggestionMichael Goulet-17/+26
2023-05-07Fix suggestion for boxing an async closure body, andJohn Bobbo-0/+46
also add a suggestion for boxing empty blocks.
2023-05-05tweak "make mut" spans (No. 2)Ezra Shaw-1/+1
2023-05-05tweak "make mut" spans when assigning to localsEzra Shaw-4/+3
2023-05-03Rollup merge of #111146 - petrochenkov:decident, r=compiler-errorsManish Goregaokar-5/+13
rustc_middle: Fix `opt_item_ident` for non-local def ids Noticed while working on https://github.com/rust-lang/rust/pull/110855.
2023-05-03Rollup merge of #97594 - WaffleLapkin:array_tuple_conv, r=ChrisDentonManish Goregaokar-3/+10
Implement tuple<->array convertions via `From` This PR adds the following impls that convert between homogeneous tuples and arrays of the corresponding lengths: ```rust impl<T> From<[T; 1]> for (T,) { ... } impl<T> From<[T; 2]> for (T, T) { ... } /* ... */ impl<T> From<[T; 12]> for (T, T, T, T, T, T, T, T, T, T, T, T) { ... } impl<T> From<(T,)> for [T; 1] { ... } impl<T> From<(T, T)> for [T; 2] { ... } /* ... */ impl<T> From<(T, T, T, T, T, T, T, T, T, T, T, T)> for [T; 12] { ... } ``` IMO these are quite uncontroversial but note that they are, just like any other trait impls, insta-stable.
2023-05-03rustc_middle: Fix `opt_item_ident` for non-local def idsVadim Petrochenkov-5/+13
2023-05-02Implement negative boundsMichael Goulet-2/+2
2023-05-02--bless testsMaybe Waffle-3/+10
2023-05-01Rip it outNilstrieb-54/+9
My type ascription Oh rip it out Ah If you think we live too much then You can sacrifice diagnostics Don't mix your garbage Into my syntax So many weird hacks keep diagnostics alive Yet I don't even step outside So many bad diagnostics keep tyasc alive Yet tyasc doesn't even bother to survive!
2023-04-27Fix a bad binop error when we need a callMichael Goulet-4/+5
2023-04-27Provide RHS type hint when reporting operator errorMichael Goulet-2/+2
2023-04-21Ensure mir_drops_elaborated_and_const_checked when requiring codegen.Camille GILLOT-0/+1
2023-04-21Rollup merge of #110555 - compiler-errors:subst-missing-trait-items, r=cjgillotMatthias Krüger-1/+1
Substitute missing trait items suggestion correctly Properly substitute missing item suggestions, so that when they reference generics from their parent trait they actually have the right time for the impl. Also, some other minor tweaks like using `/* Type */` to signify a GAT's type is actually missing, and fixing generic arg suggestions for GATs in general.
2023-04-20Move test filesCaio-344/+0
2023-04-19Substitute missing item suggestion correctlyMichael Goulet-1/+1
2023-04-19Auto merge of #110393 - fee1-dead-contrib:rm-const-traits, r=oli-obkbors-10/+19
Rm const traits in libcore See [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/.60const.20Trait.60.20removal.20or.20rework) * [x] Bless ui tests * [ ] Re constify some unstable functions with workarounds if they are needed
2023-04-16fix library and rustdoc testsDeadbeef-10/+19
2023-04-15Add some reasons why tests are ignored.Eric Huss-2/+2
2023-04-14Fortify tests againts mir-opts.Camille GILLOT-66/+0
2023-04-12Special-case item attributes in the suggestion outputEsteban Küber-15/+0
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-18/+36
2023-04-11Split implied and super predicate queriesMichael Goulet-12/+2
2023-04-11Auto merge of #110092 - clubby789:builtin-macros-translatable, r=compiler-errorsbors-2/+2
Migrate most of `rustc_builtin_macros` to diagnostic impls cc #100717 This is a couple of days work, but I decided to stop for now before the PR becomes too big. There's around 50 unresolved failures when `rustc::untranslatable_diagnostic` is denied, which I'll finish addressing once this PR goes thtough A couple of outputs have changed, but in all instances I think the changes are an improvement/are more consistent with other diagnostics (although I'm happy to revert any which seem worse)
2023-04-11Rollup merge of #109923 - ElectrifyPro:visibility, r=wesleywiserYuki Okushi-5/+9
Update `error [E0449]: unnecessary visibility qualifier` to be more clear This updates the error message `error[E0449]: unnecessary visibility qualifier` by clearly indicating that visibility qualifiers already inherit their visibility from a parent item. The error message previously implied that the qualifiers were permitted, which is not the case anymore. Resolves #109822.
2023-04-10Migrate most of `rustc_builtin_macros` to diagnostic implsclubby789-2/+2
Co-authored-by: Joe ST <joe@fbstj.net> Co-authored-by: Michael Goulet <michael@errs.io>
2023-04-08Tweak tuple indexing suggestionMichael Goulet-1/+16
2023-04-07update tests/uiickk-1/+1
2023-04-03Update ui tests involving invalid visibility qualifiersTam Pham-5/+9
2023-04-03remove invalid ignore-prettyPietro Albini-4/+0
2023-03-27Use the FnPtr trait to avoid implementing common traits via macrosOli Scherer-20/+0
2023-03-21evaluate: improve and fix recursion depth handlinglcnr-17/+17
2023-03-15error-msg: impl better suggestion for `E0532`Ezra Shaw-1/+1
2023-03-11Rollup merge of #104363 - WaffleLapkin:bonk_box_new, r=NilstriebMatthias Krüger-2/+0
Make `unused_allocation` lint against `Box::new` too Previously it only linted against `box` syntax, which likely won't ever be stabilized, which is pretty useless. Even now I'm not sure if it's a meaningful lint, but it's at least something :shrug: This means that code like the following will be linted against: ```rust Box::new([1, 2, 3]).len(); f(&Box::new(1)); // where f : &i32 -> () ``` The lint works by checking if a `Box::new` (or `box`) expression has an a borrow adjustment, meaning that the code that first stores the box in a variable won't be linted against: ```rust let boxed = Box::new([1, 2, 3]); // no lint boxed.len(); ```
2023-03-09Propagate expected return type instead of real return type in check_binopMichael Goulet-5/+32
2023-03-08may not => cannotMichael Goulet-2/+2
2023-03-06Bless the remaining ui testsMu42-1/+19
2023-03-03Remove some useless `#[allow()]`s in testsMaybe Waffle-2/+0
2023-02-25Rollup merge of #107675 - jsgf:link-directives, r=davidtwcoMichael Goulet-0/+10
Implement -Zlink-directives=yes/no `-Zlink-directives=no` will ignored `#[link]` directives while compiling a crate, so nothing is emitted into the crate's metadata. The assumption is that the build system already knows about the crate's native dependencies and can provide them at link time without these directives. This is another way to address issue # #70093, which is currently addressed by `-Zlink-native-libraries` (implemented in #70095). The latter is implemented at link time, which has the effect of ignoring `#[link]` in *every* crate. This makes it a very large hammer as it requires all native dependencies to be known to the build system to be at all usable, including those in sysroot libraries. I think this means its effectively unused, and definitely under-used. Being able to control this on a crate-by-crate basis should make it much easier to apply when needed. I'm not sure if we need both mechanisms, but we can decide that later. cc `@pcwalton` `@cramertj`
2023-02-24Rollup merge of #108401 - notriddle:notriddle/diagnostics-article, ↵Dylan DPC-10/+10
r=compiler-errors diagnostics: remove inconsistent English article "this" from E0107 Consider [`tests/ui/const-generics/generic_const_exprs/issue-102768.stderr`][issue-102768.stderr], the error message where it gives additional notes about where the associated type is defined, and how the dead code lint doesn't have an article, like in [`tests/ui/lint/dead-code/issue-85255.stderr`][issue-85255.stderr]. They don't have articles, so it seems unnecessary to have one here. [issue-102768.stderr]: https://github.com/rust-lang/rust/blob/07c993eba8b76eae497e98433ae075b00f01be10/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr [issue-85255.stderr]: https://github.com/rust-lang/rust/blob/07c993eba8b76eae497e98433ae075b00f01be10/tests/ui/lint/dead-code/issue-85255.stderr
2023-02-24Rollup merge of #106923 - mejrs:fluent_err, r=davidtwcoDylan DPC-0/+41
Restore behavior when primary bundle is missing Fixes https://github.com/rust-lang/rust/issues/106755 by restoring some of the behavior prior to https://github.com/rust-lang/rust/pull/106427 Still, I have no idea how this debug assertion can even hit while using `en-US` as primary bundle. r? ```@davidtwco```
2023-02-23diagnostics: remove inconsistent English article "this" from E0107Michael Howell-10/+10
Consider `tests/ui/const-generics/generic_const_exprs/issue-102768.stderr`, the error message where it gives additional notes about where the associated type is defined, and how the dead code lint doesn't have an article, like in `tests/ui/lint/dead-code/issue-85255.stderr`. They don't have articles, so it seems unnecessary to have one here.