about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-06-17Merge from rustcRalf Jung-1959/+1874
2023-06-21rustdoc: render the assoc ty body before the where-clauseLeón Orell Valerian Liehr-3/+4
2023-06-17Preparing for merge from rustcRalf Jung-1/+1
2023-06-17Auto merge of #112687 - compiler-errors:simplify-impl-source, r=lcnrbors-384/+186
Simplify `ImplSource` candidates a bit Reduce the number of impl source candidates, which will hopefully make our life easier when trying to adapt things like `SelectionContext::select` and `codegen_select_candidate` for the new solver. r? `@lcnr` but feel free to reassign
2023-06-17Remove even more redundant builtin candidatesMichael Goulet-138/+96
2023-06-17Simplify even more candidatesMichael Goulet-161/+88
2023-06-17Simplify an ObjectData fieldMichael Goulet-10/+14
2023-06-17Simplify some impl source candidatesMichael Goulet-81/+18
2023-06-17Remove some ImplSource candidatesMichael Goulet-50/+26
2023-06-17Auto merge of #112407 - tgross35:ci-docs-publish, r=Mark-Simulacrumbors-0/+97
Publish docs as github artifacts during CI Discussed here: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Building.20docs.20for.20PR.20CI The goal is to make docs available for download after CI runs on PRs, for easy review of API changes. Notes: - Currently this only captures library documentation (`core`, `alloc`, `std`, `test`, `proc_macro`) - You can't see artifacts until the entire workflow run has completed https://github.com/actions/upload-artifact/issues/53 - There is currently a generic file name `ci-artifacts`. No way to customize this based on contained files unfortunately https://github.com/actions/upload-artifact/issues/349 You can find the results at the bottom of the CI "summary" page: <img width="379" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/d3748e59-242c-40f8-9f54-82177b9b481b">
2023-06-17Auto merge of #108860 - oli-obk:tait_alias, r=compiler-errorsbors-344/+625
Add `AliasKind::Weak` for type aliases. `type Foo<T: Debug> = Bar<T>;` does not check `T: Debug` at use sites of `Foo<NotDebug>`, because in contrast to a ```rust trait Identity { type Identity; } impl<T: Debug> Identity for T { type Identity = T; } <NotDebug as Identity>::Identity ``` type aliases do not exist in the type system, but are expanded to their aliased type immediately when going from HIR to the type layer. Similarly: * a private type alias for a public type is a completely fine thing, even though it makes it a bit hard to write out complex times sometimes * rustdoc expands the type alias, even though often times users use them for documentation purposes * diagnostics show the expanded type, which is confusing if the user wrote a type alias and the diagnostic talks about another type that they don't know about. For type alias impl trait, these issues do not actually apply in most cases, but sometimes you have a type alias impl trait like `type Foo<T: Debug> = (impl Debug, Bar<T>);`, which only really checks it for `impl Debug`, but by accident prevents `Bar<T>` from only being instantiated after proving `T: Debug`. This PR makes sure that we always check these bounds explicitly and don't rely on an implementation accident. To not break all the type aliases out there, we only use it when the type alias contains an opaque type. We can decide to do this for all type aliases over an edition. Or we can later extend this to more types if we figure out the back-compat concerns with suddenly checking such bounds. As a side effect, easily allows fixing https://github.com/rust-lang/rust/issues/108617, which I did. fixes https://github.com/rust-lang/rust/issues/108617
2023-06-16Auto merge of #112716 - compiler-errors:rollup-h77daia, r=compiler-errorsbors-163/+331
Rollup of 7 pull requests Successful merges: - #111074 (Relax implicit `T: Sized` bounds on `BufReader<T>`, `BufWriter<T>` and `LineWriter<T>`) - #112226 (std: available_parallelism using native netbsd api first) - #112474 (Support 128-bit enum variant in debuginfo codegen) - #112662 (`#[lang_item]` for `core::ptr::Unique`) - #112665 (Make assumption functions in new solver take `Binder<'tcx, Clause<'tcx>>`) - #112684 (Disable alignment checks on i686-pc-windows-msvc) - #112706 (Add `SyntaxContext::is_root`) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-16Rollup merge of #112706 - WaffleLapkin:syntax_context_is_root, r=petrochenkovMichael Goulet-15/+20
Add `SyntaxContext::is_root` Makes the code a tad nicer.
2023-06-16Rollup merge of #112684 - saethlin:ignore-windows-alignment, r=wesleywiserMichael Goulet-0/+26
Disable alignment checks on i686-pc-windows-msvc r? `@wesleywiser` Because you were in the Zulip discussion of this: https://rust-lang.zulipchat.com/#narrow/stream/238009-t-compiler.2Fmeetings/topic/.5Bweekly.5D.202023-06-15 cc #112480
2023-06-16Rollup merge of #112665 - compiler-errors:assumption-takes-clause, r=lcnrMichael Goulet-26/+98
Make assumption functions in new solver take `Binder<'tcx, Clause<'tcx>>` We just use an if-let to match on an optional clause at all the places where we transition from `Predicate` -> `Clause`, but I assume that when things like item-bounds and param-env start to only store `Clause`s then those can just be trivially dropped. r? ``@lcnr``
2023-06-16Rollup merge of #112662 - Vanille-N:symbol_unique, r=RalfJungMichael Goulet-0/+5
`#[lang_item]` for `core::ptr::Unique` Tree Borrows is about to introduce experimental special handling of `core::ptr::Unique` in Miri to give it a semantics. As of now there does not seem to be a clean way (i.e. other than `&format!("{adt:?}") == "std::ptr::Unique"`) to check if an `AdtDef` represents a `Unique`. r? `@RalfJung` Draft: making a lang item
2023-06-16Rollup merge of #112474 - ldm0:ldm_enum_debuginfo_128_support, r=compiler-errorsMichael Goulet-11/+41
Support 128-bit enum variant in debuginfo codegen fixes #111600
2023-06-16Rollup merge of #112226 - devnexen:netbsd_affinity, r=cuviperMichael Goulet-0/+23
std: available_parallelism using native netbsd api first before falling back to existing code paths like FreeBSD does.
2023-06-16Rollup merge of #111074 - WaffleLapkin:🌟unsizes_your_buf_reader🌟, ↵Michael Goulet-111/+118
r=Amanieu Relax implicit `T: Sized` bounds on `BufReader<T>`, `BufWriter<T>` and `LineWriter<T>` TL;DR: ```diff,rust -pub struct BufReader<R> { /* ... */ } +pub struct BufReader<R: ?Sized> { /* ... */ } -pub struct BufWriter<W: Write> { /* ... */ } +pub struct BufWriter<W: ?Sized + Write> { /* ... */ } -pub struct LineWriter<W: Write> { /* ... */ } +pub struct LineWriter<W: ?Sized + Write> { /* ... */ } ``` This allows using `&mut BufReader<dyn Read>`, for example. **This is an insta-stable change**.
2023-06-16Pacify tidyOli Scherer-116/+128
2023-06-16Add `AliasKind::Weak` for type aliases.Oli Scherer-199/+474
Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases.
2023-06-16Auto merge of #112294 - saethlin:inline-me-maybe, r=oli-obkbors-934/+349
Ignore the always part of #[inline(always)] in MIR inlining `#[inline(always)]` is used in two cases: for functions that are so trivial it is always profitable to inline them, but also for functions which LLVM thinks are a bad inlining candidate, but which actually turn out to be profitable to inline. That second justification doesn't apply to the MIR inliner, so ignoring our cost estimation for these functions is not necessarily the right right thing to do. This is basically a wash on non-check runs and a perf benefit in check runs. There are some notable regressions, and I think we might be able to claw those back by turning `#[inline(always)]` into a stronger hint. But I think this PR stands decently on its own as a tidy simplification.
2023-06-16Merge the orphan logic for all alias kindsOli Scherer-29/+23
2023-06-16Ignore the always part of #[inline(always)] in MIR inliningBen Kimock-934/+349
2023-06-16Auto merge of #110688 - GuillaumeGomez:result-search-type, r=notriddle,jshabors-40/+42
rustdoc: Add search result item types after their name Here what it looks like: ![Screenshot from 2023-04-22 15-16-58](https://user-images.githubusercontent.com/3050060/233789566-b5f3f625-3b78-4c56-a7ee-0a4f2d62e667.png) The idea is to improve accessibility by providing this information directly in the text and not only in the text color. Currently we already use it for doc aliases and for primitive types, so I extended it to all types. r? `@notriddle`
2023-06-16Auto merge of #2932 - RalfJung:comment, r=RalfJungbors-2/+4
comment tweaks
2023-06-16comment tweaksRalf Jung-2/+4
2023-06-16Update compiler/rustc_mir_transform/src/check_alignment.rsWesley Wiser-0/+1
2023-06-16Add `SyntaxContext::is_root`Maybe Waffle-15/+20
2023-06-16`#[lang_item]` for `core::ptr::Unique`Neven Villani-0/+5
2023-06-16Disable alignment checks on i686-pc-windows-msvcBen Kimock-0/+25
2023-06-16Auto merge of #112702 - Dylan-DPC:rollup-12d6qay, r=Dylan-DPCbors-88/+207
Rollup of 7 pull requests Successful merges: - #112163 (fix: inline `predicate_may_hold_fatal` and remove expect call in it) - #112399 (Instantiate closure synthetic substs in root universe) - #112443 (Opportunistically resolve regions in new solver) - #112535 (reorder attributes to make miri-test-libstd work again) - #112579 (Fix building libstd documentation on FreeBSD.) - #112639 (Fix `dead_code_cgu` computation) - #112642 (Handle interpolated literal errors) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-16Auto merge of #2929 - RalfJung:tls-panic, r=RalfJungbors-0/+54
add tests for panicky drop in thread_local destructor Adds a test for https://github.com/rust-lang/rust/issues/112285
2023-06-16make test work cross-platformRalf Jung-31/+10
2023-06-16add tests for panicky drop in thread_local destructorRalf Jung-0/+75
2023-06-16Rollup merge of #112642 - compiler-errors:interp-lit-err, r=nnethercoteDylan DPC-6/+21
Handle interpolated literal errors Not sure why it was doing a whole dance to re-match on the token kind when it seems like `Lit::from_token` does the right thing for both macro-arg and regular literals. Nothing seems to have regressed diagnostics-wise from the change, though. Fixes #112622 r? ``@nnethercote``
2023-06-16Rollup merge of #112639 - nnethercote:fix-dead_code_cgu, r=wesleywiserDylan DPC-44/+41
Fix `dead_code_cgu` computation This PR fixes a bug in `dead_code_cgu` computation, and also does some refactoring. r? ```@wesleywiser```
2023-06-16Rollup merge of #112579 - MikaelUrankar:freebsd_docs, r=cuviperDylan DPC-0/+1
Fix building libstd documentation on FreeBSD. It fixes the following error: ``` error[E0412]: cannot find type `sockcred2` in module `libc` --> library/std/src/os/unix/net/ancillary.rs:211:29 | 211 | pub struct SocketCred(libc::sockcred2); | ^^^^^^^^^ not found in `libc` ```
2023-06-16Rollup merge of #112535 - RalfJung:miri-test-libstd, r=cuviperDylan DPC-11/+12
reorder attributes to make miri-test-libstd work again Fixes fallout from https://github.com/rust-lang/rust/pull/110141
2023-06-16Rollup merge of #112443 - ↵Dylan DPC-11/+75
compiler-errors:next-solver-opportunistically-resolve-regions, r=lcnr Opportunistically resolve regions in new solver Use `opportunistic_resolve_var` during canonicalization to collapse some regions. We have to start using `CanonicalVarValues::is_identity_modulo_regions`. We also have to modify that function to consider responses like `['static, ^0, '^1, ^2]` to be an "identity" response, since because we opportunistically resolve regions, there's no longer a 1:1 mapping between canonical var values and bound var indices in the response... There's one nasty side-effect -- one test (`tests/ui/dyn-star/param-env-infer.rs`) starts to ICE because the certainty goes from `Yes` to `Maybe(Overflow)`... Not exactly sure why, though? Putting this up for discussion/investigation. r? ```@lcnr```
2023-06-16Rollup merge of #112399 - compiler-errors:closure-substs-root-universe, r=lcnrDylan DPC-2/+13
Instantiate closure synthetic substs in root universe In the UI test example, we end up generalizing an associated type (something like `<Map<Option<i32>, [closure upvars=?0]> as IntoIterator>::Item` generalizes into `<Map<Option<i32>, [closure upvars=?1]> as IntoIterator>::Item`) then assigning it to itself, emitting an alias-relate goal. This trivially holds via one of the normalizes-to candidates, instead of relating substs, so when closure analysis eventually sets `?0` to the actual upvars, `?1` never gets constrained. This ends up being reported as an ambiguity error during writeback. Instead, we can take advantage of the fact that we *know* the closure substs live in the root universe. This will prevent them being generalized, since they always can be named, and the alias-relate above never gets emitted at all. We can probably do this to a handful of other `next_ty_var` calls in typeck for variables that are clearly associated with the body of the program, but I wanted to limit this for now. Eventually, if we end up representing universes more faithfully like a tree or whatever, we can remove this and turn it back to just a call to `next_ty_var`. Note: This is incredibly order-dependent -- we need to be assigning a type variable that was created *before* the closure substs, and we also need to actually have an unnormalized type at the time of the assignment. This currently seems easiest to trigger during call argument analysis just due to the fact that we instantiate the call's substs, normalize, THEN check args. r? ```@lcnr```
2023-06-16Rollup merge of #112163 - bvanjoi:fix-105231-2, r=compiler-errorsDylan DPC-14/+44
fix: inline `predicate_may_hold_fatal` and remove expect call in it - Fixes #105231 - Discussion: https://github.com/rust-lang/rust/pull/111985#discussion_r1208888821 r? ``@compiler-errors``
2023-06-16Auto merge of #112597 - danakj:map-linker-paths, r=michaelwoeristerbors-3/+33
Use the relative sysroot path in the linker command line to specify sysroot rlibs This addresses https://github.com/rust-lang/rust/issues/112586
2023-06-16Auto merge of #2930 - RalfJung:rustup, r=RalfJungbors-25053/+25680
Rustup
2023-06-16Merge from rustcRalf Jung-25052/+25679
2023-06-16Preparing for merge from rustcRalf Jung-1/+1
2023-06-16Auto merge of #112673 - scottmcm:enough-stack, r=compiler-errorsbors-4/+7
Add an `ensure_sufficient_stack` to `LateContextAndPass::visit_expr` This is [apparently](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.60-alt.60-only.20failures.3F/near/365396801) where it's busting stack in #112238, and the comments for `ensure_sufficient_stack` say that > E.g. almost any call to visit_expr or equivalent can benefit from this. So this seems like a reasonable change. Hopefully it'll keep this from happening in other places too -- https://github.com/rust-lang/rust/pull/111818#issuecomment-1585023914 hit something similar when updating a lint (bors failure is https://github.com/rust-lang-ci/rust/actions/runs/5199591324/jobs/9377196369), so with any luck this will keep small permutations of things from tripping over the limit.
2023-06-16fix: inline `predicate_may_hold_fatal`bohan-14/+44
2023-06-16Auto merge of #112346 - saethlin:no-comment, r=oli-obkbors-24144/+21875
Remove comments from mir-opt MIR dumps See https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Line.20numbers.20in.20mir-opt.20tests/near/363849874 In https://github.com/rust-lang/rust/pull/99780 there is mention that "there has been a zulip conversation about disabling line numbers with mixed opinions" which to me means that some people opposed this. I can't find the referenced conversation so... here we go. The current situation is quite chaotic. It's not hard to find MIR diffs which contain * Absolute line numbers * Relative line numbers * Substituted line numbers (LL) For example: https://github.com/rust-lang/rust/blob/408bbd040613f6776e0a7d05d582c81f4ddc189a/tests/mir-opt/inline/inline_shims.drop.Inline.diff#L10-L17 And sometimes adding a comment at the top of a mir-opt test generates a diff in the test because a line number changed: https://github.com/rust-lang/rust/pull/98112/files#diff-b8cf4bcce95078e6a3faf075e9abf6864872fb28a64d95c04f04513b9e3bbd81 And irrelevant changes to the standard library can generate diffs in mir-opt tests: https://github.com/rust-lang/rust/pull/110694/files#diff-bf96b0e7c67b8b272814536888fd9428c314991e155beae1f0a2a67f0ac47b2c https://github.com/rust-lang/rust/commit/769886cc35ce08b76839f4cf72b8af1161c432e1 I think we should, specifically in mir-opt tests, completely remove the comments, or insert placeholders for all line and column numbers.
2023-06-15Auto merge of #112681 - GuillaumeGomez:rollup-rwn4086, r=GuillaumeGomezbors-213/+578
Rollup of 8 pull requests Successful merges: - #112403 (Prevent `.eh_frame` from being emitted for `-C panic=abort`) - #112517 (`suspicious_double_ref_op`: don't lint on `.borrow()`) - #112529 (Extend `unused_must_use` to cover block exprs) - #112614 (tweak suggestion for argument-position `impl ?Sized`) - #112654 (normalize closure output in equate_inputs_and_outputs) - #112660 (Migrate GUI colors test to original CSS color format) - #112664 (Add support for test tmpdir to fuchsia test runner) - #112669 (Fix comment for ptr alignment checks in codegen) r? `@ghost` `@rustbot` modify labels: rollup