about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2024-12-19coverage: Add a synthetic test for when all spans are discardedZalathar-0/+37
2024-12-19coverage: Store coverage source regions as `Span` until codegenZalathar-22/+22
2024-12-18Auto merge of #134443 - joshtriplett:use-field-init-shorthand, ↵bors-4/+4
r=lqd,tgross35,nnethercote Use field init shorthand where possible Field init shorthand allows writing initializers like `tcx: tcx` as `tcx`. The compiler already uses it extensively. Fix the last few places where it isn't yet used. EDIT: this PR also updates `rustfmt.toml` to set `use_field_init_shorthand = true`.
2024-12-18Rollup merge of #134436 - taiki-e:assembly-asm-minicore, r=jieyouxu许杰友 Jieyou Xu (Joe)-489/+110
tests/assembly/asm: Remove uses of rustc_attrs and lang_items features by using minicore Similar to https://github.com/rust-lang/rust/pull/134385 (for tests/ui/asm), but for tests/assembly/asm. r? jieyouxu
2024-12-18Rollup merge of #134394 - dianne:clarify-pat-2024-migration, r=compiler-errors许杰友 Jieyou Xu (Joe)-150/+211
Clarify the match ergonomics 2024 migration lint's output This makes a few changes: - Rather than using the whole pattern as a span for the lint, this collects spans for each problematic default binding mode reset and labels them with why they're problems. - The lint's suggestions are now verbose-styled, so that it's clear what's being suggested vs. what's problematic. - The wording is now less technical, and the hard error version of this diagnostic now links to the same reference material as the lint (currently an unwritten page of the edition guide). I'm not totally confident in the wording or formatting, so I'd appreciate feedback on that in particular. I tried to draw a connection with word choice between the labels and the suggestion, but it might be imprecise, unclear, or cluttered. If so, it might be worth making the labels more terse and adding notes that explain them, but that's harder to read in a way too. cc ```@Nadrieril``` ```@Jules-Bertholet``` Closes #133854. For reference, the error from that issue becomes: ``` error: pattern uses features incompatible with edition 2024 --> $DIR/remove-me.rs:6:25 | LL | map.iter().filter(|(&(_x, _y), &_c)| false); | ^ ^ cannot implicitly match against multiple layers of reference | | | cannot implicitly match against multiple layers of reference | help: make the implied reference pattern explicit | LL | map.iter().filter(|&(&(_x, _y), &_c)| false); | + ```
2024-12-18Rollup merge of #133926 - compiler-errors:const-conditions, r=lcnr许杰友 Jieyou Xu (Joe)-13/+221
Fix const conditions for RPITITs Fixes #133918 r? lcnr
2024-12-18mir-opt: Do not handle the cleanup BB in the EarlyOtherwiseBranchDianQK-86/+49
2024-12-18mir-opt: a sub-BB of a cleanup BB must also be a cleanup BBDianQK-0/+320
2024-12-18Reapply "Auto merge of #129047 - DianQK:early_otherwise_branch_scalar, ↵DianQK-0/+247
r=cjgillot" This reverts commit 16a02664e66afbfcd738b600d4a409e809040695.
2024-12-18Fix const conditions for RPITITsMichael Goulet-13/+221
2024-12-17Add the edition guide link from the match 2024 migration lint to the error ↵dianne-0/+8
as well
2024-12-17Use field init shorthand where possibleJosh Triplett-4/+4
Field init shorthand allows writing initializers like `tcx: tcx` as `tcx`. The compiler already uses it extensively. Fix the last few places where it isn't yet used.
2024-12-17Improve the pattern migration 2024 migration lint's messagedianne-62/+62
2024-12-17Clarify the match ergonomics 2024 migration lint's outputdianne-150/+203
2024-12-17Rollup merge of #134423 - jieyouxu:bootstrap-test-valid, r=onur-ozkanMatthias Krüger-0/+4
bootstrap: use specific-purpose ui test path for `test_valid` self-test I wanted to move some ui tests around in #134418, which broke `test_valid` since it was referencing two non-specific-purpose ui tests. This PR instead adds two dummy tests under `tests/ui/bootstrap/self-test/`, for that purpose specifically. r? bootstrap
2024-12-17Rollup merge of #134408 - rmehri01:rpit-inherits-lifetime, r=compiler-errorsMatthias Krüger-0/+24
Regression test for RPIT inheriting lifetime from projection Regression test to close https://github.com/rust-lang/rust/issues/51525
2024-12-17Rollup merge of #134323 - Zalathar:dismantle-map-data, r=jieyouxuMatthias Krüger-4/+4
coverage: Dismantle `map_data.rs` by moving its responsibilities elsewhere This is a series of incremental changes that combine to let us get rid of `coverageinfo/map_data.rs`, by moving all of its responsibilities into more appropriate places. Some of the notable consequences are: - We once again build the per-CGU file table on the fly while preparing individual covfun records, instead of building the whole table up-front. The up-front approach was introduced by #117042 to work around various other problems in generating the covmap/covfun records, but subsequent cleanups have made that approach no longer necessary. - Expression conversion and mapping-region conversion are now performed directly in `mapgen::covfun`, which should make future changes easier. - We no longer insert unused function instances into the same map that is also used to track used function instances. This helps to decouple the handling of used vs unused functions. --- There should be no meaningful change to compiler output. The file table is no longer sorted, because reordering it would invalidate the file indices stored in individual covfun records, but the table order should still be deterministic (albeit arbitrary). There are some subsequent cleanups that I intend to investigate, but this is enough change for one PR.
2024-12-18tests/assembly/asm: Remove uses of rustc_attrs and lang_items features by ↵Taiki Endo-489/+110
using minicore
2024-12-17Auto merge of #130766 - clarfonthey:stable-coverage-attribute, r=wesleywiserbors-476/+362
Stabilize #[coverage] attribute Closes #84605, which passed FCP. Stabilisation report here: https://github.com/rust-lang/rust/issues/84605#issuecomment-2166514660 Also added to reference here: rust-lang/reference#1628 --- try-job: aarch64-apple try-job: x86_64-gnu try-job: x86_64-msvc
2024-12-17bootstrap: use specific-purpose ui test path许杰友 Jieyou Xu (Joe)-0/+4
I wanted to move some ui tests around, which broke `test_valid` since it was referencing a non-specific-purpose ui test.
2024-12-17Auto merge of #134414 - jhpratt:rollup-4gtfd1h, r=jhprattbors-242/+247
Rollup of 10 pull requests Successful merges: - #134202 (Remove `rustc::existing_doc_keyword` lint) - #134354 (Handle fndef rendering together with signature rendering) - #134365 (Rename `rustc_mir_build::build` to `builder`) - #134368 (Use links to edition guide for edition migrations) - #134397 (rustc_borrowck: Suggest changing `&raw const` to `&raw mut` if applicable) - #134398 (AIX: add alignment info for test) - #134400 (Fix some comments related to upvars handling) - #134406 (Fix `-Z input-stats` ordering) - #134409 (bootstrap: fix a comment) - #134412 (small borrowck cleanup) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-17Rollup merge of #134406 - nnethercote:fix-input-stats-ordering, r=jieyouxuJacob Pratt-17/+17
Fix `-Z input-stats` ordering It currently depends on the hash algorithm. r? `@Noratrieb`
2024-12-17Rollup merge of #134398 - mustartt:aix-alignment-test-fix, r=compiler-errorsJacob Pratt-0/+2
AIX: add alignment info for test Supply alignment and size info for test cases for AIX.
2024-12-17Rollup merge of #134397 - Enselic:raw-mut, r=compiler-errorsJacob Pratt-0/+5
rustc_borrowck: Suggest changing `&raw const` to `&raw mut` if applicable Closes #127562 For reference, here is the diff compared to the original error reported in that issue before #134244 stopped suggesting the invalid syntax: ``` diff --git a/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr b/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr index 0da5d15cf7f..dbe834b6b78 100644 --- a/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr +++ b/tests/ui/borrowck/no-invalid-mut-suggestion-for-raw-pointer-issue-127562.stderr ``@@`` -6,8 +6,8 ``@@`` LL | unsafe { *ptr = 3; } | help: consider changing this to be a mutable pointer | -LL | let ptr = &mut raw const val; - | +++ +LL | let ptr = &raw mut val; + | ~~~ error: aborting due to 1 previous error ```
2024-12-17Rollup merge of #134368 - ehuss:edition-links, r=jieyouxuJacob Pratt-179/+188
Use links to edition guide for edition migrations This switches the migration lints for the 2024 edition to point to the edition guide documentation instead of the tracking issues. I expect the documentation should be easier to understand for a user, compared to most of the issues which don't have any direct information, and can be a bit confusing to navigate, or have outdated information.
2024-12-17Rollup merge of #134354 - oli-obk:push-nlrxswvpqnuk, r=compiler-errorsJacob Pratt-3/+3
Handle fndef rendering together with signature rendering Pulled out of https://github.com/rust-lang/rust/pull/134353 Changes some highlighting in type mismatch errors around fndefs
2024-12-17Rollup merge of #134202 - nnethercote:rm-existing_doc_keyword, r=GuillaumeGomezJacob Pratt-43/+32
Remove `rustc::existing_doc_keyword` lint The check doesn't require a lint. r? ``@GuillaumeGomez``
2024-12-17consistently handle global where-boundslcnr-36/+6
2024-12-17add testslcnr-0/+132
2024-12-16Regression test for RPIT inheriting lifetimeRyan Mehri-0/+24
2024-12-17Auto merge of #134302 - bjorn3:remove_driver_queries, r=oli-obk,jieyouxubors-5/+4
Remove queries from the driver interface All uses of driver queries in the public api of rustc_driver have been removed in https://github.com/rust-lang/rust/pull/134130 already. This removes driver queries from rustc_interface and does a couple of cleanups around TyCtxt construction and entering enabled by this removal. Finishes the removal of driver queries started with https://github.com/rust-lang/rust/pull/126834.
2024-12-17Fix `-Z inputs-stats` ordering.Nicholas Nethercote-17/+17
In #129533 the main hash function changed and the order of `-Z input-stats` output changed, which showed that it is dependent on the hash function, even though it is sorted. That's because entries with the same cumulative size are ordered in a way that depends on the hash function. This commit fixes that by using the entry label as the secondary ordering key.
2024-12-17Remove `rustc::existing_doc_keyword` lint.Nicholas Nethercote-43/+32
`CheckAttrVisitor::check_doc_keyword` checks `#[doc(keyword = "..")]` attributes to ensure they are on an empty module, and that the value is a non-empty identifier. The `rustc::existing_doc_keyword` lint checks these attributes to ensure that the value is the name of a keyword. It's silly to have two different checking mechanisms for these attributes. This commit does the following. - Changes `check_doc_keyword` to check that the value is the name of a keyword (avoiding the need for the identifier check, which removes a dependency on `rustc_lexer`). - Removes the lint. - Updates tests accordingly. There is one hack: the `SelfTy` FIXME case used to used to be handled by disabling the lint, but now is handled with a special case in `is_doc_keyword`. That hack will go away if/when the FIXME is fixed. Co-Authored-By: Guillaume Gomez <guillaume1.gomez@gmail.com>
2024-12-17coverage: Build the global file table on the flyZalathar-4/+4
2024-12-16Stabilize #[coverage] attributeltdk-476/+362
2024-12-16add alignment info for testHenry Jiang-0/+2
2024-12-16rustc_borrowck: Suggest changing `&raw const` to `&raw mut` if applicableMartin Nordholts-0/+5
2024-12-16Rollup merge of #134385 - taiki-e:ui-asm-minicore, r=compiler-errorsMatthias Krüger-618/+537
tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro features by using minicore Follow-up to https://github.com/rust-lang/rust/pull/132516#issuecomment-2452986287. This PR do similar things for remaining tests in tests/ui/asm. r? jieyouxu
2024-12-16Rollup merge of #134371 - scottmcm:fix-134352, r=oli-obkMatthias Krüger-0/+23
Check for array lengths that aren't actually `usize` I wish typeck wouldn't give us `ty::Array`s that have this problem in the first place, but we can check for it. Fixes #134352 cc ``@matthiaskrgr``
2024-12-16Rollup merge of #134284 - estebank:issue-74863, r=lcnrMatthias Krüger-0/+40
Keep track of patterns that could have introduced a binding, but didn't When we recover from a pattern parse error, or a pattern uses `..`, we keep track of that and affect resolution error for missing bindings that could have been provided by that pattern. We differentiate between `..` and parse recovery. We silence resolution errors likely caused by the pattern parse error. ``` error[E0425]: cannot find value `title` in this scope --> $DIR/struct-pattern-with-missing-fields-resolve-error.rs:18:30 | LL | if let Website { url, .. } = website { | ------------------- this pattern doesn't include `title`, which is available in `Website` LL | println!("[{}]({})", title, url); | ^^^^^ not found in this scope ``` Fix #74863.
2024-12-16Rollup merge of #134277 - notriddle:notriddle/inline-into, r=GuillaumeGomezMatthias Krüger-0/+46
rustdoc-search: handle `impl Into<X>` better This PR fixes two bugs I ran into while searching the compiler docs: - It omitted an `impl Trait` entry in the type signature field, producing `TyCtxt, , Symbol -> bool` - It didn't let me search for `TyCtxt, DefId, Symbol -> bool` even though that's a perfectly good description of the function I was looking for (the function actually used `impl Into<DefId>` r? ``@GuillaumeGomez`` cc ``@lolbinarycat``
2024-12-16Rollup merge of #134260 - GuillaumeGomez:doctest-attrs, r=notriddleMatthias Krüger-0/+123
Correctly handle comments in attributes in doctests source code Fixes https://github.com/rust-lang/rust/issues/134221. The problem was that attributes are "inlined" (backlines are stripped), then when there is an inline comment inside it, the attribute is never considered valid (since unclosed). Fix was to simply put back backlines in case it's a multiline attribute. r? ``@notriddle``
2024-12-16Remove unneeded handling of backlines in doctest attributesGuillaume Gomez-0/+46
2024-12-17tests/ui/asm: Remove uses of rustc_attrs, lang_items, and decl_macro ↵Taiki Endo-618/+537
features by using minicore
2024-12-16Also handle cases where attributes are unclosedGuillaume Gomez-2/+20
2024-12-16Add ui regression test for #134221Guillaume Gomez-0/+59
2024-12-16Handle fndef rendering together with signature renderingOli Scherer-3/+3
2024-12-16Rollup merge of #134372 - jieyouxu:disable-flaky-test, r=NoratriebMatthias Krüger-0/+4
Disable `tests/ui/associated-consts/issue-93775.rs` on windows msvc This test seems to be quite flaky. See: - https://github.com/rust-lang/rust/issues/132111 - https://github.com/rust-lang/rust/issues/133432
2024-12-16Rollup merge of #134369 - antonok-edm:refering-referring, r=jieyouxuMatthias Krüger-6/+6
Update spelling of "referring" I noticed that `referring` was spelled incorrectly in the output of `unexpected 'cfg' condition name` warnings; it looks like it was also incorrectly spelled in a doc comment. I've update both instances.
2024-12-16Rollup merge of #134357 - Urgau:fn-ptr-134345, r=compiler-errorsMatthias Krüger-0/+16
Fix `trimmed_def_paths` ICE in the function ptr comparison lint This PR fixes an ICE with `trimmed_def_paths` ICE in the function ptr comparison lint, specifically when pretty-printing user types but then not using the resulting pretty-printing. Fixes #134345 r? `@saethlin`