-
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.
Auto merge of #105579 - matthiaskrgr:rollup-vw5dlqc, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #101648 (Better documentation for env::home_dir()'s broken behaviour) - #105283 (Don't call `diagnostic_hir_wf_check` query if we have infer variables) - #105369 (Detect spurious ; before assoc fn body) - #105472 (Make encode_info_for_trait_item use queries instead of accessing the HIR) - #105521 (separate heading from body) - #105555 (llvm-wrapper: adapt for LLVM API changes) - #105560 (Extend rustdoc hashtag prepended line test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
12 changed files
with
150 additions
and
18 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
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,22 @@ | ||
use std::fmt; | ||
|
||
struct S { | ||
} | ||
|
||
impl S { | ||
fn hello<P>(&self, val: &P) where P: fmt::Display; { | ||
//~^ ERROR non-item in item list | ||
//~| ERROR associated function in `impl` without body | ||
println!("val: {}", val); | ||
} | ||
} | ||
|
||
impl S { | ||
fn hello_empty<P>(&self, val: &P) where P: fmt::Display; | ||
//~^ ERROR associated function in `impl` without body | ||
} | ||
|
||
fn main() { | ||
let s = S{}; | ||
s.hello(&32); | ||
} |
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,31 @@ | ||
error: non-item in item list | ||
--> $DIR/issue-105226.rs:7:56 | ||
| | ||
LL | impl S { | ||
| - item list starts here | ||
LL | fn hello<P>(&self, val: &P) where P: fmt::Display; { | ||
| - ^ non-item starts here | ||
| | | ||
| help: consider removing this semicolon | ||
... | ||
LL | } | ||
| - item list ends here | ||
|
||
error: associated function in `impl` without body | ||
--> $DIR/issue-105226.rs:7:5 | ||
| | ||
LL | fn hello<P>(&self, val: &P) where P: fmt::Display; { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- | ||
| | | ||
| help: provide a definition for the function: `{ <body> }` | ||
|
||
error: associated function in `impl` without body | ||
--> $DIR/issue-105226.rs:15:5 | ||
| | ||
LL | fn hello_empty<P>(&self, val: &P) where P: fmt::Display; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- | ||
| | | ||
| help: provide a definition for the function: `{ <body> }` | ||
|
||
error: aborting due to 3 previous errors | ||
|
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 @@ | ||
// incremental | ||
|
||
trait Foo { | ||
type V; | ||
} | ||
|
||
trait Callback<T: Foo>: Fn(&Bar<'_, T>, &T::V) {} | ||
|
||
struct Bar<'a, T> { | ||
callback: Box<dyn Callback<dyn Callback<Bar<'a, T>>>>, | ||
//~^ ERROR the trait bound `Bar<'a, T>: Foo` is not satisfied | ||
//~| ERROR the trait bound `(dyn Callback<Bar<'a, T>, for<'b, 'c, 'd> Output = ()> + 'static): Foo` is not satisfied | ||
//~| ERROR the size for values of type `(dyn Callback<Bar<'a, T>, for<'b, 'c, 'd> Output = ()> + 'static)` cannot be known at compilation time | ||
} | ||
|
||
impl<T: Foo> Bar<'_, Bar<'_, 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,32 @@ | ||
error[E0277]: the trait bound `Bar<'a, T>: Foo` is not satisfied | ||
--> $DIR/hir-wf-canonicalized.rs:10:15 | ||
| | ||
LL | callback: Box<dyn Callback<dyn Callback<Bar<'a, T>>>>, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `Bar<'a, T>` | ||
|
||
error[E0277]: the trait bound `(dyn Callback<Bar<'a, T>, for<'b, 'c, 'd> Output = ()> + 'static): Foo` is not satisfied | ||
--> $DIR/hir-wf-canonicalized.rs:10:15 | ||
| | ||
LL | callback: Box<dyn Callback<dyn Callback<Bar<'a, T>>>>, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(dyn Callback<Bar<'a, T>, for<'b, 'c, 'd> Output = ()> + 'static)` | ||
|
||
error[E0277]: the size for values of type `(dyn Callback<Bar<'a, T>, for<'b, 'c, 'd> Output = ()> + 'static)` cannot be known at compilation time | ||
--> $DIR/hir-wf-canonicalized.rs:10:15 | ||
| | ||
LL | callback: Box<dyn Callback<dyn Callback<Bar<'a, T>>>>, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | ||
| | ||
= help: the trait `Sized` is not implemented for `(dyn Callback<Bar<'a, T>, for<'b, 'c, 'd> Output = ()> + 'static)` | ||
note: required by a bound in `Bar` | ||
--> $DIR/hir-wf-canonicalized.rs:9:16 | ||
| | ||
LL | struct Bar<'a, T> { | ||
| ^ required by this bound in `Bar` | ||
help: consider relaxing the implicit `Sized` restriction | ||
| | ||
LL | struct Bar<'a, T: ?Sized> { | ||
| ++++++++ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |