| Age | Commit message (Collapse) | Author | Lines |
|
r=fee1-dead
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
|
|
Inline a few functions.
r? `@ghost`
|
|
This rule, added in 69df43b041f76251391f11264c1ff763ca2a64a0 to override the
default `h4` style, has been obsoleted when
a65c98fefb78cddee955b87214732b0de30a769f changed it so that only the top
docblock put `border-bottom` on `h4.`
|
|
|
|
Serialize return-position `impl Trait` in trait hidden values in foreign libraries
Fixes #101630
|
|
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.
|
|
Shrink `hir::def::Res`
r? `@spastorino`
|
|
|
|
|
|
These rules were added in dc2c9723343c985740be09919236a6e96c4e4433 to work
with CSS transitions. They're otherwise redundant, since the `visibility`
property already hides everything.
https://github.com/rust-lang/rust/blob/dc2c9723343c985740be09919236a6e96c4e4433/src/librustdoc/html/static/css/rustdoc.css#L350-L354
The transition was remove with 237d62588ddb4b7a93f3f5c61ea9253eba30ed5d, but
the now-redundant `opacity` property was not.
|
|
|
|
|
|
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
|
|
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.
|
|
rustdoc: add method spacing to trait methods
More cleanup for 8846c0853d8687fda0e5f23f6687b03b243980ee, this time in trait layouts when things are collapsed.
This PR makes two changes to the appearance of trait pages:
* It adds the `method-toggle` class to method toggles on traits, making the DOM more consistent with type pages (which already have this class).
## Before

## After

* It adds a bottom margin to docblocks nested directly in the implementors list, giving it a similar appearance to if it was nested within a toggle.
## Before

## After

|
|
rustdoc: remove bad CSS font-weight on `.impl`, `.method`, etc
This line was added in c494a06064017f307a8d9dc4797e614d2ed99143, because at the time, the headers had these classes on them. Now, the headers are children of the `<section>` with the class on it.
This commit also adds a test case, to make sure the srclink font weight does not regress again.
|
|
rustdoc: cut margin-top from first header in docblock
Fixes a regression caused by 8846c0853d8687fda0e5f23f6687b03b243980ee, where a header's top margin used to be collapsed, but isn't any more.
## Before

## After

|
|
Don't export `__wasm_init_memory` on WebAssembly.
Since #72889, the Rust wasm target doesn't use --passive-segments, so remove the `--export=__wasm_init_memory`.
As documented in the [tool-conventions Linking convention], `__wasm_init_memory` is not intended to be exported.
[tool-conventions Linking convention]: https://github.com/WebAssembly/tool-conventions/blob/7c064f304858f67ebf22964a84b7e9658e29557a/Linking.md#shared-memory-and-passive-segments
|
|
Fix span of byte-escaped left format args brace
Fix #102057 (see issue for example).
Previously, the use of escaped left braces (`\x7B`) in format args resulted in an incorrectly offset span. This patch fixes that by considering any escaped characters within the string instead of using a constant offset.
|
|
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.
|
|
Fix perf regression from TypeVisitor changes
Regression occurred in https://github.com/rust-lang/rust/pull/101858#issuecomment-1248732579
Instead of just reverting, we only fixed part of the regression. The main regression was due to actually correctly visiting a type that contains types and consts and should therefor be visited. This is not actually observable (yet?), but we should still do it correctly instead of risking major bugs in the future.
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #102336 (Fix associated type bindings with anon const in GAT position)
- #102342 (Add negation methods for signed non-zero integers.)
- #102385 (Don't export `__heap_base` and `__data_end` on wasm32-wasi.)
- #102435 (Improve example of Iterator::reduce)
- #102436 (rustdoc: clean up "normalize.css 8" input override CSS)
- #102452 (fix minor ungrammatical sentence)
- #102455 (Use let-chaining in `WhileTrue::check_expr`.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Use let-chaining in `WhileTrue::check_expr`.
This has been bugging me for a while.
r? `@lqd`
|
|
fix minor ungrammatical sentence
This fixes an innocuous ungrammatical sentence in example code in the `TryFrom` documentation.
|
|
rustdoc: clean up "normalize.css 8" input override CSS
These rules were copied from normalize.css 3, and are mostly redundant.
* `optgroup` isn't used in rustdoc at all
* `textarea` is only used for the "copy" button, so it's not visible
* The remaining buttons and inputs mostly have styles set anyway.
* We should never be setting `color` without also setting the background to something. Otherwise, you get white-on-gray text. That seems to be [the reason] why `normalize.css` changed this.
[the reason]: https://github.com/necolas/normalize.css/pull/502
|
|
r=thomcc,vacuus
Improve example of Iterator::reduce
Fixes #81819.
I took your example `@bstrie` from https://github.com/rust-lang/rust/issues/81819 and applied it here.
r? `@thomcc`
|
|
r=davidtwco
Don't export `__heap_base` and `__data_end` on wasm32-wasi.
`__heap_base` and `__data_end` are exported for use by wasm-bindgen, which uses the wasm32-unknown-unknown target. On wasm32-wasi, as a step toward implementing the Canonical ABI, and as an aid to building speicalized WASI API polyfill wrappers, don't export `__heap_base` and `__data_end` on wasm32-wasi.
|
|
Add negation methods for signed non-zero integers.
Performing negation with defined wrapping semantics (such as `wrapping_neg()`) on a non-zero integer currently requires unpacking to a primitive and re-wrapping. Since negation of non-zero signed integers always produces a non-zero result, it is safe to implement the various `*_neg()` methods for `NonZeroI{N}`.
I'm not sure what to do about the `#[unstable(..., issue = "none")]` here -- should I file a tracking issue, or is that handled by the Rust dev team?
ACP: https://github.com/rust-lang/libs-team/issues/105
|
|
Fix associated type bindings with anon const in GAT position
The first commit formats `type_of.rs`, which is really hard to maintain since it uses a bunch of features like `let`-chains and `if let` match arm bindings. Best if you just review the second two diffs.
Fixes #102333
|
|
|
|
Split collect.rs
This file was way too big (adding a few lines of code caused tidy to trigger)
|
|
|
|
|
|
Enable inline stack probes on PowerPC and SystemZ
The LLVM PowerPC and SystemZ targets have both supported `"probe-stack"="inline-asm"` for longer than our current minimum LLVM 13 requirement, so we can turn this on for all `powerpc`, `powerpc64`, `powerpc64le`, and `s390x` targets in Rust. These are all tier-2 or lower, so CI does not run their tests, but I have confirmed that their `linux-gnu` variants do pass on RHEL.
cc #43241
|
|
Rollup of 8 pull requests
Successful merges:
- #98368 (Make `std::os::fd` public.)
- #102085 (Code refactoring smart_resolve_report_errors)
- #102351 (Improve E0585 help)
- #102368 (Add a niche to `Duration`, unix `SystemTime`, and non-apple `Instant`)
- #102393 (Add regression test for issue 94923)
- #102399 (Account for use of index-based lifetime names in print of binder)
- #102416 (remove FIXME, improve documentation)
- #102433 (env::temp_dir: fix a typo)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
More cleanup for 8846c0853d8687fda0e5f23f6687b03b243980ee, this time in trait
layouts when things are collapsed.
|
|
env::temp_dir: fix a typo
|
|
remove FIXME, improve documentation
r? types
|
|
Account for use of index-based lifetime names in print of binder
Fixes https://github.com/rust-lang/rust/issues/102374
r? ```@lcnr```
cc ```@steffahn```
|
|
r=JohnTitor
Add regression test for issue 94923
Fixes #94923
|
|
Add a niche to `Duration`, unix `SystemTime`, and non-apple `Instant`
As the nanoseconds fields is always between `0` and `(NANOS_PER_SEC - 1)` inclusive, use the `rustc_layout_scalar_valid_range` attributes to create a niche in the nanosecond field of `Duration` and `Timespec` (which is used to implement unix `SystemTime` and non-apple unix `Instant`; windows `Instant` is implemented with `Duration` and therefore will also benefit). This change has the benefit of making `Option<T>` the same size as `T` for the previously mentioned types. Also shrinks the nanoseconds field of `Timespec` to a `u32` as nanoseconds do not need the extra range of an `i64`, shrinking `Timespec` by 4 bytes on 32-bit platforms.
r? ```@joshtriplett```
|