Merge branch 'master' into issue-69276

This commit is contained in:
csmoe 2020-05-18 08:46:24 +08:00
commit 2f311b07c8
589 changed files with 7983 additions and 3099 deletions

View file

@ -1,5 +1,5 @@
#![feature(impl_trait_in_bindings)]
//~^ WARN the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
//~^ WARN the feature `impl_trait_in_bindings` is incomplete
const FOO: impl Copy = 42;

View file

@ -1,10 +1,11 @@
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/bindings-opaque.rs:1:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
error[E0599]: no method named `count_ones` found for opaque type `impl std::marker::Copy` in the current scope
--> $DIR/bindings-opaque.rs:11:17

View file

@ -1,5 +1,5 @@
#![feature(impl_trait_in_bindings)]
//~^ WARN the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
//~^ WARN the feature `impl_trait_in_bindings` is incomplete
fn a<T: Clone>(x: T) {
const foo: impl Clone = x;

View file

@ -22,13 +22,14 @@ error[E0435]: attempt to use a non-constant value in a constant
LL | const foo: impl Clone = x;
| ^ non-constant value
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/bindings.rs:1:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
error: aborting due to 4 previous errors; 1 warning emitted

View file

@ -1,10 +1,11 @@
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/bound-normalization-fail.rs:4:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as impl_trait::Trait>::Assoc`
--> $DIR/bound-normalization-fail.rs:27:32

View file

@ -1,10 +1,11 @@
warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/bound-normalization-pass.rs:5:12
|
LL | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
warning: 1 warning emitted

View file

@ -2,6 +2,7 @@
#![feature(fn_traits,
step_trait,
step_trait_ext,
unboxed_closures,
)]
@ -10,7 +11,6 @@
//! Originally converted to Rust by [Daniel Keep](https://github.com/DanielKeep).
use std::fmt::Write;
use std::mem;
/// Date representation.
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
@ -156,32 +156,16 @@ impl<'a, 'b> std::ops::Add<&'b NaiveDate> for &'a NaiveDate {
}
}
impl std::iter::Step for NaiveDate {
unsafe impl std::iter::Step for NaiveDate {
fn steps_between(_: &Self, _: &Self) -> Option<usize> {
unimplemented!()
}
fn replace_one(&mut self) -> Self {
mem::replace(self, NaiveDate(0, 0, 1))
fn forward_checked(start: Self, n: usize) -> Option<Self> {
Some((0..n).fold(start, |x, _| x.succ()))
}
fn replace_zero(&mut self) -> Self {
mem::replace(self, NaiveDate(0, 0, 0))
}
fn add_one(&self) -> Self {
self.succ()
}
fn sub_one(&self) -> Self {
unimplemented!()
}
fn add_usize(&self, _: usize) -> Option<Self> {
unimplemented!()
}
fn sub_usize(&self, _: usize) -> Option<Self> {
fn backward_checked(_: Self, _: usize) -> Option<Self> {
unimplemented!()
}
}