| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
linker: Remove unstable legacy CLI linker flavors
|
|
Generalize small dominators optimization
* Use small dominators optimization from 640ede7b0a1840415cb6ec881c2210302bfeba18 more generally.
* Merge `DefLocation` and `LocationExtended` since they serve the same purpose.
|
|
Always preserve DebugInfo in DeadStoreElimination.
This is a version of #106852 that does not check the current crate's debuginfo flag, and always attempts to preserve debuginfo.
I haven't figured out how to handle mixing debuginfo levels for std, the one for the test, and the one for the CI target just right to merge #106852, so this can at least fix the debuginfo issue.
Fixes https://github.com/rust-lang/rust/issues/103655
|
|
linker: Remove `-Zgcc-ld` option
It is subsumed by `-Clinker-flavor=*-lld-cc -Clink-self-contained=+linker` options now.
r? `@lqd`
|
|
tests/run-make: Move RUSTC_TEST_OP to tools.mk and use in more places
|
|
It is subsumed by `-Clinker-flavor=*-lld-cc -Clink-self-contained=+linker` options now
|
|
compiler: env/path handling fixes
Please see individual commits. r? `@bjorn3` cf. #116426
|
|
Fix to register analysis passes with -Zllvm-plugins at link-time
This PR fixes an unexpected behavior of the `-Zllvm-plugins` flag. It allows to run an out-of-tree pass as part of LTO.
However, analysis passes are registered before the plugin is loaded. As a result an analysis pass, which is passed as a plugin, is not registered. This causes the LLVM PassManager to fail when the analysis pass is queried from a transformation pass [(here)](https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/PassManager.h#L776).
This fix mimics the bahavior in [LLVM LTOBackend.cpp](https://github.com/llvm/llvm-project/blob/main/llvm/lib/LTO/LTOBackend.cpp#L273) by loading the plugin before the analysis passes are registered.
Tested with rustc 1.60 and 1.65 and LLVM-13.0.1.
|
|
Enable new bors try branch to run on CI
Needed to fix [this error](https://github.com/rust-lang/rust/actions/runs/6420044833/job/17431256956). Inspired by https://github.com/rust-lang/rust/pull/99988
Also, removes `try-merge` from the workflow. It shouldn't have been added in https://github.com/rust-lang/rust/pull/116353.
r? `@Mark-Simulacrum`
|
|
Print some information from try builds to GitHub summary
This PR adds some logs from `opt-dist` (the duration of the individual steps of the build pipeline, and the size of the resulting artifacts) to GitHub [job summaries](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/), in order to quickly show useful information right in the GHA CI job page, without needing to read the full log.
[This](https://github.com/rust-lang-ci/rust/actions/runs/5810621086) is how the summary currently looks like.
r? `@ghost`
|
|
Bump host compiler on x64 dist Linux to LLVM 17.0.2
17.0.0-rc3 had a bunch of miscompilations, and it's probably better in general not to use a RC version of LLVM long term on CI.
|
|
Clean up `rustc_features`
Plenty more to be done, but this is a decent start.
r? `@Nilstrieb`
|
|
|
|
r=dtolnay
Fix generic bound of `str::SplitInclusive`'s `DoubleEndedIterator` impl
`str::SplitInclusive`'s `DoubleEndedIterator` implementation currently uses a `ReverseSearcher` bound for the corresponding searcher. A `DoubleEndedSearcher` bound should have been used instead.
`DoubleEndedIterator` requires that repeated `next_back` calls produce the same items as repeated `next` calls, in opposite order. `ReverseSearcher` lets you search starting from the back of a string, but it makes no guarantees about how its matches correspond to the matches found by a forward search. `DoubleEndedSearcher` is a subtrait of `ReverseSearcher` and does require that the same matches are found in both directions.
This bug fix is a breaking change. Calling `next_back` on `"a+++b".split_inclusive("++")` is currently accepted with repeated calls producing `"b"` and `"a+++"`, while forward iteration yields `"a++"` and `"+b"`. Also see https://github.com/rust-lang/rust/issues/100756#issuecomment-1221307166 for more details.
I believe that this is the only iterator that uses this bound incorrectly — other related iterators such as `str::Split` do have a `DoubleEndedSearcher` bound for their `DoubleEndedIterator` implementation. And `slice::SplitInclusive` doesn't face this problem at all because it doesn't use patterns, only a predicate.
cc `@SkiFire13`
|
|
remove Key impls for types that involve an AllocId
I don't understand how but somehow that leads to issues like https://github.com/rust-lang/rust/issues/83085? Anyway removing unused impls doesn't seem like a bad idea. The concerning part is that of course nothing will stop us from having such impls again in the future, alongside re-introducing bugs like #83085.
r? `@oli-obk`
|
|
rustc_monomorphize: Introduce check_fn_args_move_size()
This is in preparation of improving diagnostics of "large moves into functions", a.k.a. passing args.
Note: This PR consists of two self-contained commits that can be reviewed independently.
For https://github.com/rust-lang/rust/issues/83518
Also see https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/arg.20Spans.20for.20TerminatorKind.3A.3ACall.3F
r? `@oli-obk` who is E-mentor
|
|
fix detecting references to packed unsized fields
Fixes https://github.com/rust-lang/rust/issues/115396
This is a breaking change, but permitted as a soundness fix.
|
|
fix fast-path for try_eval_scalar_int
Cc https://github.com/rust-lang/rust/pull/116281 `@Nadrieril`
|
|
So that we later can improve the accuracy of diagnostics.
|
|
And rename to check_operand_move_size(). Later we will introduce
check_fn_args_move_size().
|
|
Miri subtree update
r? `@ghost`
|
|
|
|
To reduce duplication. A follow-up commit will begin using it in even
more places.
|
|
run-make tests are not special but can be blessed like other tests, like
this:
./x.py test --bless tests/run-make/unknown-mod-stdin
|
|
|
|
|
|
r=workingjubilee
Use `HashMap::with_capacity_and_hasher` instead of using base
Cleans up the internal logic for `HashMap::with_capacity` slightly.
|
|
Automatic sync from rustc
|
|
|
|
|
|
Invoke `backtrace-rs` buildscript in `std` buildscript
Based on #99883 by `@Arc-blroth`
Depends on rust-lang/backtrace-rs#556 and rust-lang/cc-rs#705
|
|
Rollup of 4 pull requests
Successful merges:
- #116277 (dont call mir.post_mono_checks in codegen)
- #116400 (Detect missing `=>` after match guard during parsing)
- #116458 (Properly export function defined in test which uses global_asm!())
- #116500 (Add tvOS to target_os for register_dtor)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
r=workingjubilee
Add tvOS to target_os for register_dtor
Closes #116491.
|
|
Properly export function defined in test which uses global_asm!()
Currently the test passes with the LLVM backend as the codegen unit partitioning logic happens to place both the global_asm!() and the function which calls the function defined by the global_asm!() in the same CGU. With the Cranelift backend it breaks however as it will place all assembly in separate codegen units to be passed to an external linker.
|
|
Detect missing `=>` after match guard during parsing
```
error: expected one of `,`, `:`, or `}`, found `.`
--> $DIR/missing-fat-arrow.rs:25:14
|
LL | Some(a) if a.value == b {
| - while parsing this struct
LL | a.value = 1;
| -^ expected one of `,`, `:`, or `}`
| |
| while parsing this struct field
|
help: try naming a field
|
LL | a: a.value = 1;
| ++
help: you might have meant to start a match arm after the match guard
|
LL | Some(a) if a.value == b => {
| ++
```
Fix #78585.
|
|
dont call mir.post_mono_checks in codegen
It seems like all tests are still passing when I remove this... let's see what CI says.
|
|
Use `io_error_more` on WASI
#86442 added many variants to [`io::ErrorKind`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html), but `sys::wasi::decode_error_kind()` wasn't modified to use them.
The preview1 `errno` list:
https://github.com/WebAssembly/WASI/blob/4712d490fd7662f689af6faa5d718e042f014931/legacy/preview1/docs.md#-errno-variant
Original implementation: #63814
`@rustbot` label +A-error-handling +C-enhancement +O-wasi
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #114564 (Attempt to describe the intent behind the `From` trait further)
- #116297 (add some docs to hooks/mod.rs)
- #116423 (Fix typo in attrs.rs)
- #116466 (`rustc_transmute` cleanups)
- #116474 (Assorted small cleanups)
- #116481 (Reuse existing `Some`s in `Option::(x)or`)
- #116484 (Minor doc clarification in Once::call_once)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Minor doc clarification in Once::call_once
|
|
Reuse existing `Some`s in `Option::(x)or`
LLVM still has trouble re-using discriminants sometimes when rebuilding a two-variant enum, so when we have the correct variant already built, just use it.
That's shorter in the Rust code, as well as simpler in MIR and the optimized LLVM, so might as well: <https://rust.godbolt.org/z/KhdE8eToW>
Thanks to `@veber-alex` for pointing out this opportunity in https://github.com/rust-lang/rust/issues/101210#issuecomment-1732470941
|
|
Assorted small cleanups
r? `@spastorino`
|
|
`rustc_transmute` cleanups
Just some things I found while poking around this code.
r? `@oli-obk`
|
|
Fix typo in attrs.rs
documenation -> documentation
|
|
add some docs to hooks/mod.rs
r? `@oli-obk`
|
|
Attempt to describe the intent behind the `From` trait further
Inspired by the <https://internals.rust-lang.org/t/allow-use-as-and-try-as-for-from-and-tryfrom-traits/19240/26?u=scottmcm> thread.
`@rustbot` label +T-libs-api
|
|
Show more information when multiple `impl`s apply
- When there are `impl`s without type params, show only those (to avoid showing overly generic `impl`s).
```
error[E0283]: type annotations needed
--> $DIR/multiple-impl-apply.rs:34:9
|
LL | let y = x.into();
| ^ ---- type must be known at this point
|
note: multiple `impl`s satisfying `_: From<Baz>` found
--> $DIR/multiple-impl-apply.rs:14:1
|
LL | impl From<Baz> for Bar {
| ^^^^^^^^^^^^^^^^^^^^^^
...
LL | impl From<Baz> for Foo {
| ^^^^^^^^^^^^^^^^^^^^^^
= note: required for `Baz` to implement `Into<_>`
help: consider giving `y` an explicit type
|
LL | let y: /* Type */ = x.into();
| ++++++++++++
```
- Lower the importance of `T: Sized`, `T: WellFormed` and coercion errors, to prioritize more relevant errors. The pre-existing deduplication logic deals with hiding redundant errors better that way, and we show errors with more metadata that is useful to the user.
- Show `<SelfTy as Trait>::assoc_fn` suggestion in more cases.
```
error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
--> $DIR/cross-return-site-inference.rs:38:16
|
LL | return Err(From::from("foo"));
| ^^^^^^^^^^ cannot call associated function of trait
|
help: use a fully-qualified path to a specific available implementation
|
LL | return Err(</* self type */ as From>::from("foo"));
| +++++++++++++++++++ +
```
Fix #88284.
|
|
|