1
Fork 0
Commit graph

277760 commits

Author SHA1 Message Date
dianne
ac922245f0 best_blame_constraint: don't filter constraints by sup SCC
The SCCs of the region graph are not a reliable heuristic to use for blaming an interesting
constraint for diagnostics. For region errors, if the outlived region is `'static`, or the involved
types are invariant in their lifetiems, there will be cycles in the constraint graph containing both
the target region and the most interesting constraints to blame. To get better diagnostics in these
cases, this commit removes that heuristic.
2025-01-06 16:08:29 -08:00
Chayim Refael Friedman
78f89a6210
Merge pull request #18858 from davidbarsky/davidbarsky/fix-18854
fix: clear diagnostics on cancel unconditionally
2025-01-06 23:59:35 +00:00
dianne
2249232ad8 further clean up best_blame_constraint
This gets rid of `categorized_path`, as it was redundant given the `OutlivesConstraint`s in `path`
already have a category field.
2025-01-06 15:53:33 -08:00
dianne
aa8d5bff4c cleanup: remove ExtraConstraintInfo
`ExtraConstraintInfo` was used only for a single subdiagnostic, so this moves the logic for that
to its own function and eliminates the indirection. In order to do so cleanly, this also changes
the arguments to `BorrowExplanation::add_explanation_to_diagnostic`, which happens to simplify its
call sites.
2025-01-06 15:53:30 -08:00
David Barsky
e02b3ec9cc fix: clear diagnostics on cancel unconditionally, fixing #18854 2025-01-06 18:41:21 -05:00
Kornel
85a71ea0c7
More compelling env_clear() examples 2025-01-06 23:39:53 +00:00
bors
0f1e965fec Auto merge of #135172 - matthiaskrgr:rollup-8fe3fxi, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #134742 (Use `PostBorrowckAnalysis` in `check_coroutine_obligations`)
 - #134771 (Report correct `SelectionError` for `ConstArgHasType` in new solver fulfill)
 - #134951 (Suppress host effect predicates if underlying trait doesn't hold)
 - #135097 (bootstrap: Consolidate coverage test suite steps into a single step)
 - #135146 (Don't enable anyhow's `backtrace` feature in opt-dist)
 - #135153 (chore: remove redundant words in comment)
 - #135157 (Move the has_errors check in rustdoc back to after TyCtxt is created)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-06 22:39:16 +00:00
Noah Lev
b0aaa386d8 rustdoc: Fix mismatched capitalization in sidebar
Previously, the main content used "Aliased Type", while the sidebar said
"Aliased type". Now, they both say "Aliased Type", which is the more common
capitalization in Rustdoc.

See the following link for an example.
https://doc.rust-lang.org/1.83.0/std/io/type.Result.html
2025-01-06 14:26:07 -08:00
Xing Xue
7f31b579c7 Replace the random substring of a linker argument with a placeholder and nullify the timestamp field of XCOFF files for file comparison. 2025-01-06 16:59:46 -05:00
hrxi
63487dde53 clippy::redundant_locals is not a correctness lint
Even its documentation says so. According to the documentation, it might
either be a "suspicious" or a "perf" lint.
2025-01-06 22:42:11 +01:00
Pietro Albini
80cdaeac3d
avoid replacing the definition of CURRENT_RUSTC_VERSION
Before this commit, replace-version-placeholder hardcoded the path
defining CURRENT_RUSTC_VERSION (to avoid replacing it). After a refactor
moved the file defining it without changing the hardcoded path, the tool
started replacing the constant itself with the version number.

To avoid this from happening in the future, this changes the definition
of the constant to avoid the tool from ever matching it.
2025-01-06 21:53:48 +01:00
Chayim Refael Friedman
e18e1eb991 Fix case where completion inside macro that expands to #[test] was unavailable
We ignore `#[test]` in the def map, so that's why it failed.
2025-01-06 22:02:24 +02:00
Matthias Krüger
873ae7a5ad
Rollup merge of #135157 - bjorn3:fix_rustdoc_error_abort, r=jieyouxu,GuillaumeGomez
Move the has_errors check in rustdoc back to after TyCtxt is created

This was accidentally moved before TyCtxt creation by https://github.com/rust-lang/rust/pull/134302.
2025-01-06 20:59:36 +01:00
Matthias Krüger
7d4b6dc861
Rollup merge of #135153 - crystalstall:master, r=workingjubilee
chore: remove redundant words in comment
2025-01-06 20:59:35 +01:00
Matthias Krüger
8e2631bdb6
Rollup merge of #135146 - Zalathar:anyhow-backtrace, r=jieyouxu
Don't enable anyhow's `backtrace` feature in opt-dist

As of the stabilization of `std::backtrace` in Rust 1.65, this package flag has no effect other than to enable an unused dependency on the `backtrace` crate.

(See <af0937ef72/Cargo.toml (L18-L23)>.)

While the presence of this feature in opt-dist doesn't cause other tools (which use anyhow) to actually *build* backtrace, it does affect the global crate graph used for dependency version resolution. After removing this feature, we can use `cargo tree --invert --package backtrace` to see that the only remaining reverse-dependency of backtrace is `color-eyre`, which is used by `ui_test`.
2025-01-06 20:59:35 +01:00
Matthias Krüger
c31a4b9ac4
Rollup merge of #135097 - Zalathar:coverage-test-step, r=Kobzol
bootstrap: Consolidate coverage test suite steps into a single step

Now that I have more understanding of bootstrap steps, and a renewed distaste for unnecessary macros, I have managed to express the subtleties of the `tests/coverage` test suite in a single step defined in ordinary code, with no need for helper macros.

Deciding which modes to run is still a bit clunky due to limitations in existing ShouldRun/PathSet APIs, but I think it's a net improvement over having to declare several different steps to handle the suite path and aliases.

The interaction with `--skip` isn't as nice as I'd like, but all of the known limitations are limitations that already existed in the previous implementation.

One minor change is that by default compiletest is now invoked in `coverage-run` mode even when cross-compiling. However, in that situation compiletest still knows that it should skip all of the individual coverage-run tests.

r? jieyouxu (or reassign)
2025-01-06 20:59:34 +01:00
Matthias Krüger
68791efa29
Rollup merge of #134951 - compiler-errors:double-trait-err-msg, r=davidtwco
Suppress host effect predicates if underlying trait doesn't hold

Don't report two errors for when the (`HostEffectPredicate`) `T: const Trait` isn't implemented because (`TraitPredicate`) `T: Trait` doesn't even hold.
2025-01-06 20:59:33 +01:00
Matthias Krüger
44c6e83b49
Rollup merge of #134771 - compiler-errors:const-arg-has-type-err, r=lcnr
Report correct `SelectionError` for `ConstArgHasType` in new solver fulfill

r? ``@BoxyUwU``
2025-01-06 20:59:32 +01:00
Matthias Krüger
49b05ed7c1
Rollup merge of #134742 - compiler-errors:post-borrowck-analysis, r=lcnr
Use `PostBorrowckAnalysis` in `check_coroutine_obligations`

This currently errors with:

```
error: concrete type differs from previous defining opaque type use
  --> tests/ui/coroutine/issue-52304.rs:10:21
   |
10 | pub fn example() -> impl Coroutine {
   |                     ^^^^^^^^^^^^^^ expected `{example::{closure#0} upvar_tys=() resume_ty=() yield_ty=&'{erased} i32 return_ty=() witness={example::{closure#0}}}`, got `{example::{closure#0} upvar_tys=() resume_ty=() yield_ty=&'static i32 return_ty=() witness={example::{closure#0}}}`
   |
   = note: previous use here
```

This is because we end up redefining the opaque in `check_coroutine_obligations` but with the `yield_ty = &'erased i32` from hir typeck, which causes the *equality* check for opaques to fail.

The coroutine obligtions in question (when `-Znext-solver` is enabled) are:

```
Binder { value: TraitPredicate(<Opaque(DefId(0:5 ~ issue_52304[4c6d]::example::{opaque#0}), []) as std::marker::Sized>, polarity:Positive), bound_vars: [] }

Binder { value: AliasRelate(Term::Ty(Alias(Opaque, AliasTy { args: [], def_id: DefId(0:5 ~ issue_52304[4c6d]::example::{opaque#0}), .. })), Equate, Term::Ty(Coroutine(DefId(0:6 ~ issue_52304[4c6d]::example::{closure#0}), [(), (), &'{erased} i32, (), CoroutineWitness(DefId(0:6 ~ issue_52304[4c6d]::example::{closure#0}), []), ()]))), bound_vars: [] }

Binder { value: AliasRelate(Term::Ty(Coroutine(DefId(0:6 ~ issue_52304[4c6d]::example::{closure#0}), [(), (), &'{erased} i32, (), CoroutineWitness(DefId(0:6 ~ issue_52304[4c6d]::example::{closure#0}), []), ()])), Subtype, Term::Ty(Alias(Opaque, AliasTy { args: [], def_id: DefId(0:5 ~ issue_52304[4c6d]::example::{opaque#0}), .. }))), bound_vars: [] }
```

Ignoring the fact that we end up stalling some really dumb obligations here (lol), I think it makes more sense for us to be using post borrowck analysis for this check anyways.

r? lcnr
2025-01-06 20:59:31 +01:00
Manish Goregaokar
0e2505ba8f
Do not trigger missing_const_for_fn for tests (#13945)
Close #13938

changelog: [`missing_const_for_fn`]: do not trigger for tests
2025-01-06 19:47:54 +00:00
Michael Howell
c7a806ad08 rustdoc: use stable paths as preferred canonical paths
This accomplishes something like 16a4ad7d7b,
but with the `rustc_allowed_through_unstable_modules` attribute instead
of the path length.
2025-01-06 11:58:52 -07:00
Celina G. Val
5172364b67
Update triagebot.toml: celinval vacation is over
I'm also removing myself from the MIR syntax changes notifications.
2025-01-06 10:50:58 -08:00
Laurențiu Nicola
5afee0d54d
Merge pull request #18852 from ChayimFriedman2/proc-macro-panic
fix: Fix a bug that was caused by fixup reversing
2025-01-06 18:38:24 +00:00
Chayim Refael Friedman
21b9e32af7 Fix a bug that was caused by fixup reversing 2025-01-06 20:06:20 +02:00
Michael Goulet
304ccf45d1 Suggest to replace tuple constructor through projection 2025-01-06 18:04:33 +00:00
Michael Goulet
ebdf19a8bb Recurse on GAT where clauses in fulfillment error proof tree visitor 2025-01-06 17:58:42 +00:00
Michael Goulet
5a566005c1 Normalize each signature input/output in typeck_with_fallback with its own span 2025-01-06 17:58:30 +00:00
Michael Goulet
96285bde38 Don't ice on bad transmute in typeck in new solver 2025-01-06 17:56:16 +00:00
Michael Goulet
2be9ffc1af Add derived causes for host effect predicates 2025-01-06 17:49:46 +00:00
Lukas Wirth
22ab7e37be
Merge pull request #18846 from Veykril/push-kmspklwynynu
minor: New clippy lints
2025-01-06 17:12:14 +00:00
Lukas Wirth
0b832bf8a3 minor: New clippy lints 2025-01-06 17:57:17 +01:00
Guillaume Gomez
78225ccca8 Add regression test for #8528 2025-01-06 17:35:55 +01:00
Guillaume Gomez
891e38788a Don't emit machine applicable map_flatten lint if there are code comments 2025-01-06 17:35:55 +01:00
Pietro Albini
87ce94d56f
last feedback items 2025-01-06 17:14:16 +01:00
Tobias Bucher
8630234ebc Add new {x86_64,i686}-win7-windows-gnu targets
These are in symmetry with `{x86_64,i686}-win7-windows-msvc`.
2025-01-06 15:32:17 +01:00
Tobias Bucher
4bc6b76871 Escape all * in rustc's SUMMARY.md 2025-01-06 15:29:42 +01:00
Rémy Rakic
fc7ee238d1 address review comments
push constraint creation to where the statement/terminator info is gathered
2025-01-06 14:20:54 +00:00
Lukas Wirth
d0db503515
Merge pull request #18848 from Veykril/push-kyyoskmvnutp
fix: Fix non-cargo flychecks immediately clearing received diagnostics
2025-01-06 12:58:53 +00:00
Lukas Wirth
29c21d87d0 fix: Fix non-cargo flychecks immediately clearing received diagnostics 2025-01-06 13:44:30 +01:00
klensy
37f26311eb add deprecated and do nothing flag to options table
inline_threshold mark deprecated

no-stack-check

print deprecation message for -Car too

inline_threshold deprecated and do nothing: make in untracked

make OptionDesc struct from tuple
2025-01-06 15:38:02 +03:00
bjorn3
0705ea2a1c
Move the has_errors check in rustdoc back to after TyCtxt is created 2025-01-06 12:13:19 +01:00
bors
243d2ca4db Auto merge of #135112 - tgross35:combine-select-unpredictable-test, r=the8472
Merge the intrinsic and user tests for `select_unpredictable`

[1] mentions that having a single test with `-Zmerge-functions=disabled` is preferable to having two separate tests.  Apply that to the new `select_unpredictable` test here.

[1]: https://github.com/rust-lang/rust/pull/133964#issuecomment-2569693325
2025-01-06 10:52:07 +00:00
Lukas Wirth
43b44cf128
Merge pull request #18836 from Veykril/push-kksuoxxptvty
fix: Be more permissive with completion resolve data
2025-01-06 10:37:01 +00:00
Lukas Wirth
0389235a15 fix: Be more permissive with completion resolve data 2025-01-06 11:22:42 +01:00
Lukas Wirth
68c2241053
Merge pull request #18845 from Veykril/push-yyuolqomnkys
fix: Fix flycheck getting confused which package to check
2025-01-06 10:21:26 +00:00
Zalathar
5298f85a0a Consolidate coverage test suite steps into a single step 2025-01-06 21:14:23 +11:00
Lukas Wirth
e47bb0df91 fix: Fix flycheck getting confused which package to check 2025-01-06 11:05:51 +01:00
Hood Chatham
49c74234a7 Add support for wasm exception handling to Emscripten target
Gated behind an unstable `-Z emscripten-wasm-eh` flag
2025-01-06 10:29:54 +01:00
Lukas Wirth
aeae353a2c
Merge pull request #18843 from Veykril/push-usuzxtzsnrpt
fix: Handle newstyle `rustc_intrinsic` safety correctly
2025-01-06 09:00:32 +00:00
Lukas Wirth
5ee1b0af00 fix: Handle newstyle rustc_intrinsic safety correctly 2025-01-06 09:47:31 +01:00