about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-09-16Rollup merge of #101868 - ↵Guillaume Gomez-15/+15
notriddle:notriddle/short-links-jump-to-definition, r=GuillaumeGomez rustdoc: use more precise URLs for jump-to-definition links As an example, this cuts down <https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/mod.rs.html> by about 11%. $ du -h new_mod.rs.html old_mod.rs.html 296K new_mod.rs.html 332K old_mod.rs.html Like https://github.com/rust-lang/rust/pull/83237, but separate code since source links have a different URL structure. Related to [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/RFC.20for.20.22jump.20to.20definition.22.20feature/near/299029786) and [the jump-to-definition pre-RFC](https://github.com/GuillaumeGomez/rfcs/pull/1).
2022-09-16Rollup merge of #101843 - chenyukang:fix-101797, r=oli-obkGuillaume Gomez-0/+28
Suggest associated const for incorrect use of let in traits Fixes #101797
2022-09-16Rollup merge of #101809 - aDotInTheVoid:jsondoclint, r=GuillaumeGomezDylan DPC-0/+10
Replace `check_missing_items.py` with `jsondoclint` [zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E) check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing. ### Motivation 1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly. 2. Better Errors: - Multiple Errors can be emited for a single crate - Errors can say where in JSON they occored ``` 2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]' 2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]' ``` 3. Catches more bugs. - Because matches are exaustive, all posible variants considered for enums - All Id's checked - Has already found #101770, #101199 and #100973 - Id type is also checked, so the Id's in a structs fields can only be field items. 4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point. cc ``@CraftSpider`` r? ``@GuillaumeGomez``
2022-09-16Rollup merge of #101753 - oli-obk:tait_closure_args, r=compiler-errorsDylan DPC-9/+48
Prefer explict closure sig types over expected ones fixes #100800 Previously we only checked that given closure arguments are equal to expected closure arguments, but now we choose the given closure arguments for the signature that is used when type checking the closure body, and keep the other signature for the type of the closure as seen outside of it.
2022-09-16Rollup merge of #101738 - dpaoliello:linkname, r=petrochenkovDylan DPC-0/+137
Fix `#[link kind="raw-dylib"]` to respect `#[link_name]` Issue Details: When using `#[link kind="raw-dylib"]` (#58713), the Rust compiler ignored any `#[link_name]` attributes when generating the import library and so the resulting binary would fail to link due to missing symbols. Fix Details: Use the name from `#[link_name]` if present when generating the `raw-dylib` import library, otherwise default back to the actual symbol name.
2022-09-16Bless ui tests after typeck code changeDeadbeef-123/+101
2022-09-16do const trait method bounds check later in rustc_const_evalDeadbeef-63/+89
2022-09-16bless testsDeadbeef-163/+228
2022-09-16Add testDeadbeef-0/+23
2022-09-16do not suggest a placeholder to const and static without a typeTakayuki Maeda-0/+28
2022-09-15Auto merge of #101831 - compiler-errors:issue-75899, r=jackh726bors-0/+39
Normalize struct field types in `confirm_builtin_unsize_candidate` Fixes #75899 --- edited to move the normalization into `confirm_builtin_unsize_candidate` instead of the coercion code.
2022-09-15rustdoc: fix test casesMichael Howell-15/+15
2022-09-15Remove the let_else feature gate from the testsuiteest31-78/+62
Result of running: rg -l "feature.let_else" src/test/ | xargs sed -s -i "s#^...feature.let_else..\$##" Plus manual tidy fixes.
2022-09-15Remove feature gate from let else suggestionest31-8/+8
The let else suggestion added by 0d92752b8aac53e033541d04fc7d9677d8bca227 does not need a feature gate any more.
2022-09-15Stabilize the let_else featureest31-19/+8
2022-09-16tweak suggestionyukang-1/+1
2022-09-15Future-proof against loose bounds if default variant is non-exhaustive.Daniel Henry-Mantilla-1/+32
Co-Authored-By: Mark Rousskov <mark.simulacrum@gmail.com>
2022-09-15Auto merge of #101410 - dingxiangfei2009:fix-let-else-scoping, r=jackh726bors-1/+22
Reorder nesting scopes and declare bindings without drop schedule Fix #99228 Fix #99975 Storages are previously not declared before entering the `else` block of a `let .. else` statement. However, when breaking out of the pattern matching into the `else` block, those storages are recorded as scheduled for drops. This is not expected. This MR fixes this issue by not scheduling the drops for those storages. cc `@est31`
2022-09-15more tweak on diagnostic messagesyukang-21/+53
2022-09-15fix 101793, fix the wording of help msg for bitwise notyukang-6/+16
2022-09-15fix #101797: Suggest associated const for incorrect use of let in traitsyukang-0/+28
2022-09-15correct span, add help message and add UI test when query depth overflowsSparrowLii-0/+42
2022-09-15Rollup merge of #101828 - aDotInTheVoid:test-101743, r=jshaMatthias Krüger-0/+19
Add test for #101743 The issue was closes as we stopped rendering `const`s like this, but if we move back to doing that, make sure we don't accidently generate tags
2022-09-15Rollup merge of #101778 - notriddle:notriddle/docblock-short-p, r=GuillaumeGomezMatthias Krüger-32/+20
rustdoc: clean up DOM by removing `.dockblock-short p` On https://doc.rust-lang.org/nightly/std/ this reduces the number out of `document.querySelectorAll("*").length` from 1278 to 1103. Preview: https://notriddle.com/notriddle-rustdoc-test/docblock-short-p/std/index.html
2022-09-15Rollup merge of #101740 - andrewpollack:add-ignore-fuchsia-ui-tests, r=tmandryMatthias Krüger-0/+6
Adding ignore-fuchsia arg to non-applicable compiler ui tests Adding `ignore-fuchsia` flag to tests involving `std::process::Command` calls, and `execve` calls
2022-09-15enclose else block in terminating scopeDing Xiang Fei-2/+1
2022-09-15add test for #99975Ding Xiang Fei-0/+20
2022-09-15reorder nesting scopes and declare bindings without drop scheduleDing Xiang Fei-1/+3
2022-09-15Normalize struct types in confirm_builtin_unsize_candidateMichael Goulet-0/+39
2022-09-15Auto merge of #101620 - cjgillot:compute_lint_levels_by_def, r=oli-obkbors-19/+74
Compute lint levels by definition Lint levels are currently computed once for the whole crate. Any code that wants to emit a lint depends on this single `lint_levels(())` query. This query contains the `Span` for each attribute that participates in the lint level tree, so any code that wants to emit a lint basically depends on the spans in all files in the crate. Contrary to hard errors, we do not clear the incremental session on lints, so this implicit world dependency pessimizes incremental reuse. (And is furthermore invisible for allowed lints.) This PR completes https://github.com/rust-lang/rust/pull/99634 (thanks for the initial work `@fee1-dead)` and includes it in the dependency graph. The design is based on 2 queries: 1. `lint_levels_on(HirId) -> FxHashMap<LintId, LevelAndSource>` which accesses the attributes at the given `HirId` and processes them into lint levels. The `TyCtxt` is responsible for probing the HIR tree to find the user-visible level. 2. `lint_expectations(())` which lists all the `#[expect]` attributes in the crate. This PR also introduces the ability to reconstruct a `HirId` from a `DepNode` by encoding the local part of the `DefPathHash` and the `ItemLocalId` in the two `u64` of the fingerprint. This allows for the dep-graph to directly recompute `lint_levels_on` directly, without having to force the calling query. Closes https://github.com/rust-lang/rust/issues/95094. Supersedes https://github.com/rust-lang/rust/pull/99634.
2022-09-14Remove noop from test that expects no noopAndrew Pollack-3/+1
2022-09-14Add test for #101743Nixon Enraght-Moony-0/+19
2022-09-14rustdoc: add test cases for turning ``[Vec<T>]`` into ``[`Vec<T>`]``Michael Howell-1/+43
2022-09-14Auto merge of #101212 - eholk:dyn-star, r=compiler-errorsbors-3/+134
Initial implementation of dyn* This PR adds extremely basic and incomplete support for [dyn*](https://smallcultfollowing.com/babysteps//blog/2022/03/29/dyn-can-we-make-dyn-sized/). The goal is to get something in tree behind a flag to make collaboration easier, and also to make sure the implementation so far is not unreasonable. This PR does quite a few things: * Introduce `dyn_star` feature flag * Adds parsing for `dyn* Trait` types * Defines `dyn* Trait` as a sized type * Adds support for explicit casts, like `42usize as dyn* Debug` * Including const evaluation of such casts * Adds codegen for drop glue so things are cleaned up properly when a `dyn* Trait` object goes out of scope * Adds codegen for method calls, at least for methods that take `&self` Quite a bit is still missing, but this gives us a starting point. Note that this is never intended to become stable surface syntax for Rust, but rather `dyn*` is planned to be used as an implementation detail for async functions in dyn traits. Joint work with `@nikomatsakis` and `@compiler-errors.` r? `@bjorn3`
2022-09-14Bless ui test.Camille GILLOT-11/+66
2022-09-14Disallow defaults on type GATsJack Huey-0/+54
2022-09-14Compute `lint_levels` by definitionDeadbeef-8/+8
2022-09-14address review againb-naber-374/+12
2022-09-14Rustdoc-Json: Add test for extern_typesNixon Enraght-Moony-0/+10
2022-09-14change AccessLevels representationBryanskiy-114/+106
2022-09-14Rollup merge of #101779 - eholk:drop-tracking-test-output, r=jyn514Dylan DPC-72/+372
Update test output for drop tracking #97334 has a lot of updates to test outputs that makes the PR larger than it needs to be. This PR pulls those changes out so we can keep the other one as simple as possible. r? `@jyn514`
2022-09-14Prefer explict closure sig types over expected onesOli Scherer-9/+48
2022-09-13Use Predicate ConstraintCategory when normalizingJack Huey-0/+133
2022-09-13Better errors for implied static boundJack Huey-0/+67
2022-09-13rustdoc: clean up DOM by removing `.dockblock-short p`Michael Howell-32/+20
On https://doc.rust-lang.org/nightly/std/ this reduces the number out of `document.querySelectorAll("*").length` from 1278 to 1103.
2022-09-13Update parsing testEric Holk-3/+3
2022-09-13Update must_not_suspend/ref.rsEric Holk-10/+37
2022-09-13Update partial-drop-partial-reinit.rsEric Holk-7/+45
2022-09-13Update issue-65436-raw-ptr-not-send.rsEric Holk-6/+10
2022-09-13Update issue-70935-complex-spans.rsEric Holk-10/+11