Skip to content

Rollup of 8 pull requests - #99451

Merged
bors merged 17 commits into
rust-lang:masterfrom
Dylan-DPC:rollup-ceghu18
Jul 19, 2022
Merged

Rollup of 8 pull requests#99451
bors merged 17 commits into
rust-lang:masterfrom
Dylan-DPC:rollup-ceghu18

Conversation

@Dylan-DPC

Copy link
Copy Markdown
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

nnethercoteand others added 17 commits July 18, 2022 10:34
This is needed for my Ubuntu 22.04 box due to a slight change in gdb
output. The fix is similar to the fix in rust-lang#95063.
Improves the compiler error backtrace information, as shown in rust-lang#99363,
by using `span_bug` instead of `bug`.
New output:
```
build/aarch64-apple-darwin/stage1/bin/rustc /tmp/test.rs --edition=2021
error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ test[db0f]::main::T::{opaque#0}), []) for `Field` projection
--> /tmp/test.rs:11:27
|
11 | let Foo((a, b)) = foo;
| ^^^
thread 'rustc' panicked at 'Box<dyn Any>', /Users/jmq/src/forked/rust/compiler/rustc_errors/src/lib.rs:1331:9
stack backtrace:
```
(Remainder of output truncated.)
The restriction that success ordering must be at least as strong as its
failure ordering in compare-exchange operations was lifted in rust-lang#98383.
wf-check generators
fixesrust-lang#90409
We should not rely on generators being well formed by construction now that they can get used via type alias impl trait (and thus users can choose generic arguments that are invalid). This can cause surprising behaviour if (definitely unsound) transmutes are used, and it's generally saner to just check for well formedness.
…estebank
Mention first and last macro in backtrace
Slight improvement to diagnostic mentioning what macro an error originates from. Not sure if it's worthwhile.
Use split_once in FromStr docs
Current implementation:
```rust
fn from_str(s: &str) -> Result<Self, Self::Err> {
let coords: Vec<&str> = s.trim_matches(|p| p == '(' || p == ')' )
.split(',')
.collect();
let x_fromstr = coords[0].parse::<i32>()?;
let y_fromstr = coords[1].parse::<i32>()?;
Ok(Point { x: x_fromstr, y: y_fromstr })
}
```
Creating the vector is not necessary, `split_once` does the job better.
Alternatively we could also remove `trim_matches` with `strip_prefix` and `strip_suffix`:
```rust
let (x, y) = s
.strip_prefix('(')
.and_then(|s| s.strip_suffix(')'))
.and_then(|s| s.split_once(','))
.unwrap();
```
The question is how much 'correctness' is too much and distracts from the example. In a real implementation you would also not unwrap (or originally access the vector without bounds checks), but implementing a custom Error and adding a `From<ParseIntError>` and implementing the `Error` trait adds a lot of code to the example which is not relevant to the `FromStr` trait.
…al-def-id, r=oli-obk
Use `LocalDefId` in `OpaqueTypeKey`
Addresses a `// FIXME(oli-obk): make this a LocalDefId`
r? ``@oli-obk``
…pnkfelix
Fix debuginfo tests.
This is needed for my Ubuntu 22.04 box due to a slight change in gdb
output. The fix is similar to the fix in rust-lang#95063.
Use span_bug for unexpected field projection type
Improves the compiler error backtrace information, as shown in rust-lang#99363,
by using `span_bug` instead of `bug`.
New output:
```
build/aarch64-apple-darwin/stage1/bin/rustc /tmp/test.rs --edition=2021
error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ test[db0f]::main::T::{opaque#0}), []) for `Field` projection
--> /tmp/test.rs:11:27
|
11 | let Foo((a, b)) = foo;
| ^^^
thread 'rustc' panicked at 'Box<dyn Any>', /Users/jmq/src/forked/rust/compiler/rustc_errors/src/lib.rs:1331:9
stack backtrace:
```
(Remainder of output truncated.)
Update invalid atomic ordering lint
The restriction that success ordering must be at least as strong as its
failure ordering in compare-exchange operations was lifted in rust-lang#98383.
…=scottmcm
Fix `Skip::next` for non-fused inner iterators
`iter.skip(n).next()` will currently call `nth` and `next` in succession on `iter`, without checking whether `nth` exhausts the iterator. Using `?` to propagate a `None` value returned by `nth` avoids this.
@rustbotrustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 19, 2022
@Dylan-DPC

Copy link
Copy Markdown
MemberAuthor

@bors r+ rollup=never p=5

@bors

bors commented Jul 19, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit e301cd3 has been approved by Dylan-DPC

It is now in the queue for this repository.

@borsbors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 19, 2022
@bors

bors commented Jul 19, 2022

Copy link
Copy Markdown
Collaborator

⌛ Testing commit e301cd3 with merge 4603ac3...

@bors

bors commented Jul 19, 2022

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing 4603ac3 to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Jul 19, 2022
@bors
bors merged commit 4603ac3 into rust-lang:masterJul 19, 2022
@rustbotrustbot added this to the 1.64.0 milestone Jul 19, 2022
@rust-highfive

Copy link
Copy Markdown
Contributor

📣 Toolstate changed by #99451!

Tested on commit 4603ac3.
Direct link to PR: #99451

💔 miri on windows: test-pass → test-fail (cc @RalfJung@oli-obk).
💔 miri on linux: test-pass → test-fail (cc @RalfJung@oli-obk).

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (4603ac3): comparison url.

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: no relevant changes found
mean1maxcount2
Regressions 😿
(primary)
N/AN/A0
Regressions 😿
(secondary)
N/AN/A0
Improvements 🎉
(primary)
-5.9%-5.9%1
Improvements 🎉
(secondary)
N/AN/A0
All 😿🎉 (primary)-5.9%-5.9%1

Cycles

This benchmark run did not return any relevant results for this metric.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change

  2. number of relevant changes

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.rollupA PR which is a rollupS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

11 participants

@Dylan-DPC@bors@rust-highfive@rust-timer@rustbot@nnethercote@Dav1dde@tmiasko@oli-obk@timvermeulen@compiler-errors