about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-08-15Auto merge of #100569 - matthiaskrgr:rollup-9450lzs, r=matthiaskrgrbors-69/+128
Rollup of 6 pull requests Successful merges: - #100211 (Refuse to codegen an upstream static.) - #100277 (Simplify format_args builtin macro implementation.) - #100483 (Point to generic or arg if it's the self type of unsatisfied projection predicate) - #100506 (change `InlineAsmCtxt` to not talk about `FnCtxt`) - #100534 (Make code slightly more uniform) - #100566 (Use `create_snapshot_for_diagnostic` instead of `clone` for `Parser`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-16suggest adding an array length if possibleTakayuki Maeda-19/+111
2022-08-15Rollup merge of #100483 - compiler-errors:point-to-projection-too, r=jyn514Matthias Krüger-69/+128
Point to generic or arg if it's the self type of unsatisfied projection predicate We do this for `TraitPredicate`s in `point_at_type_arg_instead_of_call_if_possible` and `point_at_arg_instead_of_call_if_possible`, so also do it for `ProjectionPredicate`. Improves spans for a lot of unit tests.
2022-08-15suggest adding a missing semicolon before an itemTakayuki Maeda-0/+205
2022-08-15Auto merge of #96745 - ehuss:even-more-attribute-validation, r=cjgillotbors-1/+1306
Visit attributes in more places. This adds 3 loosely related changes (I can split PRs if desired): - Attribute checking on pattern struct fields. - Attribute checking on struct expression fields. - Lint level visiting on pattern struct fields, struct expression fields, and generic parameters. There are still some lints which ignore lint levels in various positions. This is a consequence of how the lints themselves are implemented. For example, lint levels on associated consts don't work with `unused_braces`.
2022-08-14suggest lazy-static for non-const staticscameron-0/+9
2022-08-14Update the minimum external LLVM to 13Josh Stone-6/+0
2022-08-14Suggest as_ref or as_mutMichael Goulet-4/+4
2022-08-14Also do it for genericsMichael Goulet-10/+10
2022-08-14Point to argument if it's self type of unsatisfied projection predicateMichael Goulet-59/+118
2022-08-14Rollup merge of #100526 - Nilstrieb:tests!, r=Mark-SimulacrumMatthias Krüger-0/+145
Add tests for the drop behavior of some control flow constructs In #100513 it was shown that the drop behaviour of let_chains is not correct currently. Since drop behaviour is something pretty subtle, this adds explicit tests for the drop behavior of `if`, `if let` and `match` to make sure that it does not regress in the future. The `println!`s were left in to make debugging easier in case something goes wrong, but they are not required for the test.
2022-08-14Rollup merge of #100253 - obeis:issue-100197, r=cjgillotMatthias Krüger-0/+20
Recover from mutable variable declaration where `mut` is placed before `let` Closes #100197
2022-08-14Add tests for the drop behavior of some control flow constructsNilstrieb-0/+145
In #100513 it was shown that the drop behavior of let_chains is not correct currently. Since drop behavior is something pretty subtle, this adds explicit tests for the drop behavior of `if`, `if let` and `match` to make sure that it does not regress in the future. The `println!`s were left in to make debugging easier in case something goes wrong, but they are not required for the test.
2022-08-14Rollup merge of #100487 - tmiasko:assert-safe, r=petrochenkovDylan DPC-6/+6
`assert_{inhabited,zero_valid,uninit_valid}` intrinsics are safe Those intrinsics either panic or do nothing. They are safe.
2022-08-14Rollup merge of #100115 - obeis:issue-99910, r=cjgillotDylan DPC-0/+30
Suggest removing `let` if `const let` or `let const` is used Closes #99910
2022-08-14Rollup merge of #99861 - lcnr:orphan-check-cg, r=jackh726Dylan DPC-0/+29
orphan check: rationalize our handling of constants cc `@rust-lang/types` `@rust-lang/project-const-generics` on whether you agree with this reasoning. r? types
2022-08-14Rollup merge of #99582 - compiler-errors:issue-99566, r=cjgillotDylan DPC-0/+28
Delay a span bug if we see ty/const generic params during writeback Fixes #99566
2022-08-14Emit noundef even for unoptimised code if msan is on5225225-2/+8
2022-08-14Enable eager checks for memory sanitizer5225225-3/+38
2022-08-13Rollup merge of #100479 - compiler-errors:argument-type-error-improvements, ↵Michael Goulet-16/+70
r=lcnr Argument type error improvements Motivated by this interesting code snippet: ```rust #[derive(Copy, Clone)] struct Wrapper<T>(T); fn foo(_: fn(i32), _: Wrapper<i32>) {} fn f(_: u32) {} fn main() { let w = Wrapper::<isize>(1isize); foo(f, w); } ``` Which currently errors like: ``` error[E0308]: arguments to this function are incorrect --> src/main.rs:10:5 | 10 | foo(f, w); | ^^^ - - expected `i32`, found `isize` | | | expected `i32`, found `u32` | = note: expected fn pointer `fn(i32)` found fn item `fn(u32) {f}` = note: expected struct `Wrapper<i32>` found struct `Wrapper<isize>` note: function defined here --> src/main.rs:4:4 | 4 | fn foo(_: fn(i32), _: Wrapper<i32>) {} | ^^^ ---------- --------------- ``` Specifically, that double `expected .. found ..` which is very difficult to correlate to the types in the arguments. Also, the fact that "expected `i32`, found `isize`" and the other argument mismatch label don't even really explain what's going on here. After this PR: ``` error[E0308]: arguments to this function are incorrect --> $DIR/two-mismatch-notes.rs:10:5 | LL | foo(f, w); | ^^^ | note: expected fn pointer, found fn item --> $DIR/two-mismatch-notes.rs:10:9 | LL | foo(f, w); | ^ = note: expected fn pointer `fn(i32)` found fn item `fn(u32) {f}` note: expected struct `Wrapper`, found a different struct `Wrapper` --> $DIR/two-mismatch-notes.rs:10:12 | LL | foo(f, w); | ^ = note: expected struct `Wrapper<i32>` found struct `Wrapper<isize>` note: function defined here --> $DIR/two-mismatch-notes.rs:4:4 | LL | fn foo(_: fn(i32), _: Wrapper<i32>) {} | ^^^ ---------- --------------- error: aborting due to previous error For more information about this error, try `rustc --explain E0308`. ``` Yeah, it's a bit verbose, but much clearer IMO. --- Open to discussions about how this could be further improved. Motivated by `@jyn514's` [tweet](https://mobile.twitter.com/joshuayn514/status/1558042020601634816) here.
2022-08-13Rollup merge of #100446 - ↵Michael Goulet-0/+29
TaKO8Ki:suggest-removing-semicolon-after-impl-trait-items, r=compiler-errors Suggest removing a semicolon after impl/trait items fixes #99822
2022-08-13Rollup merge of #100431 - compiler-errors:enum-ctor-variant-stab, r=estebankMichael Goulet-0/+16
Enum variant ctor inherits the stability of the enum variant Fixes #100399 Fixes #100420 Context #71481 for why enum variants don't need stability
2022-08-13Rollup merge of #100367 - fmease:fix-100365, r=compiler-errorsMichael Goulet-37/+357
Suggest the path separator when a dot is used on a trait Fixes #100365. `@rustbot` label A-diagnostics r? diagnostics
2022-08-13Rollup merge of #99646 - compiler-errors:arg-mismatch-single-arg-label, ↵Michael Goulet-42/+107
r=estebank Only point out a single function parameter if we have a single arg incompatibility Fixes #99635
2022-08-13Delay span bug when failing to normalize negative coherence impl subject due ↵Michael Goulet-0/+59
to other malformed impls
2022-08-13Rollup merge of #100509 - BoxyUwU:merge_hrtb_with_higher_rank_trait_bound, ↵Michael Goulet-0/+0
r=compiler-errors merge two test directories that mean the same thing hopefully `hrtb` doesnt have a secret second meaning that i'm not aware of :laughing: r? `@compiler-errors`
2022-08-13Rollup merge of #100475 - chenyukang:fix-100461, r=fee1-deadMichael Goulet-0/+44
Give a helpful diagnostic when the next struct field has an attribute Fixes #100461
2022-08-13Rollup merge of #100445 - krasimirgg:llvm-16-msan, r=tmiaskoMichael Goulet-1/+1
adapt test for msan message change LLVM commit https://github.com/llvm/llvm-project/commit/057cabd997aeaef136e1e14f2ee645bd5bb197dd removed the function from the msan error message. This adapts our test accordingly. Found via our experimental rust + llvm @ HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12634#018289fe-b0bc-4bab-89b3-fb1d4e38f6db
2022-08-13Rollup merge of #100438 - compiler-errors:issue-100360, r=lcnrMichael Goulet-0/+25
Erase regions better in `promote_candidate` Use `tcx.erase_regions` instead of manually walking through the substs.... this also makes the code slightly simpler :see_no_evil: Fixes #100360 Fixes #89851
2022-08-13Rollup merge of #100434 - compiler-errors:issue-100373, r=cjgillotMichael Goulet-0/+28
Fix HIR pretty printing of let else Fixes #100373 Fixes #99318 Fixes #99319
2022-08-13moveEllen-0/+0
2022-08-13Do not inline non-simple argument type errors into labelsMichael Goulet-13/+64
2022-08-13Label argument coercion errorsMichael Goulet-3/+6
2022-08-13Ban references to `Self` in trait object substs for projection predicates too.Camille GILLOT-1/+8
2022-08-13use `span_suggestion` instead of `span_suggestion_verbose`Takayuki Maeda-7/+4
2022-08-13give a helpful diagnostic even when the next struct field has an attributeyukang-0/+44
2022-08-13`assert_{inhabited,zero_valid,uninit_valid}` intrinsics are safeTomasz Miąsko-6/+6
Those intrinsics either panic or do nothing. They are safe.
2022-08-12Adjust span of fn argumentsMichael Goulet-20/+14
2022-08-12Adjust span of closure paramMichael Goulet-1/+1
2022-08-12And for closuresMichael Goulet-3/+3
2022-08-12Point out a single arg if we have a single arg incompatibilityMichael Goulet-39/+104
2022-08-12enum variant ctor inherits stability of variantMichael Goulet-0/+16
2022-08-12Rollup merge of #100443 - est31:let_else_regression_tests, r=Mark-SimulacrumDylan DPC-0/+62
Add two let else regression tests Adds a regression test for #94176, as it was fixed by #98574 but doesn't have a regression test. The PR also incorporates a commit from #94012 which added a test for an issue discovered in that PR. Originally they have been part of #99291, but I've moved them out in the hopes of getting them merged more quickly, as that PR is already open since a month, and so that #99291 can focus on the drop order part of things. Closes #94176 Closes #96961 -- dupe of #94176
2022-08-12Rollup merge of #100396 - chenyukang:fix-100394, r=petrochenkovDylan DPC-0/+14
Suggest const and static for global variable Fixing #100394
2022-08-12Rollup merge of #100247 - cjgillot:verify-dyn-trait-alias-defaults, r=lcnrDylan DPC-53/+101
Generalize trait object generic param check to aliases. The current algorithm only checks that `Self` does not appear in defaults for traits. This is not sufficient for trait aliases. This PR moves the check to trait object elaboration, which sees through trait aliases. Fixes https://github.com/rust-lang/rust/issues/82927. Fixes https://github.com/rust-lang/rust/issues/84789.
2022-08-12Rollup merge of #100229 - RalfJung:extra-const-ub-checks, r=lcnrDylan DPC-0/+116
add -Zextra-const-ub-checks to enable more UB checking in const-eval Cc https://github.com/rust-lang/rust/issues/99923 r? `@oli-obk`
2022-08-12improve "try ignoring the field" diagnosticGoldstein-0/+56
Closes #95795
2022-08-12suggest removing a semicolon after impl/trait itemsTakayuki Maeda-0/+32
2022-08-12adapt test for msan message changeKrasimir Georgiev-1/+1
LLVM commit https://github.com/llvm/llvm-project/commit/057cabd997aeaef136e1e14f2ee645bd5bb197dd removed the function from the msan error message. This adapts our test accordingly. Found via our experimental rust + llvm @ HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/12634#018289fe-b0bc-4bab-89b3-fb1d4e38f6db
2022-08-12Add regression test for #94176est31-0/+29