| Age | Commit message (Collapse) | Author | Lines |
|
|
|
This reverts commit 6d2b84b3ed7848fd91b8d6151d4451b3103ed816, reversing
changes made to 73bc12199ea8c7651ed98b069c0dd6b0bb5fabcf.
|
|
This reverts commit 8c2b57721728233e074db69d93517614de338055, reversing
changes made to 9cf18e98f82d85fa41141391d54485b8747da46f.
|
|
This reverts commit 503e129328080e924c0ddfca6abf4c2812580102, reversing
changes made to 0e7f91b75e7484a713e2f644212cfc1aa7478a28.
|
|
[beta] rustdoc ui: adjust tooltip z-index to be above sidebar
Backport of https://github.com/rust-lang/rust/pull/119477.
Fixes https://github.com/rust-lang/rust/issues/119472.
range-diff:
```range-diff
446: d796ad4209b = 11: 53637cdd8ed rustdoc ui: adjust tooltip z-index to be above sidebar
459: b1853eb3bd5 ! 12: c4c4ff67fae use css variable for z-index of the sidebar
`@@` src/librustdoc/html/static/css/rustdoc.css: so that we can apply CSS-filters to
margin-top: 7px;
border-radius: 3px;
border: 1px solid var(--border-color);
-`@@` src/librustdoc/html/static/css/rustdoc.css: a.tooltip:hover::after {
- }
- .src #sidebar-button {
- left: 8px;
-- z-index: 101;
-+ z-index: calc(var(--desktop-sidebar-z-index) + 1);
- }
- .hide-sidebar .src #sidebar-button {
- position: static;
```
The "show sidebar" button on the [source view page](https://doc.rust-lang.org/nightly/src/std/lib.rs.html) works differently on beta and nightly, but it is in fact above the sidebar in both versions.
beta button:

nightly button:

cc `@Mark-Simulacrum`
|
|
[beta] Revert #117472: Stabilize C string literals
Based on discussion in [#t-lang](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/rfc.203349.3A.20mixed.20utf8.20literals), revert the stabilization of C string literals in Rust 1.76.
I also reverted #118566 as it uses the newly stabilized C string literals in various places.
|
|
|
|
|
|
|
|
This reverts commit 0f41bc21b958fed66b3d055531af67638390f520.
|
|
Tolerate overaligned MIR constants for codegen.
Fixes https://github.com/rust-lang/rust/issues/117761
cc `@saethlin`
|
|
resolve: Stop feeding visibilities for import list stems
Fixes https://github.com/rust-lang/rust/issues/119126
|
|
|
|
|
|
|
|
coverage: Check for `async fn` explicitly, without needing a heuristic
The old code used a heuristic to detect async functions and adjust their coverage spans to produce better output. But there's no need to resort to a heuristic when we can just look back at the original definition and check whether the current function is actually an `async fn`.
In addition to being generally nicer, this also gets rid of the one piece of code that specifically cares about `CoverageSpan::is_closure` representing an actual closure. All remaining code that inspects that field just uses it as an indication that the span is a hole that should be carved out of other spans, and then discarded.
That opens up the possibility of introducing other kinds of “hole” spans, e.g. for nested functions/types/macros, and having them all behave uniformly.
---
`@rustbot` label +A-code-coverage
|
|
resolve: Feed visibilities for unresolved trait impl items
Fixes https://github.com/rust-lang/rust/issues/119073
|
|
Add function ABI and type layout to StableMIR
This change introduces a new module to StableMIR named `abi` with information from `rustc_target::abi` and `rustc_abi`, that allow users to retrieve more low level information required to perform bit-precise analysis.
The layout of a type can be retrieved via `Ty::layout`, and the instance ABI can be retrieved via `Instance::fn_abi()`.
To properly handle errors while retrieve layout information, we had to implement a few layout related traits.
r? ```@compiler-errors```
|
|
-Znext-solver: adapt overflow rules to avoid breakage
Do not erase overflow constraints if they are from equating the impl header when normalizing[^1].
This should be the minimal change to not break crates depending on the old project behavior of "apply impl constraints while only lazily evaluating any nested goals".
Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/70, see https://hackmd.io/ATf4hN0NRY-w2LIVgeFsVg for the reasoning behind this.
Only keeping constraints on overflow for `normalize-to` goals as that's the only thing needed for backcompat. It also allows us to not track the origin of root obligations. The issue with root goals would be something like the following:
```rust
trait Foo {}
trait Bar {}
trait FooBar {}
impl<T: Foo + Bar> FooBar for T {}
// These two should behave the same, rn we can drop constraints for both,
// but if we don't drop `Misc` goals we would only drop the constraints for
// `FooBar` unless we track origins of root obligations.
fn func1<T: Foo + Bar>() {}
fn func2<T: FooBaz>() {}
```
[^1]: mostly, the actual rules are slightly different
r? ``@compiler-errors``
|
|
rustc_codegen_ssa: Don't drop `IncorrectCguReuseType` , make `rustc_expected_cgu_reuse` attr work
In [100753], `IncorrectCguReuseType` accidentally stopped being emitted by removing `diag.span_err(...)`. Begin emitting it again rather than just blindly dropping it, and adjust tests accordingly.
We assume that there are no bugs and that the currently actual CGU reuse is correct. If there are bugs, they will be discovered and fixed eventually, and the tests will then be updated.
[100753]: https://github.com/rust-lang/rust/pull/100753/commits/706452eba74026c51e8d0fa30aee2497c69eafc0#diff-048389738ddcbe0f9765291a29db1fed9a5f03693d4781cfb5aaa97ffb3c7f84
Closes #118972
|
|
Add check for possible CStr literals in pre-2021
Fixes [#118654](https://github.com/rust-lang/rust/issues/118654)
Adds information to errors caused by possible CStr literals in pre-2021.
The lexer separates `c"str"` into two tokens if the edition is less than 2021, which later causes an error when parsing. This error now has a more helpful message that directs them to information about editions. However, the user might also have written `c "str"` in a later edition, so to not confuse people who _are_ using a recent edition, I also added a note about whitespace.
We could probably figure out exactly which scenario has been encountered by examining spans and editions, but I figured it would be better not to overcomplicate the creation of the error too much.
This is my first code PR and I tried to follow existing conventions as much as possible, but I probably missed something, so let me know!
|
|
We have coverage tests that use async functions, but none that use async
blocks.
|
|
add more niches to rawvec
Previously RawVec only had a single niche in its `NonNull` pointer. With this change it now has `isize::MAX` niches since half the value-space of the capacity field is never needed, we can't have a capacity larger than isize::MAX.
|
|
|
|
match lowering: Remove the `make_target_blocks` hack
This hack was introduced 4 years ago in [`a1d0266` (#60730)](https://github.com/rust-lang/rust/pull/60730/commits/a1d0266878793bc8b2bf50958eb529005ed19da0) to improve LLVM optimization time, specifically noticed in the `encoding` benchmark. Measurements today indicate it is no longer needed.
r? `@matthewjasper`
|
|
|
|
In [100753], `IncorrectCguReuseType` accidentally stopped being emitted.
Begin emitting it again rather than just blindly dropping it, and adjust
tests accordingly.
[100753]: https://github.com/rust-lang/rust/pull/100753/commits/706452eba74026c51e8d0fa30aee2497c69eafc0#diff-048389738ddcbe0f9765291a29db1fed9a5f03693d4781cfb5aaa97ffb3c7f84
|
|
We should expand the information in PassMode later.
|
|
It was introduced 4 years ago in a1d0266878793bc8 to improve LLVM
optimization time. Measurements today indicate it is no longer needed.
|
|
Adjust the ignore-compare-mode-next-solver for hangs
Some new tests hang, some old tests don't hang.
r? lcnr or anyone in `@rust-lang/initiative-trait-system-refactor`
|
|
r=lcnr
Use alias-eq in structural normalization
We don't need to register repeated normalizes-to goals in a loop in structural normalize, but instead we can piggyback on the fact that alias-eq will already normalize aliases until they are rigid.
This fixes rust-lang/trait-system-refactor-initiative#78.
r? lcnr
|
|
Check generic params after sigature for main-fn-ty
Fixes #118772
|
|
Desugar `yield` in `async gen` correctly, ensure `gen` always returns unit
1. Ensure `async gen` blocks desugar `yield $expr` to `task_context = yield async_gen_ready($expr)`. Previously we were not assigning the `task_context` correctly, meaning that `yield` expressions in async generators returned type `ResumeTy` instead of `()`, and that we were not storing the `task_context` (which is probably unsound if we were reading the old task-context which has an invalidated borrow or something...)
2. Ensure that all `(async?) gen` blocks and `(async?) gen` fns return unit. Previously we were only checking this for `gen fn`, meaning that `gen {}` and `async gen {}` and `async gen fn` were allowed to return values that weren't unit. This is why #119058 was an ICE rather than an E0308.
Fixes #119058.
|
|
just inferring unit as ret type
|
|
|
|
|
|
|
|
This change introduces a new module to StableMIR named `abi` with
information from `rustc_target::abi` and `rustc_abi`, that allow users
to retrieve more low level information required to perform
bit-precise analysis.
The layout of a type can be retrieved via `Ty::layout`, and the instance
ABI can be retrieved via `Instance::fn_abi()`.
To properly handle errors while retrieve layout information, we had
to implement a few layout related traits.
|
|
|
|
|
|
Fix ICE `ProjectionKinds Deref and Field were mismatched`
Fix #118144
Removed the check that ICEd if the sequence of projection kinds were different across captures. Instead we now sort based only on `Field` projection kinds.
|
|
r=cjgillot
Properly reject `default` on free const items
Fixes #117791.
Technically speaking, this is a breaking change but I doubt it will lead to any real-world regressions (maybe in some macro-trickery crates?). Doing a crater run probably isn't worth it.
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #118852 (coverage: Skip instrumenting a function if no spans were extracted from MIR)
- #118905 ([AIX] Fix XCOFF metadata)
- #118967 (Add better ICE messages for some undescriptive panics)
- #119051 (Replace `FileAllocationInfo` with `FileEndOfFileInfo`)
- #119059 (Deny `~const` trait bounds in inherent impl headers)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
Deny `~const` trait bounds in inherent impl headers
Follow-up to #117817.
Implements https://github.com/rust-lang/rust/pull/117817#discussion_r1416213747.
Fixes #117004.
r? fee1-dead or compiler
|
|
coverage: Skip instrumenting a function if no spans were extracted from MIR
The immediate symptoms of #118643 were fixed by #118666, but some users reported that their builds now encounter another coverage-related ICE:
```
error: internal compiler error: compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs:98:17: A used function should have had coverage mapping data but did not: (...)
```
I was able to reproduce at least one cause of this error: if no relevant spans could be extracted from a function, but the function contains `CoverageKind::SpanMarker` statements, then codegen still thinks the function is instrumented and complains about the fact that it has no coverage spans.
This PR prevents that from happening in two ways:
- If we didn't extract any relevant spans from MIR, skip instrumenting the entire function and don't create a `FunctionCoverateInfo` for it.
- If coverage codegen sees a `CoverageKind::SpanMarker` statement, skip it early and avoid creating `func_coverage`.
---
Fixes #118850.
|
|
|
|
|
|
|