about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-11-20Rollup merge of #104435 - scottmcm:iter-repeat-n, r=thomccYuki Okushi-0/+56
`VecDeque::resize` should re-use the buffer in the passed-in element Today it always copies it for *every* appended element, but one of those clones is avoidable. This adds `iter::repeat_n` (https://github.com/rust-lang/rust/issues/104434) as the primitive needed to do this. If this PR is acceptable, I'll also use this in `Vec` rather than its custom `ExtendElement` type & infrastructure that is harder to share between multiple different containers: https://github.com/rust-lang/rust/blob/101e1822c3e54e63996c8aaa014d55716f3937eb/library/alloc/src/vec/mod.rs#L2479-L2492
2022-11-19rustdoc: fix test caseMichael Howell-1/+1
2022-11-19rustdoc: add test case for scraped example expand GUIMichael Howell-0/+61
2022-11-19Auto merge of #104470 - ehuss:cdb-dupe-last-command, r=jyn514bors-1/+1
Don't duplicate last cdb debuginfo test command cdb scripts interpret a blank line to mean "repeat the last command", similar to what happens when running the debugger from a console. The code for compiletest that constructs the debugger script was inserting a blank line between the last command and the "quit" command. This caused the last command to be executed twice. This can cause some confusion since the `-check` lines are expecting the output in a certain order. But printing the last command twice causes that order-assumption to fail, and that can cause confusion. This fixes it by removing the blank line. AFAICT, gdb and lldb scripts don't have the same behavior with blank lines (and the gdb code doesn't add any blank lines anyways).
2022-11-19Use `type_ascribe!` in many UI testsNilstrieb-224/+198
Use it in all UI tests that are about the semantics and not the syntax of type ascription.
2022-11-19fix test errouz-a-3/+4
2022-11-19re-add test and blessouz-a-1/+31
2022-11-19revert-overflowouz-a-39/+8
2022-11-19Refactor `must_use` lint into two partsNilstrieb-33/+56
Before, the lint did the checking for `must_use` and pretty printing the types in a special format in one pass, causing quite complex and untranslatable code. Now the collection and printing is split in two. That should also make it easier to translate or extract the type pretty printing in the future. Also fixes an integer overflow in the array length pluralization calculation.
2022-11-19Auto merge of #102795 - lukas-code:constify-is-aligned-via-align-offset, ↵bors-0/+58
r=oli-obk Constify `is_aligned` via `align_offset` Alternative to https://github.com/rust-lang/rust/pull/102753 Make `align_offset` work in const eval (and not always return `usize::MAX`) and then use that to constify `is_aligned{_to}`. Tracking Issue: https://github.com/rust-lang/rust/issues/104203
2022-11-19Add a UI test to ensure rustc doesn't do arithmetic overflowsMahmoud Mazouz-0/+45
This relies on the CI testing a rustc that's compiled with overflow-checks = true
2022-11-19fix assembly test on appleLukas Markeffsky-5/+5
2022-11-19fix assembly test on windowsLukas Markeffsky-10/+10
2022-11-19always use `align_offset` in `is_aligned_to` + add assembly testLukas Markeffsky-0/+58
2022-11-19Rollup merge of #104593 - compiler-errors:rpitit-object-safety-spans, ↵Matthias Krüger-6/+46
r=fee1-dead Improve spans for RPITIT object-safety errors No reason why we can't point at the `impl Trait` that causes the object-safety violation. Also [drive-by: Add is_async fn to hir::IsAsync](https://github.com/rust-lang/rust/pull/104593/commits/c4165f3a965e258531928180195637455299c6f3), which touches clippy too.
2022-11-19Rollup merge of #104577 - GuillaumeGomez:remove-focus-on-blur, r=notriddleMatthias Krüger-0/+30
Don't focus on notable trait parent when hiding it I clicked on a notable trait icon so the popup remained and then clicked on the settings menu. When the settings menu was blurred, it scrolled back to when the notable trait was, which isn't great. r? `@notriddle`
2022-11-19Rollup merge of #104497 - lyming2007:issue-104379-fix, r=fee1-deadMatthias Krüger-1/+20
detect () to avoid redundant <> suggestion for type fix #104379
2022-11-19Rollup merge of #104469 - estebank:long-types, r=oli-obkMatthias Krüger-48/+55
Make "long type" printing type aware and trim types in E0275 Instead of simple string cutting, use a custom printer to hide parts of long printed types. On E0275, check for type length before printing.
2022-11-19Extend GUI test to check notable traits blur behaviourGuillaume Gomez-0/+30
2022-11-19Auto merge of #103509 - compiler-errors:opaques-w-bound-vars-r-hard, r=oli-obkbors-0/+47
Revert "Normalize opaques with escaping bound vars" This caused a perf regression in #103423, cc `@skyzh` this should fix #103423. reverts #100980 r? `@oli-obk`
2022-11-19Rollup merge of #104580 - notriddle:notriddle/issue-102354-hide-sugg, ↵Dylan DPC-9/+4
r=compiler-errors diagnostics: only show one suggestion for method -> assoc fn Fixes #102354
2022-11-19Rollup merge of #104575 - lcnr:dedup-tests, r=jackh726Dylan DPC-39/+9
deduplicate tests originally added in #100514. Using revisions for this reduces the amount of tests in the repo
2022-11-19Rollup merge of #104554 - BoxyUwU:less_unchecked_pls, r=lcnrDylan DPC-2/+1
Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less there are only like 3 or 4 call sites left after this but it wasnt obvious to me how to remove them
2022-11-19Rollup merge of #104411 - lcnr:bivariance-nll, r=compiler-errorsDylan DPC-0/+26
nll: correctly deal with bivariance fixes #104409 when in a bivariant context, relating stuff should always trivially succeed. Also changes the mir validator to correctly deal with higher ranked regions. r? types cc ``@RalfJung``
2022-11-19Probe + better error messsage for need_migrate_deref_output_trait_objectMichael Goulet-2/+2
2022-11-19Improve spans for RPITIT object-safety errorsMichael Goulet-6/+46
2022-11-18Auto merge of #104591 - Manishearth:rollup-b3ser4e, r=Manishearthbors-5/+211
Rollup of 8 pull requests Successful merges: - #102977 (remove HRTB from `[T]::is_sorted_by{,_key}`) - #103378 (Fix mod_inv termination for the last iteration) - #103456 (`unchecked_{shl|shr}` should use `u32` as the RHS) - #103701 (Simplify some pointer method implementations) - #104047 (Diagnostics `icu4x` based list formatting.) - #104338 (Enforce that `dyn*` coercions are actually pointer-sized) - #104498 (Edit docs for `rustc_errors::Handler::stash_diagnostic`) - #104556 (rustdoc: use `code-header` class to format enum variants) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-18Rollup merge of #104556 - notriddle:notriddle/variant, r=GuillaumeGomezManish Goregaokar-5/+10
rustdoc: use `code-header` class to format enum variants The font size and weights should be exactly the same after this PR, but the spacing is changed to be the same as methods. Preview: http://notriddle.com/notriddle-rustdoc-demos/variant/test_dingus_enum/enum.TestEnum.html
2022-11-18Rollup merge of #104338 - compiler-errors:pointer-sized, r=eholkManish Goregaokar-0/+115
Enforce that `dyn*` coercions are actually pointer-sized Implement a perma-unstable, rudimentary `PointerSized` trait to enforce `dyn*` casts are `usize`-sized for now, at least to prevent ICEs and weird codegen issues from cropping up after monomorphization since currently we enforce *nothing*. This probably can/should be removed in favor of a more sophisticated trait for handling `dyn*` conversions when we decide on one, but I just want to get something up for discussion and experimentation for now. r? ```@eholk``` cc ```@tmandry``` (though feel free to claim/reassign) Fixes #102141 Fixes #102173
2022-11-18Rollup merge of #103456 - scottmcm:fix-unchecked-shifts, r=scottmcmManish Goregaokar-0/+66
`unchecked_{shl|shr}` should use `u32` as the RHS The other shift methods, such as https://doc.rust-lang.org/nightly/std/primitive.u64.html#method.checked_shr and https://doc.rust-lang.org/nightly/std/primitive.i16.html#method.wrapping_shl, use `u32` for the shift amount. That's consistent with other things, like `count_ones`, which also always use `u32` for a bit count, regardless of the size of the type. This PR changes `unchecked_shl` and `unchecked_shr` to also use `u32` for the shift amount (rather than Self). cc #85122, the `unchecked_math` tracking issue
2022-11-18Rollup merge of #102977 - lukas-code:is-sorted-hrtb, r=m-ou-seManish Goregaokar-0/+20
remove HRTB from `[T]::is_sorted_by{,_key}` Changes the signature of `[T]::is_sorted_by{,_key}` to match `[T]::binary_search_by{,_key}` and make code like https://github.com/rust-lang/rust/issues/53485#issuecomment-885393452 compile. Tracking issue: https://github.com/rust-lang/rust/issues/53485 ~~Do we need an ACP for something like this?~~ Edit: Filed ACP here: https://github.com/rust-lang/libs-team/issues/121
2022-11-18rustc_codegen_ssa: Fix for codegen_get_discrMichael Benfield-5/+38
When doing the optimized implementation of getting the discriminant, the arithmetic needs to be done in the tag type so wrapping behavior works correctly. Fixes #104519
2022-11-18Auto merge of #104573 - matthiaskrgr:rollup-k36ybtp, r=matthiaskrgrbors-162/+299
Rollup of 8 pull requests Successful merges: - #101162 (Migrate rustc_resolve to use SessionDiagnostic, part # 1) - #103386 (Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting)) - #103405 (Detect incorrect chaining of if and if let conditions and recover) - #103594 (Fix non-associativity of `Instant` math on `aarch64-apple-darwin` targets) - #104006 (Add variant_name function to `LangItem`) - #104494 (Migrate GUI test to use functions) - #104516 (rustdoc: clean up sidebar width CSS) - #104550 (fix a typo) Failed merges: - #104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less) r? `@ghost` `@rustbot` modify labels: rollup
2022-11-18Workaround for private global symbol issueDaniel Paoliello-0/+16
2022-11-18Check both align and size in PointerSizedMichael Goulet-0/+48
2022-11-18Enforce that dyn* casts are actually pointer-sizedMichael Goulet-0/+67
2022-11-18Add testMichael Goulet-0/+47
2022-11-18diagnostics: only show one suggestion for method -> assoc fnMichael Howell-9/+4
Fixes #102354
2022-11-18Add a detailed note for missing comma in FRU syntax typoMichael Goulet-19/+65
2022-11-18Auto merge of #101562 - nnethercote:shrink-ast-Expr-harder, r=petrochenkovbors-116/+122
Shrink `ast::Expr` harder r? `@ghost`
2022-11-18Only use `...` instead of `_` for type elisionEsteban Küber-5/+5
`_` might confuse people into believing that the type isn't known, while `...` is not used anywhere else for types and is not valid syntax, making it more likely to convey the right understanding.
2022-11-18On E0275 do not print out the full type in the msgEsteban Küber-4/+4
When printing requirement overflow errors, do not print out the full type name when it is longer than 50 characters long.
2022-11-18On overflow errors, do not print out long typesEsteban Küber-23/+35
2022-11-18Make "long type" printing type awareEsteban Küber-21/+16
Instead of simple string cutting, use a custom printer to hide parts of long printed types.
2022-11-18deduplicate testslcnr-39/+9
2022-11-18rename `is_tainted_by_errors` Boxy-2/+1
2022-11-18Rollup merge of #104494 - GuillaumeGomez:migrate-gui-test-to-func, r=notriddleMatthias Krüger-162/+87
Migrate GUI test to use functions r? `@notriddle`
2022-11-18Rollup merge of #103405 - chenyukang:yukang/fix-103381-and-if, r=compiler-errorsMatthias Krüger-0/+168
Detect incorrect chaining of if and if let conditions and recover Fixes #103381
2022-11-18Rollup merge of #103386 - compiler-errors:no-coerceunsized-to-dynstar, r=eholkMatthias Krüger-0/+44
Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting) This makes sure we don't accidentally allow coercions like `Box<T>` -> `Box<dyn* Trait>`, or in the case of this ICE, `&T` to `&dyn* Trait`. These coercions don't make sense, at least not via the `CoerceUnsized` trait. Fixes #102172 Fixes #102429
2022-11-18Auto merge of #104555 - matthiaskrgr:rollup-tncyca8, r=matthiaskrgrbors-65/+311
Rollup of 11 pull requests Successful merges: - #103852 (Don't remap early-bound regions for return-position `impl Trait` in trait originating from `impl`) - #104366 (Simplify settings theme choice) - #104433 (Fix `emit_unused_delims_expr` ICE) - #104444 (Fix ICE in in_operand for ty error) - #104483 (Convert predicates into Predicate in the Obligation constructor) - #104496 (Don't attempt to normalize compiler backtraces) - #104503 (rustdoc: remove redundant font-color CSS on `.where`) - #104508 (Check `dyn*` return type correctly) - #104515 (ICE fixing, remove is_tainted_by_errors since we have ty_error for delay bug) - #104532 (Migrate tooltip style to CSS variables) - #104545 (Readd the matches_macro diag item) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup