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#72346 - Dylan-DPC:rollup-vp418xs, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - rust-lang#71886 (Stabilize saturating_abs and saturating_neg) - rust-lang#72066 (correctly handle uninferred consts) - rust-lang#72068 (Ignore arguments when looking for `IndexMut` for subsequent `mut` obligation) - rust-lang#72338 (Fix ICE in -Zsave-analysis) - rust-lang#72344 (Assert doc wording) Failed merges: r? @ghost
- Loading branch information
Showing
13 changed files
with
154 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![feature(const_generics)] | ||
//~^ WARN the feature `const_generics` is incomplete | ||
|
||
// taken from https://github.com/rust-lang/rust/issues/70507#issuecomment-615268893 | ||
struct Foo; | ||
impl Foo { | ||
fn foo<const N: usize>(self) {} | ||
} | ||
fn main() { | ||
Foo.foo(); | ||
//~^ ERROR type annotations needed | ||
} |
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,20 @@ | ||
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/uninferred-consts.rs:1:12 | ||
| | ||
LL | #![feature(const_generics)] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(incomplete_features)]` on by default | ||
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information | ||
|
||
error[E0282]: type annotations needed | ||
--> $DIR/uninferred-consts.rs:10:5 | ||
| | ||
LL | Foo.foo(); | ||
| ^^^^^^^^^ | ||
| | ||
= note: unable to infer the value of a const parameter | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0282`. |
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,29 @@ | ||
// check-pass | ||
struct Indexable; | ||
|
||
impl Indexable { | ||
fn boo(&mut self) {} | ||
} | ||
|
||
impl std::ops::Index<&str> for Indexable { | ||
type Output = Indexable; | ||
|
||
fn index(&self, field: &str) -> &Indexable { | ||
self | ||
} | ||
} | ||
|
||
impl std::ops::IndexMut<&str> for Indexable { | ||
fn index_mut(&mut self, field: &str) -> &mut Indexable { | ||
self | ||
} | ||
} | ||
|
||
fn main() { | ||
let mut v = Indexable; | ||
let field = "hello".to_string(); | ||
|
||
v[field.as_str()].boo(); | ||
|
||
v[&field].boo(); // < This should work | ||
} |
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,7 @@ | ||
// compile-flags: -Z save-analysis | ||
|
||
fn main() { | ||
let _: Box<(dyn ?Sized)>; | ||
//~^ ERROR `?Trait` is not permitted in trait object types | ||
//~| ERROR at least one trait is required for an object type | ||
} |
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: `?Trait` is not permitted in trait object types | ||
--> $DIR/issue-72267.rs:4:21 | ||
| | ||
LL | let _: Box<(dyn ?Sized)>; | ||
| ^^^^^^ | ||
|
||
error[E0224]: at least one trait is required for an object type | ||
--> $DIR/issue-72267.rs:4:17 | ||
| | ||
LL | let _: Box<(dyn ?Sized)>; | ||
| ^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0224`. |