Skip to content

Commit

Permalink
Apply structured suggestion that allows test to work since 1.64
Browse files Browse the repository at this point in the history
Close #73497.
  • Loading branch information
estebank committed Oct 11, 2023
1 parent cdddcd3 commit efb822e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::path::{Path, PathBuf};

const ENTRY_LIMIT: usize = 900;
// FIXME: The following limits should be reduced eventually.
const ISSUES_ENTRY_LIMIT: usize = 1854;
const ISSUES_ENTRY_LIMIT: usize = 1855;
const ROOT_ENTRY_LIMIT: usize = 865;

const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
Expand Down
11 changes: 11 additions & 0 deletions tests/ui/issues/issue-16922.fixed
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions tests/ui/issues/issue-16922.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-rustfix
use std::any::Any;

fn foo<T: Any>(value: &T) -> Box<dyn Any> {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-16922.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: lifetime may not live long enough
--> $DIR/issue-16922.rs:4:5
--> $DIR/issue-16922.rs:5:5
|
LL | fn foo<T: Any>(value: &T) -> Box<dyn Any> {
| - let's call the lifetime of this reference `'1`
Expand Down

0 comments on commit efb822e

Please sign in to comment.