Auto merge of #78562 - JohnTitor:rollup-otg906u, r=JohnTitor
Rollup of 8 pull requests Successful merges: - #77334 (Reorder benches const variable) - #77888 (Simplify a nested bool match) - #77921 (f64: Refactor collapsible_if) - #78523 (Revert invalid `fn` return type parsing change) - #78524 (Avoid BorrowMutError with RUSTC_LOG=debug) - #78545 (Make anonymous binders start at 0) - #78554 (Improve wording of `core::ptr::drop_in_place` docs) - #78556 (Link to pass docs from NRVO module docs) Failed merges: - #78424 (Fix some more clippy warnings) r? `@ghost`
This commit is contained in:
commit
388ef34904
28 changed files with 84 additions and 97 deletions
1
src/test/ui/auxiliary/rustc-rust-log-aux.rs
Normal file
1
src/test/ui/auxiliary/rustc-rust-log-aux.rs
Normal file
|
|
@ -0,0 +1 @@
|
|||
// rustc-env:RUSTC_LOG=debug
|
||||
|
|
@ -6,7 +6,7 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
|
|||
|
|
||||
= note: expected fn pointer `fn(&u32)`
|
||||
found fn pointer `fn(&'x u32)`
|
||||
note: the anonymous lifetime #2 defined on the body at 16:48...
|
||||
note: the anonymous lifetime #1 defined on the body at 16:48...
|
||||
--> $DIR/expect-fn-supply-fn.rs:16:48
|
||||
|
|
||||
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
|
||||
|
|
@ -30,7 +30,7 @@ note: the lifetime `'x` as defined on the function body at 13:36...
|
|||
|
|
||||
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) {
|
||||
| ^^
|
||||
note: ...does not necessarily outlive the anonymous lifetime #2 defined on the body at 16:48
|
||||
note: ...does not necessarily outlive the anonymous lifetime #1 defined on the body at 16:48
|
||||
--> $DIR/expect-fn-supply-fn.rs:16:48
|
||||
|
|
||||
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {});
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ LL | closure_expecting_bound(|x: &'x u32| {
|
|||
|
|
||||
= note: expected reference `&u32`
|
||||
found reference `&'x u32`
|
||||
note: the anonymous lifetime #2 defined on the body at 14:29...
|
||||
note: the anonymous lifetime #1 defined on the body at 14:29...
|
||||
--> $DIR/expect-region-supply-region-2.rs:14:29
|
||||
|
|
||||
LL | closure_expecting_bound(|x: &'x u32| {
|
||||
|
|
@ -37,7 +37,7 @@ note: the lifetime `'x` as defined on the function body at 9:30...
|
|||
|
|
||||
LL | fn expect_bound_supply_named<'x>() {
|
||||
| ^^
|
||||
note: ...does not necessarily outlive the anonymous lifetime #2 defined on the body at 14:29
|
||||
note: ...does not necessarily outlive the anonymous lifetime #1 defined on the body at 14:29
|
||||
--> $DIR/expect-region-supply-region-2.rs:14:29
|
||||
|
|
||||
LL | closure_expecting_bound(|x: &'x u32| {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content...
|
|||
LL | x
|
||||
| ^
|
||||
|
|
||||
note: ...the reference is valid for the anonymous lifetime #2 defined on the body at 2:69...
|
||||
note: ...the reference is valid for the anonymous lifetime #1 defined on the body at 2:69...
|
||||
--> $DIR/issue-10291.rs:2:69
|
||||
|
|
||||
LL | drop::<Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ LL | gimme(|x, y| y)
|
|||
|
|
||||
= note: expected reference `&Foo<'_, '_, u32>`
|
||||
found reference `&Foo<'_, '_, u32>`
|
||||
note: the anonymous lifetime #4 defined on the body at 9:11...
|
||||
note: the anonymous lifetime #3 defined on the body at 9:11...
|
||||
--> $DIR/issue-52533-1.rs:9:11
|
||||
|
|
||||
LL | gimme(|x, y| y)
|
||||
| ^^^^^^^^
|
||||
note: ...does not necessarily outlive the anonymous lifetime #3 defined on the body at 9:11
|
||||
note: ...does not necessarily outlive the anonymous lifetime #2 defined on the body at 9:11
|
||||
--> $DIR/issue-52533-1.rs:9:11
|
||||
|
|
||||
LL | gimme(|x, y| y)
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content...
|
|||
LL | foo(|a, b| b)
|
||||
| ^
|
||||
|
|
||||
note: ...the reference is valid for the anonymous lifetime #2 defined on the body at 5:9...
|
||||
note: ...the reference is valid for the anonymous lifetime #1 defined on the body at 5:9...
|
||||
--> $DIR/issue-52533.rs:5:9
|
||||
|
|
||||
LL | foo(|a, b| b)
|
||||
| ^^^^^^^^
|
||||
note: ...but the borrowed content is only valid for the anonymous lifetime #3 defined on the body at 5:9
|
||||
note: ...but the borrowed content is only valid for the anonymous lifetime #2 defined on the body at 5:9
|
||||
--> $DIR/issue-52533.rs:5:9
|
||||
|
|
||||
LL | foo(|a, b| b)
|
||||
|
|
|
|||
6
src/test/ui/parser/fn-returns-fn-pointer.rs
Normal file
6
src/test/ui/parser/fn-returns-fn-pointer.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// check-pass
|
||||
// Regression test for #78507.
|
||||
fn foo() -> Option<fn() -> Option<bool>> {
|
||||
Some(|| Some(true))
|
||||
}
|
||||
fn main() {}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
// Verify that '>' is not both expected and found at the same time, as it used
|
||||
// to happen in #24780. For example, following should be an error:
|
||||
// expected one of ..., `>`, ... found `>`. No longer exactly this, but keeping for posterity.
|
||||
// expected one of ..., `>`, ... found `>`.
|
||||
|
||||
fn foo() -> Vec<usize>> { //~ ERROR unmatched angle bracket
|
||||
fn foo() -> Vec<usize>> { //~ ERROR expected one of `!`, `+`, `::`, `;`, `where`, or `{`, found `>`
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error: unmatched angle bracket
|
||||
error: expected one of `!`, `+`, `::`, `;`, `where`, or `{`, found `>`
|
||||
--> $DIR/issue-24780.rs:5:23
|
||||
|
|
||||
LL | fn foo() -> Vec<usize>> {
|
||||
| ^^ help: remove extra angle bracket
|
||||
| ^ expected one of `!`, `+`, `::`, `;`, `where`, or `{`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
|
|||
LL | let mut ay = &y;
|
||||
| ^^
|
||||
|
|
||||
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 7:58...
|
||||
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the body at 7:58...
|
||||
--> $DIR/regions-nested-fns.rs:7:58
|
||||
|
|
||||
LL | ignore::<Box<dyn for<'z> FnMut(&'z isize)>>(Box::new(|z| {
|
||||
|
|
@ -19,7 +19,7 @@ note: ...so that reference does not outlive borrowed content
|
|||
|
|
||||
LL | ay = z;
|
||||
| ^
|
||||
note: but, the lifetime must be valid for the anonymous lifetime #2 defined on the body at 13:72...
|
||||
note: but, the lifetime must be valid for the anonymous lifetime #1 defined on the body at 13:72...
|
||||
--> $DIR/regions-nested-fns.rs:13:72
|
||||
|
|
||||
LL | ignore::< Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
|
||||
|
|
@ -48,7 +48,7 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content...
|
|||
LL | if false { return x; }
|
||||
| ^
|
||||
|
|
||||
note: ...the reference is valid for the anonymous lifetime #2 defined on the body at 13:72...
|
||||
note: ...the reference is valid for the anonymous lifetime #1 defined on the body at 13:72...
|
||||
--> $DIR/regions-nested-fns.rs:13:72
|
||||
|
|
||||
LL | ignore::< Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
|
|||
LL | with(|o| o)
|
||||
| ^
|
||||
|
|
||||
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 10:10...
|
||||
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the body at 10:10...
|
||||
--> $DIR/regions-ret-borrowed-1.rs:10:10
|
||||
|
|
||||
LL | with(|o| o)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requiremen
|
|||
LL | with(|o| o)
|
||||
| ^
|
||||
|
|
||||
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 13:10...
|
||||
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the body at 13:10...
|
||||
--> $DIR/regions-ret-borrowed.rs:13:10
|
||||
|
|
||||
LL | with(|o| o)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// dont-check-compiler-stdout
|
||||
// dont-check-compiler-stderr
|
||||
// compile-flags: --error-format human
|
||||
|
||||
// aux-build: rustc-rust-log-aux.rs
|
||||
// rustc-env:RUSTC_LOG=debug
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content...
|
|||
LL | x.set(y);
|
||||
| ^
|
||||
|
|
||||
note: ...the reference is valid for the anonymous lifetime #3 defined on the body at 16:14...
|
||||
note: ...the reference is valid for the anonymous lifetime #2 defined on the body at 16:14...
|
||||
--> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:16:14
|
||||
|
|
||||
LL | doit(0, &|x, y| {
|
||||
|
|
@ -12,7 +12,7 @@ LL | doit(0, &|x, y| {
|
|||
LL | | x.set(y);
|
||||
LL | | });
|
||||
| |_____^
|
||||
note: ...but the borrowed content is only valid for the anonymous lifetime #4 defined on the body at 16:14
|
||||
note: ...but the borrowed content is only valid for the anonymous lifetime #3 defined on the body at 16:14
|
||||
--> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:16:14
|
||||
|
|
||||
LL | doit(0, &|x, y| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue