-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #78342 - oliviacrain:checkmate-pass, r=Mark-Simulacrum
Use check-pass in single-use-lifetime ui tests Rationale: the `single_use_lifetimes` lint is used during late name resolution, which is within the scope of `check-pass` and does not require codegen or linking. Helps remove some FIXMES associated with #62277. Additionally tidies touched test files.
- Loading branch information
Showing
6 changed files
with
25 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
src/test/ui/single-use-lifetime/two-uses-in-fn-argument-and-return.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
// Test that we DO NOT warn when lifetime name is used in | ||
// both the argument and return. | ||
// | ||
// build-pass (FIXME(62277): could be check-pass?) | ||
// check-pass | ||
|
||
#![deny(single_use_lifetimes)] | ||
#![allow(dead_code)] | ||
#![allow(unused_variables)] | ||
|
||
fn c<'a>(x: &'a u32) -> &'a u32 { // OK: used twice | ||
// OK: used twice | ||
fn c<'a>(x: &'a u32) -> &'a u32 { | ||
&22 | ||
} | ||
|
||
fn main() { } | ||
fn main() {} |
12 changes: 6 additions & 6 deletions
12
src/test/ui/single-use-lifetime/two-uses-in-fn-arguments.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
// Test that we DO NOT warn when lifetime name is used multiple | ||
// arguments, or more than once in a single argument. | ||
// | ||
// build-pass (FIXME(62277): could be check-pass?) | ||
// check-pass | ||
|
||
#![deny(single_use_lifetimes)] | ||
#![allow(dead_code)] | ||
#![allow(unused_variables)] | ||
|
||
fn c<'a>(x: &'a u32, y: &'a u32) { // OK: used twice | ||
} | ||
// OK: used twice | ||
fn c<'a>(x: &'a u32, y: &'a u32) {} | ||
|
||
fn d<'a>(x: (&'a u32, &'a u32)) { // OK: used twice | ||
} | ||
// OK: used twice | ||
fn d<'a>(x: (&'a u32, &'a u32)) {} | ||
|
||
fn main() { } | ||
fn main() {} |
9 changes: 4 additions & 5 deletions
9
src/test/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
// Test that we DO NOT warn for a lifetime used twice in an impl. | ||
// | ||
// build-pass (FIXME(62277): could be check-pass?) | ||
// check-pass | ||
|
||
#![deny(single_use_lifetimes)] | ||
#![allow(dead_code)] | ||
#![allow(unused_variables)] | ||
|
||
struct Foo<'f> { | ||
data: &'f u32 | ||
data: &'f u32, | ||
} | ||
|
||
impl<'f> Foo<'f> { | ||
fn inherent_a(&self, data: &'f u32) { | ||
} | ||
fn inherent_a(&self, data: &'f u32) {} | ||
} | ||
|
||
fn main() { } | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters