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#106588 - JohnTitor:rollup-4z80tjx, r=JohnTitor
Rollup of 8 pull requests Successful merges: - rust-lang#103104 (Stabilize `main_separator_str`) - rust-lang#106410 (Suggest `mut self: &mut Self` for `?Sized` impls) - rust-lang#106457 (Adjust comments about pre-push.sh hook) - rust-lang#106546 (jsondoclint: Check local items in `paths` are also in `index`.) - rust-lang#106557 (Add some UI tests and reword error-code docs) - rust-lang#106562 (Clarify examples for `VecDeque::get/get_mut`) - rust-lang#106580 (remove unreachable error code `E0313`) - rust-lang#106581 (Do not emit wrong E0308 suggestion for closure mismatch) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
22 changed files
with
268 additions
and
94 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
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,15 @@ | ||
trait Modify { | ||
fn modify(&mut self) ; | ||
} | ||
|
||
impl<T> Modify for T { | ||
fn modify(&mut self) {} | ||
} | ||
|
||
trait Foo { | ||
fn mute(&mut self) { | ||
self.modify(); //~ ERROR cannot borrow `self` as mutable | ||
} | ||
} | ||
|
||
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,12 @@ | ||
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable | ||
--> $DIR/issue-93078.rs:11:9 | ||
| | ||
LL | self.modify(); | ||
| ^^^^^^^^^^^^^ cannot borrow as mutable | ||
| | ||
= note: as `Self` may be unsized, this call attempts to take `&mut &mut self` | ||
= note: however, `&mut self` expands to `self: &mut Self`, therefore `self` cannot be borrowed mutably | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0596`. |
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,4 @@ | ||
static X: i32 = 42; | ||
const Y: i32 = X; //~ ERROR constants cannot refer to statics [E0013] | ||
|
||
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,11 @@ | ||
error[E0013]: constants cannot refer to statics | ||
--> $DIR/E0013.rs:2:16 | ||
| | ||
LL | const Y: i32 = X; | ||
| ^ | ||
| | ||
= help: consider extracting the value of the `static` to a `const`, and referring to that | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0013`. |
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 @@ | ||
fn create_some() -> Option<u8> { | ||
Some(1) | ||
} | ||
|
||
const FOO: Option<u8> = create_some(); | ||
//~^ ERROR cannot call non-const fn `create_some` in constants [E0015] | ||
|
||
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,11 @@ | ||
error[E0015]: cannot call non-const fn `create_some` in constants | ||
--> $DIR/E0015.rs:5:25 | ||
| | ||
LL | const FOO: Option<u8> = create_some(); | ||
| ^^^^^^^^^^^^^ | ||
| | ||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0015`. |
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,10 @@ | ||
struct S<'a>(&'a str); | ||
|
||
fn f(inner: fn(&str, &S)) { | ||
} | ||
|
||
#[allow(unreachable_code)] | ||
fn main() { | ||
let inner: fn(_, _) = unimplemented!(); | ||
f(inner); //~ ERROR mismatched types | ||
} |
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,19 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/closure-with-wrong-borrows.rs:9:7 | ||
| | ||
LL | f(inner); | ||
| - ^^^^^ one type is more general than the other | ||
| | | ||
| arguments to this function are incorrect | ||
| | ||
= note: expected fn pointer `for<'a, 'b, 'c> fn(&'a str, &'b S<'c>)` | ||
found fn pointer `fn(_, _)` | ||
note: function defined here | ||
--> $DIR/closure-with-wrong-borrows.rs:3:4 | ||
| | ||
LL | fn f(inner: fn(&str, &S)) { | ||
| ^ ------------------- | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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
Oops, something went wrong.