about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-07-13Emit warning when named arguments are used positionally in formatPreston From-0/+199
Addresses Issue 98466 by emitting a warning if a named argument is used like a position argument (i.e. the name is not used in the string to be formatted). Fixes rust-lang#98466
2022-07-13Auto merge of #99210 - Dylan-DPC:rollup-879cp1t, r=Dylan-DPCbors-483/+338
Rollup of 5 pull requests Successful merges: - #98574 (Lower let-else in MIR) - #99011 (`UnsafeCell` blocks niches inside its nested type from being available outside) - #99030 (diagnostics: error messages when struct literals fail to parse) - #99155 (Keep unstable target features for asm feature checking) - #99199 (Refactor: remove an unnecessary `span_to_snippet`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-13use gathered body_owners in par_body_ownersMiguel Guarniz-190/+190
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-13Auto merge of #98145 - ouz-a:some_branch, r=oli-obkbors-200/+195
Pull Derefer before ElaborateDrops _Follow up work to #97025 #96549 #96116 #95887 #95649_ This moves `Derefer` before `ElaborateDrops` and creates a new `Rvalue` called `VirtualRef` that allows us to bypass many constraints for `DerefTemp`. r? `@oli-obk`
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-13Add feature gate.Camille GILLOT-3/+91
2022-07-13Bless ui-fulldeps tests.Camille GILLOT-3/+3
2022-07-13Always use CreateParameter mode for function definitions.Camille GILLOT-32/+30
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-13Use `&{self.x}` for packed `Copy` structs.Nicholas Nethercote-20/+6
Because it's more concise than the `let` form.
2022-07-12add test for implicit stuff in signatures of closures with `for<>`Maybe Waffle-0/+134
2022-07-12Lower closure binders to hir & properly check themMaybe Waffle-72/+33
2022-07-12ignore wasm=32 & blessouz-a-130/+133
2022-07-12--bless testsMaybe Waffle-9/+42
2022-07-12Parse closure bindersMaybe Waffle-0/+151
This is first step in implementing RFC 3216. - Parse `for<'a>` before closures in ast - Error in lowering - Add `closure_lifetime_binder` feature
2022-07-12Rollup merge of #99171 - GuillaumeGomez:rustdoc-ui-test-regex, r=Dylan-DPCDylan DPC-0/+4
Put back UI test regex I just realized I overwrote these two commits in https://github.com/rust-lang/rust/pull/99055 when force pushing to fix the stdout output... r? `@Dylan-DPC`
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-12Rollup merge of #98622 - petrochenkov:executables, r=oli-obkDylan DPC-1/+1
rustc_target: Flip the default for `TargetOptions::executables` to true This flag is true for most targets and the remaining targets may be mistakes.
2022-07-12add new rval, pull deref earlyouz-a-76/+68
2022-07-12add more testsDeadbeef-18/+122
2022-07-12check non_exhaustive attr and private fields for transparent typesDeadbeef-0/+137
2022-07-12Update -zhelp and -chelp rustdoc-ui tests to use regex-error-patternGuillaume Gomez-0/+4
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 #99142 - ↵Matthias Krüger-0/+16
notriddle:notriddle/doctest-multiline-crate-attributes, r=GuillaumeGomez fix(doctest): treat fatal parse errors as incomplete attributes Fixes #99089
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-25/+1
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-11Rollup merge of #99055 - GuillaumeGomez:rustdoc-help-options, r=jyn514Matthias Krüger-0/+254
Fix rustdoc help options Fixes #98976. Since you're the one who found out about the problem and also provided the solution (thanks for both!): r? ```@jyn514```
2022-07-11rustc_target: Flip the default for `TargetOptions::executables` to trueVadim Petrochenkov-1/+1
Also change `executables` to true for linux-kernel and windows-uwp-gnu targets
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