forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#114181 - matthiaskrgr:rollup-14m8s7f, r=matth…
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#114099 (privacy: no nominal visibility for assoc fns ) - rust-lang#114128 (When flushing delayed span bugs, write to the ICE dump file even if it doesn't exist) - rust-lang#114138 (Adjust spans correctly for fn -> method suggestion) - rust-lang#114146 (Skip reporting item name when checking RPITIT GAT's associated type bounds hold) - rust-lang#114147 (Insert RPITITs that were shadowed by missing ADTs that resolve to [type error]) - rust-lang#114155 (Replace a lazy `RefCell<Option<T>>` with `OnceCell<T>`) - rust-lang#114164 (Add regression test for `--cap-lints allow` and trait bounds warning) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
23 changed files
with
413 additions
and
23 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
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
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
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
11 changes: 11 additions & 0 deletions
11
tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// issue: 114146 | ||
|
||
#![feature(return_position_impl_trait_in_trait)] | ||
|
||
trait Foo { | ||
fn bar<'other: 'a>() -> impl Sized + 'a {} | ||
//~^ ERROR use of undeclared lifetime name `'a` | ||
//~| ERROR use of undeclared lifetime name `'a` | ||
} | ||
|
||
fn main() {} |
33 changes: 33 additions & 0 deletions
33
tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.stderr
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
error[E0261]: use of undeclared lifetime name `'a` | ||
--> $DIR/bad-item-bound-within-rpitit-2.rs:6:20 | ||
| | ||
LL | fn bar<'other: 'a>() -> impl Sized + 'a {} | ||
| ^^ undeclared lifetime | ||
| | ||
help: consider introducing lifetime `'a` here | ||
| | ||
LL | fn bar<'a, 'other: 'a>() -> impl Sized + 'a {} | ||
| +++ | ||
help: consider introducing lifetime `'a` here | ||
| | ||
LL | trait Foo<'a> { | ||
| ++++ | ||
|
||
error[E0261]: use of undeclared lifetime name `'a` | ||
--> $DIR/bad-item-bound-within-rpitit-2.rs:6:42 | ||
| | ||
LL | fn bar<'other: 'a>() -> impl Sized + 'a {} | ||
| ^^ undeclared lifetime | ||
| | ||
help: consider introducing lifetime `'a` here | ||
| | ||
LL | fn bar<'a, 'other: 'a>() -> impl Sized + 'a {} | ||
| +++ | ||
help: consider introducing lifetime `'a` here | ||
| | ||
LL | trait Foo<'a> { | ||
| ++++ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0261`. |
25 changes: 25 additions & 0 deletions
25
tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// issue: 114145 | ||
|
||
#![feature(return_position_impl_trait_in_trait)] | ||
|
||
trait Iterable { | ||
type Item<'a> | ||
where | ||
Self: 'a; | ||
|
||
fn iter(&self) -> impl '_ + Iterator<Item = Self::Item<'_>>; | ||
} | ||
|
||
impl<'a, I: 'a + Iterable> Iterable for &'a I { | ||
type Item<'b> = I::Item<'a> | ||
where | ||
'b: 'a; | ||
//~^ ERROR impl has stricter requirements than trait | ||
|
||
fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> { | ||
//~^ ERROR the type `&'a I` does not fulfill the required lifetime | ||
(*self).iter() | ||
} | ||
} | ||
|
||
fn main() {} |
30 changes: 30 additions & 0 deletions
30
tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
error[E0276]: impl has stricter requirements than trait | ||
--> $DIR/bad-item-bound-within-rpitit.rs:16:13 | ||
| | ||
LL | type Item<'a> | ||
| ------------- definition of `Item` from trait | ||
... | ||
LL | 'b: 'a; | ||
| ^^ impl has extra requirement `'b: 'a` | ||
| | ||
help: copy the `where` clause predicates from the trait | ||
| | ||
LL | where Self: 'b; | ||
| ~~~~~~~~~~~~~~ | ||
|
||
error[E0477]: the type `&'a I` does not fulfill the required lifetime | ||
--> $DIR/bad-item-bound-within-rpitit.rs:19:23 | ||
| | ||
LL | fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: type must outlive the anonymous lifetime as defined here | ||
--> $DIR/bad-item-bound-within-rpitit.rs:10:28 | ||
| | ||
LL | fn iter(&self) -> impl '_ + Iterator<Item = Self::Item<'_>>; | ||
| ^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0276, E0477. | ||
For more information about an error, try `rustc --explain E0276`. |
18 changes: 18 additions & 0 deletions
18
tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// issue: 113903 | ||
|
||
#![feature(return_position_impl_trait_in_trait)] | ||
|
||
use std::ops::Deref; | ||
|
||
pub trait Tr { | ||
fn w() -> impl Deref<Target = Missing<impl Sized>>; | ||
//~^ ERROR cannot find type `Missing` in this scope | ||
} | ||
|
||
impl Tr for () { | ||
fn w() -> &'static () { | ||
&() | ||
} | ||
} | ||
|
||
fn main() {} |
9 changes: 9 additions & 0 deletions
9
tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.stderr
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0412]: cannot find type `Missing` in this scope | ||
--> $DIR/rpitit-shadowed-by-missing-adt.rs:8:35 | ||
| | ||
LL | fn w() -> impl Deref<Target = Missing<impl Sized>>; | ||
| ^^^^^^^ not found in this scope | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Regression test for https://github.com/rust-lang/rust/issues/43134 | ||
|
||
// check-pass | ||
// compile-flags: --cap-lints allow | ||
|
||
type Foo<T: Clone> = Option<T>; | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// issue: 114131 | ||
|
||
fn main() { | ||
let hello = len(vec![]); | ||
//~^ ERROR cannot find function `len` in this scope | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/ui/methods/suggest-method-on-call-with-macro-rcvr.stderr
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0425]: cannot find function `len` in this scope | ||
--> $DIR/suggest-method-on-call-with-macro-rcvr.rs:4:17 | ||
| | ||
LL | let hello = len(vec![]); | ||
| ^^^ not found in this scope | ||
| | ||
help: use the `.` operator to call the method `len` on `&Vec<_>` | ||
| | ||
LL - let hello = len(vec![]); | ||
LL + let hello = vec![].len(); | ||
| | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0425`. |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#![feature(staged_api)] | ||
//~^ ERROR module has missing stability attribute | ||
|
||
pub trait Trait { | ||
//~^ ERROR trait has missing stability attribute | ||
fn fun() {} | ||
//~^ ERROR associated function has missing stability attribute | ||
} | ||
|
||
impl Trait for u8 { | ||
//~^ ERROR implementation has missing stability attribute | ||
pub(self) fn fun() {} | ||
//~^ ERROR visibility qualifiers are not permitted here [E0449] | ||
} | ||
|
||
fn main() {} |
Oops, something went wrong.