| Age | Commit message (Collapse) | Author | Lines |
|
Add a getter for Frame.loc
This is necessary for Priroda.
For context see https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Frame.3A.3Aloc.20no.20longer.20public/near/228070266 and oli-obk/priroda#27.
cc `@DJMcNab`
r? `@RalfJung`
|
|
Use log level to control partitioning debug output
|
|
This is necessary for Priroda.
|
|
Turn inlining threshold into optional values to make it possible to
configure different defaults depending on the current mir-opt-level.
|
|
|
|
Use small hash set in `mir_inliner_callees`
Use small hash set in `mir_inliner_callees` to avoid temporary
allocation when possible and quadratic behaviour for large number of
callees.
|
|
Skip emitting closure diagnostic when closure_kind_origins has no entry
Fixes #82438
This map is not guarnateed to have an entry for a closure.
|
|
Miscellaneous inlining improvements
Inline a few small and hot functions.
|
|
Consider inexpensive inlining criteria first
Refactor inlining decisions so that inexpensive criteria are considered first:
1. Based on code generation attributes.
2. Based on MIR availability (examines call graph).
3. Based on MIR body.
|
|
Replaced some unwrap_or and map_or with lazy variants
Replaced some `unwrap_or` and `map_or` with `unwrap_or_else` and `map_or_else`.
|
|
Stabilize str_split_once
Closes #74773
|
|
[librustdoc] Only split lang string on `,`, ` `, and `\t`
Split markdown lang strings into tokens on `,`.
The previous behavior was to split lang strings into tokens on any
character that wasn't a `_`, `_`, or alphanumeric.
This is a potentially breaking change, so please scrutinize! See discussion in #78344.
I noticed some test cases that made me wonder if there might have been some reason for the original behavior:
```
t("{.no_run .example}", false, true, Ignore::None, true, false, false, false, v(), None);
t("{.sh .should_panic}", true, false, Ignore::None, false, false, false, false, v(), None);
t("{.example .rust}", false, false, Ignore::None, true, false, false, false, v(), None);
t("{.test_harness .rust}", false, false, Ignore::None, true, true, false, false, v(), None);
```
It seemed pretty peculiar to specifically test lang strings in braces, with all the tokens prefixed by `.`.
I did some digging, and it looks like the test cases were added way back in [this commit from 2014](https://github.com/rust-lang/rust/commit/3fef7a74ca9a) by `@skade.`
It looks like they were added just to make sure that the splitting was permissive, and aren't testing that those strings in particular are accepted.
Closes https://github.com/rust-lang/rust/issues/78344.
|
|
Inline a few small and hot functions.
|
|
all InterpError allocate now, so adjust alloc-error-check
Cc https://github.com/rust-lang/rust/pull/82116#discussion_r578310770
r? `@oli-obk`
|
|
|
|
Use correct param_env in conservative_is_privately_uninhabited
cc `@lcnr`
r? `@varkor` since this is your FIXME that was removed ^^
|
|
New mir-opt pass to simplify gotos with const values (reopening #77486)
Reopening PR #77486
Fixes #77355
This pass optimizes the following sequence
```rust
bb2: {
_2 = const true;
goto -> bb3;
}
bb3: {
switchInt(_2) -> [false: bb4, otherwise: bb5];
}
```
into
```rust
bb2: {
_2 = const true;
goto -> bb5;
}
```
|
|
|
|
|
|
Use small hash set in `mir_inliner_callees` to avoid temporary
allocation when possible and quadratic behaviour for large number of
callees.
|
|
Refactor inlining decisions so that inexpensive criteria are considered first:
1. Based on code generation attributes.
2. Based on MIR availability (examines call graph).
3. Based on MIR body.
|
|
|
|
|
|
Fix mir-cfg dumps
Fixes #81918
Fixes #82326 (duplicate)
Fixes #82325
---
r? ``@oli-obk``
|
|
Point out implicit deref coercions in borrow
Fixes #81365
`@Aaron1011` I'm not sure why my code shows the note even in an implicit `Deref` call. See the output for `issue-81365-8.rs`.
|
|
Fixes #82438
This map is not guarnateed to have an entry for a closure.
|
|
use PlaceRef abstractions more consistently
Addresses this [comment](https://github.com/rust-lang/rust/pull/80865/files#r558978715)
Associated issue: #80647
r? ```@RalfJung```
|
|
Fixes #77355
|
|
Fixes #81918
Fixes #82326 (duplicate)
Fixes #82325
|
|
MIR-OPT: Pass to deduplicate blocks
This pass finds basic blocks that are completely equal,
and replaces all uses with just one of them.
```bash
$ RUSTC_LOG=rustc_mir::transform::deduplicate_blocks ./x.py build --stage 2 | grep "SUCCESS: Replacing: " > log
...
$ cat log | wc -l
23875
```
|
|
|
|
|
|
|
|
|
|
rustc_allow_const_fn_unstable()
|
|
|
|
fix MIR fn-ptr pretty-printing
An uninitialized function pointer would get printed as `{{uninit fn()}` (notice the unbalanced parentheses), and a dangling fn ptr would ICE. This fixes both of that.
However, I have no idea how to add tests for this.
Also, I don't understand this MIR pretty-printing code. Somehow the print function `pretty_print_const_scalar` actually *returns* a transformed form of the const (but there is no doc comment explaining what is being returned); some match arms do `p!` while others do `self =`, and there's a wild mixture of `p!` and `write!`... all very mysterious and confusing.^^
r? ``@oli-obk``
|
|
|
|
|
|
Pass large interpreter types by reference, not value
r? `@ghost`
|
|
Update conflict_errors.rs
Add deref definition location
|
|
|
|
|
|
remove useless ?s (clippy::needless_question_marks)
Example code:
```rust
fn opts() -> Option<String> {
let s: Option<String> = Some(String::new());
Some(s?) // this can just be "s"
}
```
|
|
Remove redundant rustc_data_structures path component
|
|
Example code:
```
fn opts() -> Option<String> {
let s: Option<String> = Some(String::new());
Some(s?) // this can just be "s"
}
```
|
|
Rollup of 11 pull requests
Successful merges:
- #79981 (Add 'consider using' message to overflowing_literals)
- #82094 (To digit simplification)
- #82105 (Don't fail to remove files if they are missing)
- #82136 (Fix ICE: Use delay_span_bug for mismatched subst/hir arg)
- #82169 (Document that `assert!` format arguments are evaluated lazily)
- #82174 (Replace File::create and write_all with fs::write)
- #82196 (Add caveat to Path::display() about lossiness)
- #82198 (Use internal iteration in Iterator::is_sorted_by)
- #82204 (Update books)
- #82207 (rustdoc: treat edition 2021 as unstable)
- #82231 (Add long explanation for E0543)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix ICE: Use delay_span_bug for mismatched subst/hir arg
Fixes #82126.
|
|
|
|
|