rustdoc: remove no-op CSS `h3.variant, .sub-variant h4 { border-bottom: none }`
This rule, added in 69df43b041 to override the default `h4` style, has been obsoleted when a65c98fefb changed it so that only the top docblock put `border-bottom` on `h4.`
Reinstate `hir-stats.rs` test for stage 1.
It was disabled in #94075 for stage 1 because that PR changed type layouts such that the results for this test were different for stage 1 and stage 2. But now that #94075 is in beta, the results for this test are now the same for stage 1 and stage 2.
r? ```@lqd```
remove the unused :: between trait and type to give user correct diag…
…nostic information
modified: compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
new file: src/test/ui/type/issue-101866.rs
new file: src/test/ui/type/issue-101866.stderr
Manually order `DefId` on 64-bit big-endian
`DefId` uses different field orders on 64-bit big-endian vs. others, in
order to optimize its `Hash` implementation. However, that also made it
derive different lexical ordering for `PartialOrd` and `Ord`. That
caused spurious differences wherever `DefId`s are sorted, like the
candidate sources list in `report_method_error`.
Now we manually implement `PartialOrd` and `Ord` on 64-bit big-endian to
match the same lexical ordering as other targets, fixing at least one
test, `src/test/ui/methods/method-ambig-two-traits-cross-crate.rs`.
Added more const_closure functionality
Enables ConstFnMutClosure to use a tuple of mutable references instead of just a mutable reference to a tuple.
Removes the new function, since it would barely be usable with this new code.
r? `@fee1-dead`
Fix integer overflow in `format!("{:.0?}", Duration::MAX)`
Currently `format!("{:.0?}", Duration::MAX)` causes an integer overflow in the `Duration` `Debug` impl ([playground link](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=67675c6895bdb2e37ee727f0ed7622b2)). This is because the carry from the rounding of the fractional_part into the integer_part will cause the integer_part to overflow as it is already `u64::MAX`. This PR uses a larger integer type to avoid that issue, and adds a test for the correct behaviour.
Adjust the s390x data layout for LLVM 16
LLVM [D131158] changed the SystemZ data layout to always set 64-bit
vector alignment, which used to be conditional on the "vector" feature.
[D131158]: https://reviews.llvm.org/D131158
r? `@nikic`
rustdoc: remove no-op source sidebar `opacity`
These rules were added in dc2c972334 to work with CSS transitions. They're otherwise redundant, since the `visibility` property already hides everything.
dc2c972334/src/librustdoc/html/static/css/rustdoc.css (L350-L354)
The transition was remove with 237d62588d, but the now-redundant `opacity` property was not.
rustdoc: remove unneeded CSS `.rust-example-rendered { position }`
The Run button isn't inside the `<pre>` any more. It's instead nested below the example wrapper.
The class name can't be removed from the DOM, because `main.js` uses it.
Improve errors for incomplete functions in struct definitions
Given the following code:
```rust
fn main() {}
struct Foo {
fn
}
```
[playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=29139f870511f6918324be5ddc26c345)
The current output is:
```
Compiling playground v0.0.1 (/playground)
error: functions are not allowed in struct definitions
--> src/main.rs:4:5
|
4 | fn
| ^^
|
= help: unlike in C++, Java, and C#, functions are declared in `impl` blocks
= help: see https://doc.rust-lang.org/book/ch05-03-method-syntax.html for more information
error: could not compile `playground` due to previous error
```
In this case, rustc should suggest escaping `fn` to use it as an identifier.
Migrate rustc_codegen_gcc to SessionDiagnostics
As part of #100717 this pr migrates diagnostics to `SessionDiagnostics` for the `rustc_codegen_gcc` crate.
``@rustbot`` label +A-translation
This rule, added in 69df43b041 to override the
default `h4` style, has been obsoleted when
a65c98fefb changed it so that only the top
docblock put `border-bottom` on `h4.`
remove outdated coherence hack
we have a more precise detection for downstream conflicts in candidate assembly: the `is_knowable` check in `candidate_from_obligation_no_cache`.
r? types cc `@nikomatsakis`
LLVM [D131158] changed the SystemZ data layout to always set 64-bit
vector alignment, which used to be conditional on the "vector" feature.
[D131158]: https://reviews.llvm.org/D131158
It was disabled in #94075 for stage 1 because that PR changed type
layouts such that the results for this test were different for stage 1
and stage 2. But now that #94075 is in beta, the results for this test
are now the same for stage 1 and stage 2.
modified: compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
new file: src/test/ui/type/issue-101866.rs
new file: src/test/ui/type/issue-101866.stderr
Rollup of 7 pull requests
Successful merges:
- #102214 (Fix span of byte-escaped left format args brace)
- #102426 (Don't export `__wasm_init_memory` on WebAssembly.)
- #102437 (rustdoc: cut margin-top from first header in docblock)
- #102442 (rustdoc: remove bad CSS font-weight on `.impl`, `.method`, etc)
- #102447 (rustdoc: add method spacing to trait methods)
- #102468 (tidy: make rustc dependency error less confusing)
- #102476 (Split out the error reporting logic into a separate function)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Split out the error reporting logic into a separate function
I was trying to read the function and got distracted by the huge block of code in the middle of it. Turns out it only reports diagnostics and all paths within it end in an error. The main function is now more readable imo.
tidy: make rustc dependency error less confusing
The current wording leads to very confusing messages:
```
tidy error: Dependencies for main workspace not explicitly permitted:
* unicode-ident 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)
```
Miri is part of that workspace, and there never was a problem adding Miri dependencies. The actual error is that due to a crate bump this now showed up as a rustc dependency, and *those* are restricted.