about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2023-01-03Add regression test for #104064Guillaume Gomez-0/+21
2023-01-03Rollup merge of #106365 - gimbles:patch-1, r=jyn514Matthias Krüger-10/+10
Grammar : Missing "is" in format specifier diagnostic
2023-01-03Rollup merge of #106005 - LeSeulArtichaut:if-let-guard-borrowck-test, ↵Matthias Krüger-62/+645
r=Nilstrieb Test the borrowck behavior of if-let guards Add some tests to make sure that if-let guards behave the same as if guards with respect to borrow-checking. Most of them are a naive adaptation, replacing an `if` guard with `if let Some(())`. This includes regression tests for notable issues that arose for if guards (#24535, #27282, #29723, #31287) as suggested in https://github.com/rust-lang/rust/issues/51114#issuecomment-900470419. cc `@pnkfelix` are there any other tests that you would want to see? cc tracking issue #51114
2023-01-03Auto merge of #105609 - bjorn3:shrink_rustc_dev, r=jyn514bors-0/+95
Only include metadata for non-dynamic libraries in rustc-dev The actual object code should be linked from librustc_driver.so, which is still included in rustc-dev. This saves on download time and disk usage. Fixes https://github.com/rust-lang/rust/issues/103538
2023-01-03Auto merge of #106371 - RalfJung:no-ret-position-noalias, r=nikicbors-1/+1
do not add noalias in return position `noalias` as a return attribute in LLVM indicates that the returned pointer does not alias anything else that is reachable from the caller, *including things reachable before this function call*. This is clearly not the case with a function like `fn id(Box<T>) -> Box<T>`, so we cannot use this attribute. Fixes https://github.com/rust-lang/unsafe-code-guidelines/issues/385 (including an actual miscompilation that `@comex` managed to produce).
2023-01-03Auto merge of #106386 - compiler-errors:rollup-dxjv18b, r=compiler-errorsbors-122/+627
Rollup of 8 pull requests Successful merges: - #95985 (Add PhantomData marker to Context to make Context !Send and !Sync) - #104298 (Add notes and examples about non-intuitive `PathBuf::set_extension` behavior) - #105558 (Reduce HIR debug output) - #106315 (Cleanup `mingw-tidy` docker job) - #106354 (Rustdoc-Json: Report discriminant on all kinds of enum variant.) - #106366 (Fix rustdoc ICE on bad typedef with mismatching types) - #106376 (Update books) - #106383 (Document some of the AST nodes) Failed merges: - #106356 (clean: Remove `ctor_kind` from `VariantStruct`.) r? `@ghost` `@rustbot` modify labels: rollup
2023-01-02Rollup merge of #106366 - ↵Michael Goulet-0/+496
GuillaumeGomez:fix-rustdoc-ice-typedef-type-mismatch, r=notriddle Fix rustdoc ICE on bad typedef with mismatching types Fixes https://github.com/rust-lang/rust/issues/106226. Fixes #105742. Fixes #105737. Fixes #105334. Fixes #96287. In this case, it's ok to replace the panic with `rustc_error::raise` because the compiler provided us with a `Error`. r? `@notriddle`
2023-01-02Rollup merge of #106354 - aDotInTheVoid:rdj-always-discr, r=GuillaumeGomezMichael Goulet-116/+130
Rustdoc-Json: Report discriminant on all kinds of enum variant. Closes https://github.com/rust-lang/rust/issues/106299 Probably easier to review one commit at a time. r? `@GuillaumeGomez`
2023-01-02Rollup merge of #105558 - Nilstrieb:less-spam-hir-tree, r=cjgillotMichael Goulet-6/+1
Reduce HIR debug output HIR debug output is currently very verbose, especially when used with the alternate (`#`) flag. This commit reduces the amount of noisy newlines by forcing a few small key types to stay on one line, which makes the output easier to read and scroll by. ``` $ rustc +after hello_world.rs -Zunpretty=hir-tree | wc -l 582 $ rustc +before hello_world.rs -Zunpretty=hir-tree | wc -l 932 ```
2023-01-03Don't trim path for `unsafe_op_in_unsafe_fn` lintsLéo Lanteri Thauvin-0/+21
2023-01-02Add json output to `-Zdump-mono-stats`Joshua Nelson-1/+8
This allows analyzing the output programatically; for example, finding the item with the highest `total_estimate`. I also took the liberty of adding `untracked` tests to `rustc_session` and documentation to the unstable book for `dump-mono-items`.
2023-01-02Auto merge of #106364 - JakobDegen:top-down-inlining, r=cjgillotbors-91/+184
Reenable limited top-down MIR inlining Reverts most of #105119 and uses an alternative strategy to prevent exponential blowup. Specifically, we allow doing top-down inlining up to depth at most five, and for at most one call site per nested body. r? `@cjgillot`
2023-01-02Reduce HIR debug outputNilstrieb-6/+1
HIR debug output is currently very verbose, especially when used with the alternate (`#`) flag. This commit reduces the amount of noisy newlines by forcing a few small key types to stay on one line, which makes the output easier to read and scroll by. ``` $ rustc +after hello_world.rs -Zunpretty=hir-tree | wc -l 582 $ rustc +before hello_world.rs -Zunpretty=hir-tree | wc -l 932 ```
2023-01-02Auto merge of #106272 - clubby789:codegen-test-103840, r=nikicbors-0/+9
Add codegen test for issue 103840 Closes #103840
2023-01-02do not add noalias in return positionRalf Jung-1/+1
2023-01-02Add regression test for #96287Guillaume Gomez-0/+32
2023-01-02Add regression test for #105742Guillaume Gomez-0/+425
2023-01-02Add regression test for #105737Guillaume Gomez-0/+16
2023-01-02Add regression test for #105334Guillaume Gomez-0/+11
2023-01-02Add regression test for #106226Guillaume Gomez-0/+12
2023-01-02Auto merge of #84762 - cjgillot:resolve-span-opt, r=petrochenkovbors-120/+13
Encode spans relative to the enclosing item -- enable on nightly Follow-up to #84373 with the flag `-Zincremental-relative-spans` set by default. This PR seeks to remove one of the main shortcomings of incremental: the handling of spans. Changing the contents of a function may require redoing part of the compilation process for another function in another file because of span information is changed. Within one file: all the spans in HIR change, so typechecking had to be re-done. Between files: spans of associated types/consts/functions change, so type-based resolution needs to be re-done (hygiene information is stored in the span). The flag `-Zincremental-relative-spans` encodes local spans relative to the span of an item, stored inside the `source_span` query. Trap: stashed diagnostics are referenced by the "raw" span, so stealing them requires to remove the span's parent. In order to avoid too much traffic in the span interner, span encoding uses the `ctxt_or_tag` field to encode: - the parent when the `SyntaxContext` is 0; - the `SyntaxContext` when the parent is `None`. Even with this, the PR creates a lot of traffic to the Span interner, when a Span has both a LocalDefId parent and a non-root SyntaxContext. They appear in lowering, when we add a parent to all spans, including those which come from macros, and during inlining when we mark inlined spans. The last commit changes how queries of `LocalDefId` manage their cache. I can put this in a separate PR if required. Possible future directions: - validate that all spans are marked in HIR validation; - mark macro-expanded spans relative to the def-site and not the use-site.
2023-01-02Print correct base for too-large literalsclubby789-24/+70
Also update tests
2023-01-02maybegimbles-10/+10
2023-01-02Auto merge of #106301 - notriddle:notriddle/dir-entry, r=GuillaumeGomezbors-4/+85
rustdoc: use the regular arrow indicator for dir-entry CSS This mostly reverts 468acca108e65101b802821bded17149dc1d86c9, while still fixing the problem it fixed by using an internal list-style-position. It results in a slight change in the hover indicator, but nothing misleading. Preview: http://notriddle.com/notriddle-rustdoc-demos/dir-entry/src/std/lib.rs.html ## Before ![image](https://user-images.githubusercontent.com/1593513/210104247-642e6df0-07d3-452a-a2ab-4c700bc22e0e.png) ## After ![image](https://user-images.githubusercontent.com/1593513/210104271-a3832784-1e4d-4516-983e-6ecb9051857b.png)
2023-01-02Auto merge of #106284 - estebank:merge-mut-errors, r=jyn514bors-226/+435
Merge multiple mutable borrows of immutable binding errors Fix #53466.
2023-01-01Reenable limited top-down MIR inliningJakob Degen-91/+184
2023-01-01Verbose suggestionsEsteban Küber-185/+360
2023-01-01Always take advantage of arithmetic identitiesBen Kimock-0/+46
2023-01-01rustdoc: add test case for dir entry summary positionMichael Howell-4/+85
2023-01-01Implement fix for #67535Troy Neubauer-0/+61
2023-01-01Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726bors-10/+10
Use the correct tracking issue for `dyn_star` `#![feature(dyn_star)]` now has its own tracking issue, #102425.
2023-01-01Rustdoc-Json: Report discriminant on all kinds of enum variant.Nixon Enraght-Moony-116/+130
Closes #106299
2023-01-01Use the correct tracking issue for `dyn_star`Léo Lanteri Thauvin-10/+10
2023-01-01Auto merge of #106350 - GuillaumeGomez:gui-test-explanation-2, r=notriddlebors-0/+1
Add comment explaining what docblock-table GUI test is about r? `@notriddle`
2023-01-01Merge multiple mutable borrows of immutable binding errorsEsteban Küber-53/+87
Fix #53466.
2023-01-01reduce spans for `unsafe impl` errorsLukas Markeffsky-26/+12
2023-01-01Add comment explaining what docblock-table GUI test is aboutGuillaume Gomez-0/+1
2022-12-31Auto merge of #106336 - matthiaskrgr:rollup-4p6bgwf, r=matthiaskrgrbors-0/+1
Rollup of 4 pull requests Successful merges: - #106280 (docs: add link to `Path::join` in `PathBuf::push`) - #106297 (rustdoc: merge scrape-help CSS) - #106328 (Add comment explaining what the GUI scrape-examples-fonts test is about) - #106334 (Fix tidy unittest.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-31Rollup merge of #106328 - GuillaumeGomez:gui-test-explanation, r=notriddleMatthias Krüger-0/+1
Add comment explaining what the GUI scrape-examples-fonts test is about r? `@notriddle`
2022-12-31Auto merge of #106282 - Ezrashaw:merge-e0465, r=estebankbors-24/+24
refactor: merge error code `E0465` into `E0464` `E0465` is an undocumented and untested error code that is functionally identical to `E0464`. This PR merges `E0465` into `E0464`, thus documenting and testing another error code (#61137). r? `@GuillaumeGomez` (not sure if you want to review this but it's relevant to my other PRs that you have reviewed)
2022-12-31Add missing extern crate rustc_driverbjorn3-0/+62
2022-12-31Add help for the error message when missing rustc_driverbjorn3-0/+33
2022-12-31Auto merge of #106302 - compiler-errors:terr-coerce-w-infer, r=estebankbors-72/+31
Suppress errors due to TypeError not coercing with inference variables Fixes #75331 Fixes #68507 Fixes #82323 cc `@estebank`
2022-12-31Add comment explaining what the GUI scrape-examples-fonts test is aboutGuillaume Gomez-0/+1
2022-12-31Auto merge of #106245 - estebank:mutability-suggestions, r=jyn514bors-160/+326
Use verbose suggestions for mutability errors
2022-12-31refactor: merge `E0465` into `E0464`Ezra Shaw-24/+24
2022-12-30Rollup merge of #106295 - ↵Michael Goulet-0/+14
GuillaumeGomez:extend-scraped-examples-layout-test, r=notriddle Extend scraped examples layout GUI test for position of buttons This is a regression test for https://github.com/rust-lang/rust/pull/106279. r? ````@notriddle````
2022-12-30Rollup merge of #106248 - dtolnay:revertupcastlint, r=jackh726Michael Goulet-93/+9
Revert "Implement allow-by-default `multiple_supertrait_upcastable` lint" This is a clean revert of #105484. I confirmed that reverting that PR fixes the regression reported in #106247. ~~I can't say I understand what this code is doing, but maybe it can be re-landed with a different implementation.~~ **Edit:** https://github.com/rust-lang/rust/issues/106247#issuecomment-1367174384 has an explanation of why #105484 ends up surfacing spurious `where_clause_object_safety` errors. The implementation of `where_clause_object_safety` assumes we only check whether a trait is object safe when somebody actually uses that trait with `dyn`. However the implementation of `multiple_supertrait_upcastable` added in the problematic PR involves checking *every* trait for whether it is object-safe. FYI `@nbdd0121` `@compiler-errors`
2022-12-30Rollup merge of #106232 - maurer:transparent-subst, r=rcvalleMichael Goulet-3/+19
CFI: Monomorphize transparent ADTs before typeid Monomorphise `#[repr(transparent)]` parameterized ADTs before turning them into an Itanium mangled String. `#[repr(transparent)]` ADTs currently use the single field to represent them in their CFI type ID to ensure that they are compatible. However, if that type involves a type parameter instantiated at the ADT level, as in `ManuallyDrop`, this will currently ICE as the `Parameter` type cannot be mangled. Since this happens at lowering time, it should always be concrete after substitution. Fixes #106230
2022-12-30Add ui test for #106182Obei Sideg-0/+46