| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
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`.
|
|
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
|
|
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);
| +
```
|
|
Fix const conditions for RPITITs
Fixes #133918
r? lcnr
|
|
|
|
|
|
r=cjgillot"
This reverts commit 16a02664e66afbfcd738b600d4a409e809040695.
|
|
|
|
as well
|
|
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.
|
|
|
|
|
|
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
|
|
Regression test for RPIT inheriting lifetime from projection
Regression test to close https://github.com/rust-lang/rust/issues/51525
|
|
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.
|
|
using minicore
|
|
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
|
|
I wanted to move some ui tests around, which broke `test_valid` since it
was referencing a non-specific-purpose ui test.
|
|
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
|
|
Fix `-Z input-stats` ordering
It currently depends on the hash algorithm.
r? `@Noratrieb`
|
|
AIX: add alignment info for test
Supply alignment and size info for test cases for AIX.
|
|
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
```
|
|
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.
|
|
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
|
|
Remove `rustc::existing_doc_keyword` lint
The check doesn't require a lint.
r? ``@GuillaumeGomez``
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
`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>
|
|
|
|
|
|
|
|
|
|
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
|
|
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``
|
|
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.
|
|
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``
|
|
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``
|
|
|
|
features by using minicore
|
|
|
|
|
|
|
|
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
|
|
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.
|
|
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`
|