Skip to content

Commit 869b3cc

Browse files
committed
Auto merge of rust-lang#134879 - Zalathar:rollup-olayokx, r=Zalathar
Rollup of 3 pull requests Successful merges: - rust-lang#133460 (Use `check-run-results` for `run-fail` test stderr) - rust-lang#134627 (Avoid ICE in borrowck) - rust-lang#134799 (nits: Cleanups in `librustdoc::clean`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 480eec0 + 8dc9921 commit 869b3cc

File tree

366 files changed

+930
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

366 files changed

+930
-234
lines changed

Diff for: compiler/rustc_borrowck/src/region_infer/mod.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1950,8 +1950,14 @@ impl<'tcx> RegionInferenceContext<'tcx> {
19501950
target_test: impl Fn(RegionVid) -> bool,
19511951
) -> (BlameConstraint<'tcx>, Vec<ExtraConstraintInfo>) {
19521952
// Find all paths
1953-
let (path, target_region) =
1954-
self.find_constraint_paths_between_regions(from_region, target_test).unwrap();
1953+
let (path, target_region) = self
1954+
.find_constraint_paths_between_regions(from_region, target_test)
1955+
.or_else(|| {
1956+
self.find_constraint_paths_between_regions(from_region, |r| {
1957+
self.cannot_name_placeholder(from_region, r)
1958+
})
1959+
})
1960+
.unwrap();
19551961
debug!(
19561962
"path={:#?}",
19571963
path.iter()

Diff for: src/librustdoc/clean/mod.rs

+10-12
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ fn clean_poly_trait_ref_with_constraints<'tcx>(
268268
)
269269
}
270270

271-
fn clean_lifetime(lifetime: &hir::Lifetime, cx: &mut DocContext<'_>) -> Lifetime {
271+
fn clean_lifetime(lifetime: &hir::Lifetime, cx: &DocContext<'_>) -> Lifetime {
272272
if let Some(
273273
rbv::ResolvedArg::EarlyBound(did)
274274
| rbv::ResolvedArg::LateBound(_, _, did)
@@ -362,9 +362,9 @@ pub(crate) fn clean_predicate<'tcx>(
362362
let bound_predicate = predicate.kind();
363363
match bound_predicate.skip_binder() {
364364
ty::ClauseKind::Trait(pred) => clean_poly_trait_predicate(bound_predicate.rebind(pred), cx),
365-
ty::ClauseKind::RegionOutlives(pred) => clean_region_outlives_predicate(pred),
365+
ty::ClauseKind::RegionOutlives(pred) => Some(clean_region_outlives_predicate(pred)),
366366
ty::ClauseKind::TypeOutlives(pred) => {
367-
clean_type_outlives_predicate(bound_predicate.rebind(pred), cx)
367+
Some(clean_type_outlives_predicate(bound_predicate.rebind(pred), cx))
368368
}
369369
ty::ClauseKind::Projection(pred) => {
370370
Some(clean_projection_predicate(bound_predicate.rebind(pred), cx))
@@ -396,32 +396,30 @@ fn clean_poly_trait_predicate<'tcx>(
396396
})
397397
}
398398

399-
fn clean_region_outlives_predicate(
400-
pred: ty::RegionOutlivesPredicate<'_>,
401-
) -> Option<WherePredicate> {
399+
fn clean_region_outlives_predicate(pred: ty::RegionOutlivesPredicate<'_>) -> WherePredicate {
402400
let ty::OutlivesPredicate(a, b) = pred;
403401

404-
Some(WherePredicate::RegionPredicate {
402+
WherePredicate::RegionPredicate {
405403
lifetime: clean_middle_region(a).expect("failed to clean lifetime"),
406404
bounds: vec![GenericBound::Outlives(
407405
clean_middle_region(b).expect("failed to clean bounds"),
408406
)],
409-
})
407+
}
410408
}
411409

412410
fn clean_type_outlives_predicate<'tcx>(
413411
pred: ty::Binder<'tcx, ty::TypeOutlivesPredicate<'tcx>>,
414412
cx: &mut DocContext<'tcx>,
415-
) -> Option<WherePredicate> {
413+
) -> WherePredicate {
416414
let ty::OutlivesPredicate(ty, lt) = pred.skip_binder();
417415

418-
Some(WherePredicate::BoundPredicate {
416+
WherePredicate::BoundPredicate {
419417
ty: clean_middle_ty(pred.rebind(ty), cx, None, None),
420418
bounds: vec![GenericBound::Outlives(
421419
clean_middle_region(lt).expect("failed to clean lifetimes"),
422420
)],
423421
bound_params: Vec::new(),
424-
})
422+
}
425423
}
426424

427425
fn clean_middle_term<'tcx>(
@@ -1860,7 +1858,7 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
18601858

18611859
/// Returns `None` if the type could not be normalized
18621860
fn normalize<'tcx>(
1863-
cx: &mut DocContext<'tcx>,
1861+
cx: &DocContext<'tcx>,
18641862
ty: ty::Binder<'tcx, Ty<'tcx>>,
18651863
) -> Option<ty::Binder<'tcx, Ty<'tcx>>> {
18661864
// HACK: low-churn fix for #79459 while we wait for a trait normalization fix

Diff for: src/tools/tidy/src/ui_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use ignore::Walk;
1717
const ENTRY_LIMIT: u32 = 901;
1818
// FIXME: The following limits should be reduced eventually.
1919

20-
const ISSUES_ENTRY_LIMIT: u32 = 1667;
20+
const ISSUES_ENTRY_LIMIT: u32 = 1679;
2121

2222
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2323
"rs", // test source files

Diff for: tests/ui/array-slice-vec/dst-raw-slice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Test bounds checking for DST raw slices
22

33
//@ run-fail
4-
//@ error-pattern:index out of bounds
4+
//@ check-run-results:index out of bounds
55
//@ ignore-emscripten no processes
66

77
#[allow(unconditional_panic)]

Diff for: tests/ui/array-slice-vec/dst-raw-slice.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/dst-raw-slice.rs:11:18:
2+
index out of bounds: the len is 3 but the index is 3
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/array-slice-vec/vec-overrun.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:index out of bounds: the len is 1 but the index is 2
2+
//@ check-run-results:index out of bounds: the len is 1 but the index is 2
33
//@ ignore-emscripten no processes
44

55
fn main() {

Diff for: tests/ui/array-slice-vec/vec-overrun.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/vec-overrun.rs:11:17:
2+
index out of bounds: the len is 1 but the index is 2
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-completion.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// be talking about `async fn`s instead.
33

44
//@ run-fail
5-
//@ error-pattern: thread 'main' panicked
6-
//@ error-pattern: `async fn` resumed after completion
5+
//@ check-run-results: thread 'main' panicked
6+
//@ check-run-results: `async fn` resumed after completion
77
//@ edition:2018
88

99
#![feature(coroutines, coroutine_trait)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/issue-65419-async-fn-resume-after-completion.rs:11:16:
2+
`async fn` resumed after completion
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
//@ run-fail
55
//@ needs-unwind
6-
//@ error-pattern: thread 'main' panicked
7-
//@ error-pattern: `async fn` resumed after panicking
6+
//@ check-run-results: thread 'main' panicked
7+
//@ check-run-results: `async fn` resumed after panicking
88
//@ edition:2018
99

1010
#![feature(coroutines, coroutine_trait)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
thread 'main' panicked at $DIR/issue-65419-async-fn-resume-after-panic.rs:15:5:
2+
explicit panic
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4+
thread 'main' panicked at $DIR/issue-65419-async-fn-resume-after-panic.rs:14:16:
5+
`async fn` resumed after panicking

Diff for: tests/ui/async-await/issues/issue-65419/issue-65419-coroutine-resume-after-completion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// panic when resumed after completion.
44

55
//@ run-fail
6-
//@ error-pattern:coroutine resumed after completion
6+
//@ check-run-results:coroutine resumed after completion
77
//@ edition:2018
88

99
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/issue-65419-coroutine-resume-after-completion.rs:15:5:
2+
coroutine resumed after completion
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/binop/binop-fail-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:quux
2+
//@ check-run-results:quux
33
//@ ignore-emscripten no processes
44

55
fn foo() -> ! {

Diff for: tests/ui/binop/binop-fail-3.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/binop-fail-3.rs:6:5:
2+
quux
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/binop/binop-panic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:quux
2+
//@ check-run-results:quux
33
//@ ignore-emscripten no processes
44

55
fn my_err(s: String) -> ! {

Diff for: tests/ui/binop/binop-panic.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/binop-panic.rs:7:5:
2+
quux
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/binop/binop-panic.run.stdout

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bye

Diff for: tests/ui/borrowck/borrowck-local-borrow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:panic 1
2+
//@ check-run-results:panic 1
33
//@ ignore-emscripten no processes
44

55
fn main() {

Diff for: tests/ui/borrowck/borrowck-local-borrow.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/borrowck-local-borrow.rs:8:5:
2+
panic 1
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/crashes/133252.rs renamed to tests/ui/borrowck/implementation-not-general-enough-ice-133252.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ known-bug: #133252
1+
// Regression test for borrowck ICE #133252
22
//@ edition:2021
33
use std::future::Future;
44

@@ -7,6 +7,8 @@ fn ice() -> impl Future<Output = &'static dyn Owned> {
77
async {
88
let not_static = 0;
99
force_send(async_load(&not_static));
10+
//~^ ERROR implementation of `LoadQuery` is not general enough
11+
//~| ERROR `not_static` does not live long enough
1012
loop {}
1113
}
1214
}
@@ -41,3 +43,5 @@ impl Future for SimpleFuture {
4143
loop {}
4244
}
4345
}
46+
47+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
error: implementation of `LoadQuery` is not general enough
2+
--> $DIR/implementation-not-general-enough-ice-133252.rs:9:9
3+
|
4+
LL | force_send(async_load(&not_static));
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `LoadQuery` is not general enough
6+
|
7+
= note: `LoadQuery<'0>` would have to be implemented for the type `&u8`, for any lifetime `'0`...
8+
= note: ...but `LoadQuery<'1>` is actually implemented for the type `&'1 u8`, for some specific lifetime `'1`
9+
10+
error[E0597]: `not_static` does not live long enough
11+
--> $DIR/implementation-not-general-enough-ice-133252.rs:9:31
12+
|
13+
LL | async {
14+
| - return type of async block is &(dyn Owned + '1)
15+
LL | let not_static = 0;
16+
| ---------- binding `not_static` declared here
17+
LL | force_send(async_load(&not_static));
18+
| -----------^^^^^^^^^^^-
19+
| | |
20+
| | borrowed value does not live long enough
21+
| argument requires that `not_static` is borrowed for `'1`
22+
...
23+
LL | }
24+
| - `not_static` dropped here while still borrowed
25+
|
26+
note: due to current limitations in the borrow checker, this implies a `'static` lifetime
27+
--> $DIR/implementation-not-general-enough-ice-133252.rs:16:18
28+
|
29+
LL | fn force_send<T: Send>(_: T) {}
30+
| ^^^^
31+
32+
error: aborting due to 2 previous errors
33+
34+
For more information about this error, try `rustc --explain E0597`.

Diff for: tests/ui/borrowck/issue-28934.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// which were not being considered during the contraction phase.
33

44
//@ run-fail
5-
//@ error-pattern:explicit panic
5+
//@ check-run-results:explicit panic
66
//@ ignore-emscripten no processes
77

88
struct Parser<'i: 't, 't>(&'i u8, &'t u8);

Diff for: tests/ui/borrowck/issue-28934.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/issue-28934.rs:14:9:
2+
explicit panic
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/closures/diverging-closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:oops
2+
//@ check-run-results:oops
33
//@ ignore-emscripten no processes
44

55
fn main() {

Diff for: tests/ui/closures/diverging-closure.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/diverging-closure.rs:7:9:
2+
oops
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/consts/issue-29798.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:index out of bounds: the len is 5 but the index is 5
2+
//@ check-run-results:index out of bounds: the len is 5 but the index is 5
33
//@ ignore-emscripten no processes
44

55
const fn test(x: usize) -> i32 {

Diff for: tests/ui/consts/issue-29798.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/issue-29798.rs:6:5:
2+
index out of bounds: the len is 5 but the index is 5
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/coroutine/coroutine-resume-after-panic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ run-fail
22
//@ needs-unwind
3-
//@ error-pattern:coroutine resumed after panicking
3+
//@ check-run-results:coroutine resumed after panicking
44
//@ ignore-emscripten no processes
55

66
// Test that we get the correct message for resuming a panicked coroutine.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
thread 'main' panicked at $DIR/coroutine-resume-after-panic.rs:18:9:
2+
explicit panic
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
4+
thread 'main' panicked at $DIR/coroutine-resume-after-panic.rs:17:30:
5+
coroutine resumed after panicking

Diff for: tests/ui/expr/if/expr-if-panic-fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:explicit panic
2+
//@ check-run-results:explicit panic
33
//@ ignore-emscripten no processes
44

55
fn f() -> ! {

Diff for: tests/ui/expr/if/expr-if-panic-fn.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/expr-if-panic-fn.rs:6:5:
2+
explicit panic
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/expr/if/expr-if-panic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:explicit panic
2+
//@ check-run-results:explicit panic
33
//@ ignore-emscripten no processes
44

55
fn main() {

Diff for: tests/ui/expr/if/expr-if-panic.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/expr-if-panic.rs:9:9:
2+
explicit panic
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/expr/if/if-check-panic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:Number is odd
2+
//@ check-run-results:Number is odd
33
//@ ignore-emscripten no processes
44

55
fn even(x: usize) -> bool {

Diff for: tests/ui/expr/if/if-check-panic.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/if-check-panic.rs:19:9:
2+
Number is odd
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/expr/if/if-cond-bot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:quux
2+
//@ check-run-results:quux
33
//@ ignore-emscripten no processes
44

55
fn my_err(s: String) -> ! {

Diff for: tests/ui/expr/if/if-cond-bot.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/if-cond-bot.rs:7:5:
2+
quux
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/expr/if/if-cond-bot.run.stdout

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bye

Diff for: tests/ui/extern/issue-18576.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:stop
2+
//@ check-run-results:stop
33
//@ ignore-emscripten no processes
44

55
// #18576

Diff for: tests/ui/extern/issue-18576.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/issue-18576.rs:11:5:
2+
stop
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/fn/expr-fn-panic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:explicit panic
2+
//@ check-run-results:explicit panic
33
//@ ignore-emscripten no processes
44

55
fn f() -> ! {

Diff for: tests/ui/fn/expr-fn-panic.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/expr-fn-panic.rs:6:5:
2+
explicit panic
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/hashmap/hashmap-capacity-overflow.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ run-fail
22
//@ error-pattern:capacity overflow
33
//@ ignore-emscripten no processes
4+
//@ compile-flags: --remap-path-prefix={{rust-src-base}}=remapped
45

56
use std::collections::hash_map::HashMap;
67
use std::mem::size_of;

Diff for: tests/ui/imports/glob-use-std.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Issue #7580
22

33
//@ run-fail
4-
//@ error-pattern:panic works
4+
//@ check-run-results:panic works
55
//@ ignore-emscripten no processes
66

77
use std::*;

Diff for: tests/ui/imports/glob-use-std.run.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
thread 'main' panicked at $DIR/glob-use-std.rs:10:5:
2+
panic works
3+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/ui/issues/issue-12920.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-fail
2-
//@ error-pattern:explicit panic
2+
//@ check-run-results:explicit panic
33
//@ ignore-emscripten no processes
44

55
pub fn main() {

0 commit comments

Comments
 (0)