about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-07-13add array tests, cleanup, tidy, and blessRalf Jung-11/+30
2022-07-13assigning to a union field can never drop nowRalf Jung-19/+3
2022-07-13remove untagged_union feature gateRalf Jung-373/+349
2022-07-13also allow arrays of allowed typesRalf Jung-4/+8
2022-07-13allow unions with mutable references and tuples of allowed typesRalf Jung-7/+37
2022-07-13Rollup merge of #99155 - Amanieu:unstable-target-features, r=davidtwcoDylan DPC-0/+29
Keep unstable target features for asm feature checking Inline assembly uses the target features to determine which registers are available on the current target. However it needs to be able to access unstable target features for this. Fixes #99071
2022-07-13Rollup merge of #99030 - rust-lang:notriddle/field-recovery, r=petrochenkovDylan DPC-10/+19
diagnostics: error messages when struct literals fail to parse If an expression is supplied where a field is expected, the parser can become convinced that it's a shorthand field syntax when it's not. This PR addresses it by explicitly recording the permitted `:` token immediately after the identifier, and also adds a suggestion to insert the name of the field if it looks like a complex expression. Fixes #98917
2022-07-13Rollup merge of #99011 - oli-obk:UnsoundCell, r=eddybDylan DPC-452/+85
`UnsafeCell` blocks niches inside its nested type from being available outside fixes #87341 This implements the plan by `@eddyb` in https://github.com/rust-lang/rust/issues/87341#issuecomment-886083646 Somewhat related PR (not strictly necessary, but that cleanup made this PR simpler): #94527
2022-07-13Rollup merge of #98574 - dingxiangfei2009:let-else-thir, r=oli-obkDylan DPC-21/+205
Lower let-else in MIR This MR will switch to lower let-else statements in MIR building instead. To lower let-else in MIR, we build a mini-switch two branches. One branch leads to the matching case, and the other leads to the `else` block. This arrangement will allow temporary lifetime analysis running as-is so that the temporaries are properly extended according to the same rule applied to regular `let` statements. cc https://github.com/rust-lang/rust/issues/87335 Fix #98672
2022-07-13Limit test to x86 targets for reproducabilityOli Scherer-0/+1
2022-07-13Rollup merge of #99168 - TaKO8Ki:add-regression-test-for-74713, r=Dylan-DPCGuillaume Gomez-0/+30
Add regression test for #74713 closes #74713
2022-07-13Rollup merge of #99020 - fee1-dead-contrib:repr_transparent_non_exhaustive, ↵Guillaume Gomez-0/+241
r=oli-obk check non_exhaustive attr and private fields for transparent types Fixes #78586.
2022-07-12Rollup merge of #98972 - ↵Dylan DPC-0/+174
TaKO8Ki:suggest-adding-missing-zero-to-floating-point-number, r=compiler-errors Suggest adding a missing zero to a floating point number fixes #98836
2022-07-12Rollup merge of #98633 - c410-f3r:yet-another-let-chain, r=estebankDylan DPC-293/+803
Fix last `let_chains` blocker In order to forbid things like `let x = (let y = 1);` or `if let a = 1 && { let x = let y = 1; } {}`, the parser **HAS** to know the context of `let`. This context thing is not a surprise in the parser because you can see **a lot** of ad hoc fixes mixing parsing logic with validation logic creating code that looks more like spaghetti with tomato sauce. To make things even greater, a new ad hoc fix was added to only allow `let`s in a valid `let_chains` context by checking the previously processed token. This was the only solution I could think of and believe me, I thought about it for a long time 👍 In the long term, it should be preferable to segregate different responsibilities or create a more robust and cleaner parser framework. cc https://github.com/rust-lang/rust/pull/94927 cc https://github.com/rust-lang/rust/issues/53667
2022-07-12add more testsDeadbeef-18/+122
2022-07-12check non_exhaustive attr and private fields for transparent typesDeadbeef-0/+137
2022-07-12Always check Cell alongside with `UnsafeCell`Oli Scherer-1/+12
2022-07-12Use some more visible sigils than `,`Oli Scherer-16/+16
2022-07-12add regression test for #74713Takayuki Maeda-0/+30
2022-07-12implement a suggestion for a floating point number with a type suffixTakayuki Maeda-2/+126
2022-07-11add tests for async awaitDing Xiang Fei-0/+147
2022-07-11lower let-else in MIR insteadDing Xiang Fei-21/+58
2022-07-11Rollup merge of #99161 - fee1-dead-contrib:compile-test-edition-trim, r=jyn514Matthias Krüger-1/+1
compiletest: trim edition before passing as flag This makes `edition: 2021` work instead of the ugly `edition:2021` one has to write.
2022-07-11Rollup merge of #99146 - compiler-errors:issue-61525, r=lcnrMatthias Krüger-5/+59
Do not error during method probe on `Sized` predicates for types that aren't the method receiver Fixes #61525 This is safe even though we're skipping an error because we end up confirming the method, which means we're still checking the `Sized` predicate in the end. It just means that we don't emit an erroneous message as below: ``` error: the `query` method cannot be invoked on a trait object --> src/lib.rs:14:11 | 14 | 1.query::<dyn ToString>("") | ^^^^^ | = note: another candidate was found in the following trait, perhaps add a `use` for it: `use crate::Example;` ``` Also fixes erroneously suggesting the same trait over again, as seen in the `issue-35976.rs` UI test.
2022-07-11Rollup merge of #99124 - compiler-errors:issue-99122, r=oli-obkMatthias Krüger-0/+45
Fix sized check ICE in asm check Fixes (beta nominated, so doesn't close) #99122 1. Moves a check for unresolved inference variables to _before_ other checks that could possibly ICE. We're not changing behavior here, just doing the same thing earlier in the function. 2. Erases region variables in sized check (which are not resolved at this point) because rustc will also ICE when region vars are passed to a query which does not canonicalize them.
2022-07-11Rollup merge of #99075 - danobi:dup_type_hint_sugg, r=petrochenkovMatthias Krüger-24/+0
Fix duplicated type annotation suggestion Before, there was more or less duplicated suggestions to add type hints. Fix by clearing more generic suggestions when a more specific suggestion is possible. This fixes #93506 .
2022-07-11Fix sized check ICE in intrisicckMichael Goulet-0/+45
2022-07-11Auto merge of #98637 - cjgillot:bare-trait-anon-lt, r=petrochenkovbors-0/+49
Create fresh lifetime parameters for bare fn trait too The current code fails to account for the equivalence between `dyn FnMut(&mut u8)` and bare `FnMut(&mut u8)`, and treated them differently. This PR introduces a special case for `Fn` traits, which are always fully resolved. Fixes #98616 Fixes #98726 This will require a beta-backport, as beta contains that bug. r? `@petrochenkov`
2022-07-11compiletest: trim edition before passing as flagDeadbeef-1/+1
This makes `edition: 2021` work instead of the ugly `edition:2021` one has to write.
2022-07-11Only check relative sizes on platform specific typesOli Scherer-37/+32
2022-07-11tidyOli Scherer-1/+4
2022-07-11Simplify size checkingOli Scherer-39/+31
2022-07-11Don't allow accidental runtime-checksOli Scherer-51/+50
2022-07-11Add test for issue 99071Amanieu d'Antras-0/+29
2022-07-11tidyOli Scherer-4/+16
2022-07-11Make tests work on 32 bit and 64 bitOli Scherer-19/+22
2022-07-11Show sizes in error outputOli Scherer-1/+3
2022-07-11Rename assertion macroOli Scherer-27/+27
2022-07-11Simplify assertion macroOli Scherer-29/+28
2022-07-11Move checks to compile-timeOli Scherer-1/+8
2022-07-11Hide niches in SIMD types, tooOli Scherer-0/+8
2022-07-11Rollup merge of #99147 - compiler-errors:issue-55673, r=lcnrDylan DPC-3/+24
Mention similarly named associated type even if it's not clearly in supertrait Due to query cycle avoidance, we sometimes restrict the candidates in `complain_about_assoc_type_not_found` too much so that we can't detect typo replacements from just supertraits. This creates a more general note of the existence of a similarly named associated type from _all_ visible traits when possible. Fixes #55673
2022-07-11Rollup merge of #99091 - compiler-errors:private-types-should-stay-private, ↵Dylan DPC-1/+47
r=lcnr Do not mention private types from other crates as impl candidates Fixes #99080
2022-07-11Rollup merge of #98907 - compiler-errors:plz-no-float, r=oli-obkDylan DPC-0/+34
Deny float const params even when `adt_const_params` is enabled Supersedes #98825 Fixes #98813 r? ``@oli-obk``
2022-07-11Rollup merge of #98882 - compiler-errors:explain-doc-comments-in-macros, ↵Dylan DPC-2/+8
r=davidtwco explain doc comments in macros a bit Open to suggestions on improving this... macro parsing is very foreign to me. Should we have a structured suggestion to turn them into their regular non-doc comments? Fixes #92846 Fixes #97850
2022-07-11Do not mention private Self types from other cratesMichael Goulet-1/+47
2022-07-11Mention similarly named associated type even if it's not clearly in supertraitMichael Goulet-3/+24
2022-07-11Do not suggest same trait over againMichael Goulet-5/+0
2022-07-11Use fake substs to check for `Self: Sized` predicates on method receiversMichael Goulet-0/+59
2022-07-11Deny floats even when adt_const_params is enabledMichael Goulet-0/+34