mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-29 11:51:31 +03:00
Apply structured suggestion that allows test to work since 1.64
Close #73497.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
const ENTRY_LIMIT: usize = 900;
|
||||
// FIXME: The following limits should be reduced eventually.
|
||||
const ISSUES_ENTRY_LIMIT: usize = 1854;
|
||||
const ISSUES_ENTRY_LIMIT: usize = 1852;
|
||||
const ROOT_ENTRY_LIMIT: usize = 867;
|
||||
|
||||
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// run-rustfix
|
||||
use std::any::Any;
|
||||
|
||||
fn foo<T: Any>(value: &T) -> Box<dyn Any + '_> {
|
||||
Box::new(value) as Box<dyn Any>
|
||||
//~^ ERROR lifetime may not live long enough
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _ = foo(&5);
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// run-rustfix
|
||||
use std::any::Any;
|
||||
|
||||
fn foo<T: Any>(value: &T) -> Box<dyn Any> {
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/issue-16922.rs:4:5
|
||||
--> $DIR/suggest-using-tick-underscore-lifetime-in-return-trait-object.rs:5:5
|
||||
|
|
||||
LL | fn foo<T: Any>(value: &T) -> Box<dyn Any> {
|
||||
| - let's call the lifetime of this reference `'1`
|
||||
Reference in New Issue
Block a user