Skip to content

Rollup of 7 pull requests #68423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Jan 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9e90840
Simplify NodeHeader by avoiding slices in BTreeMaps with shared roots
ssomers Dec 26, 2019
34878d7
Options IP_MULTICAST_TTL and IP_MULTICAST_LOOP are 1 byte on BSD and …
Jan 17, 2020
dda32e4
refactor fix using cfg_if!
Jan 17, 2020
239a7d9
refactor fix using cfg_if! (fix build)
Jan 17, 2020
766f6c5
Actually pass target LLVM args to LLVM
Jan 18, 2020
01cbe50
Add `constness` field to `ast::ItemKind::Impl`
ecstatic-morse Jan 14, 2020
a790f9b
Add `constness` field to `hir::ItemKind::Impl`
ecstatic-morse Jan 14, 2020
958b0bc
Store `impl const` in `ItemKind::Impl`
ecstatic-morse Jan 14, 2020
eb60346
Add `MaybeConst` variant to `{ast,hir}::TraitBoundModifier`
ecstatic-morse Jan 14, 2020
1a3bd57
Revert "Add a `constness` field to `ast::TraitRef`"
ecstatic-morse Jan 14, 2020
ab3081a
Add `constness` field to `ty::Predicate::Trait`
ecstatic-morse Jan 14, 2020
d2aefbb
Add `ConstnessAnd` that implements `ToPredicate`
ecstatic-morse Jan 14, 2020
adbd01e
Track constness while lowering bounds
ecstatic-morse Jan 14, 2020
3b1a9d3
Ignore filelength for `astconv`
ecstatic-morse Jan 14, 2020
0ac4ba0
Parse `?const ?Trait`
ecstatic-morse Jan 20, 2020
23ea42c
Update tests
ecstatic-morse Jan 14, 2020
71450c7
generalize bindings_with_variant_name lint
Centril Jan 20, 2020
5392442
refactor fix using cfg_if! (fix build on Solaris)
Jan 20, 2020
78f0c7f
check_match: unify some lowering code and fix some ICEs
Centril Jan 20, 2020
58eb03d
check_match: simplify check_arm
Centril Jan 20, 2020
1b800a5
trade in outdated comments for correct ones
ssomers Jan 21, 2020
6bd69a1
Add comment explaining `MaybeConstMaybe` lowering
ecstatic-morse Jan 21, 2020
14c002e
tidy: fix most clippy warnings
matthiaskrgr Jan 21, 2020
3e947ef
Declare unsafe functions that can no longer handle shared roots
ssomers Jan 21, 2020
32a81f7
lowering: cleanup some hofs
Centril Jan 21, 2020
d532a04
Rollup merge of #67686 - ssomers:keys_start_slasher, r=Mark-Simulacrum
Centril Jan 21, 2020
3484e2f
Rollup merge of #68140 - ecstatic-morse:const-trait-bound-opt-out, r=…
Centril Jan 21, 2020
dabd816
Rollup merge of #68313 - batrla:master, r=alexcrichton
Centril Jan 21, 2020
3fa8cc3
Rollup merge of #68328 - jethrogb:jb/target-llvm-args, r=alexcrichton
Centril Jan 21, 2020
5850482
Rollup merge of #68399 - Centril:check-match-unify, r=oli-obk
Centril Jan 21, 2020
b6d6391
Rollup merge of #68415 - matthiaskrgr:tidy_clippy, r=oli-obk
Centril Jan 21, 2020
c1b20b1
Rollup merge of #68416 - Centril:lowering-cleanup-hofs, r=pietroalbini
Centril Jan 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update tests
  • Loading branch information
ecstatic-morse committed Jan 20, 2020
commit 23ea42cfd14e185f3af2232083318fdca90a4b6c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: `?const` on trait bounds is not yet implemented
--> $DIR/feature-gate.rs:11:29
error: fatal error triggered by #[rustc_error]
--> $DIR/feature-gate.rs:16:1
|
LL | const fn get_assoc_const<S: ?const T>() -> i32 { <S as T>::CONST }
| ^^^^^^^^
LL | fn main() {}
| ^^^^^^^^^^^^

error: aborting due to previous error

Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@

#![cfg_attr(gated, feature(const_trait_bound_opt_out))]
#![allow(incomplete_features)]
#![feature(rustc_attrs)]

trait T {
const CONST: i32;
}

const fn get_assoc_const<S: ?const T>() -> i32 { <S as T>::CONST }
//[stock]~^ ERROR `?const` on trait bounds is experimental
//[stock,gated]~^^ ERROR `?const` on trait bounds is not yet implemented

fn main() {}
#[rustc_error]
fn main() {} //[gated]~ ERROR fatal error triggered by #[rustc_error]
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
error[E0658]: `?const` on trait bounds is experimental
--> $DIR/feature-gate.rs:11:29
--> $DIR/feature-gate.rs:12:29
|
LL | const fn get_assoc_const<S: ?const T>() -> i32 { <S as T>::CONST }
| ^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/67794
= help: add `#![feature(const_trait_bound_opt_out)]` to the crate attributes to enable

error: `?const` on trait bounds is not yet implemented
--> $DIR/feature-gate.rs:11:29
|
LL | const fn get_assoc_const<S: ?const T>() -> i32 { <S as T>::CONST }
| ^^^^^^^^

error: aborting due to 2 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ impl T for S {}

fn rpit() -> impl ?const T { S }
//~^ ERROR `?const` is not permitted in `impl Trait`
//~| ERROR `?const` on trait bounds is not yet implemented

fn apit(_: impl ?const T) {}
//~^ ERROR `?const` is not permitted in `impl Trait`
//~| ERROR `?const` on trait bounds is not yet implemented

fn rpit_assoc_bound() -> impl IntoIterator<Item: ?const T> { Some(S) }
//~^ ERROR `?const` is not permitted in `impl Trait`
//~| ERROR `?const` on trait bounds is not yet implemented

fn apit_assoc_bound(_: impl IntoIterator<Item: ?const T>) {}
//~^ ERROR `?const` is not permitted in `impl Trait`
//~| ERROR `?const` on trait bounds is not yet implemented

fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,22 @@ LL | fn rpit() -> impl ?const T { S }
| ^^^^^^^^

error: `?const` is not permitted in `impl Trait`
--> $DIR/in-impl-trait.rs:13:17
--> $DIR/in-impl-trait.rs:12:17
|
LL | fn apit(_: impl ?const T) {}
| ^^^^^^^^

error: `?const` is not permitted in `impl Trait`
--> $DIR/in-impl-trait.rs:17:50
--> $DIR/in-impl-trait.rs:15:50
|
LL | fn rpit_assoc_bound() -> impl IntoIterator<Item: ?const T> { Some(S) }
| ^^^^^^^^

error: `?const` is not permitted in `impl Trait`
--> $DIR/in-impl-trait.rs:21:48
--> $DIR/in-impl-trait.rs:18:48
|
LL | fn apit_assoc_bound(_: impl IntoIterator<Item: ?const T>) {}
| ^^^^^^^^

error: `?const` on trait bounds is not yet implemented
--> $DIR/in-impl-trait.rs:9:19
|
LL | fn rpit() -> impl ?const T { S }
| ^^^^^^^^

error: `?const` on trait bounds is not yet implemented
--> $DIR/in-impl-trait.rs:13:17
|
LL | fn apit(_: impl ?const T) {}
| ^^^^^^^^

error: `?const` on trait bounds is not yet implemented
--> $DIR/in-impl-trait.rs:17:50
|
LL | fn rpit_assoc_bound() -> impl IntoIterator<Item: ?const T> { Some(S) }
| ^^^^^^^^

error: `?const` on trait bounds is not yet implemented
--> $DIR/in-impl-trait.rs:21:48
|
LL | fn apit_assoc_bound(_: impl IntoIterator<Item: ?const T>) {}
| ^^^^^^^^

error: aborting due to 8 previous errors
error: aborting due to 4 previous errors

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
trait Super {}
trait T: ?const Super {}
//~^ ERROR `?const` is not permitted in supertraits
//~| ERROR `?const` on trait bounds is not yet implemented

fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,5 @@ error: `?const` is not permitted in supertraits
LL | trait T: ?const Super {}
| ^^^^^^^^^^^^

error: `?const` on trait bounds is not yet implemented
--> $DIR/in-trait-bounds.rs:5:10
|
LL | trait T: ?const Super {}
| ^^^^^^^^^^^^

error: aborting due to 2 previous errors
error: aborting due to previous error

Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ impl T for S {}
// An inherent impl for the trait object `?const T`.
impl ?const T {}
//~^ ERROR `?const` is not permitted in trait objects
//~| ERROR `?const` on trait bounds is not yet implemented

fn trait_object() -> &'static dyn ?const T { &S }
//~^ ERROR `?const` is not permitted in trait objects
//~| ERROR `?const` on trait bounds is not yet implemented

fn trait_object_in_apit(_: impl IntoIterator<Item = Box<dyn ?const T>>) {}
//~^ ERROR `?const` is not permitted in trait objects
//~| ERROR `?const` on trait bounds is not yet implemented

fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,16 @@ LL | impl ?const T {}
| ^^^^^^^^

error: `?const` is not permitted in trait objects
--> $DIR/in-trait-object.rs:14:35
--> $DIR/in-trait-object.rs:13:35
|
LL | fn trait_object() -> &'static dyn ?const T { &S }
| ^^^^^^^^

error: `?const` is not permitted in trait objects
--> $DIR/in-trait-object.rs:18:61
--> $DIR/in-trait-object.rs:16:61
|
LL | fn trait_object_in_apit(_: impl IntoIterator<Item = Box<dyn ?const T>>) {}
| ^^^^^^^^

error: `?const` on trait bounds is not yet implemented
--> $DIR/in-trait-object.rs:10:6
|
LL | impl ?const T {}
| ^^^^^^^^

error: `?const` on trait bounds is not yet implemented
--> $DIR/in-trait-object.rs:14:35
|
LL | fn trait_object() -> &'static dyn ?const T { &S }
| ^^^^^^^^

error: `?const` on trait bounds is not yet implemented
--> $DIR/in-trait-object.rs:18:61
|
LL | fn trait_object_in_apit(_: impl IntoIterator<Item = Box<dyn ?const T>>) {}
| ^^^^^^^^

error: aborting due to 6 previous errors
error: aborting due to 3 previous errors

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@

struct S<T: ?const ?Sized>(std::marker::PhantomData<T>);
//~^ ERROR `?const` and `?` are mutually exclusive
//~| ERROR `?const` on trait bounds is not yet implemented

fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,5 @@ error: `?const` and `?` are mutually exclusive
LL | struct S<T: ?const ?Sized>(std::marker::PhantomData<T>);
| ^^^^^^^^^^^^^

error: `?const` on trait bounds is not yet implemented
--> $DIR/with-maybe-sized.rs:4:13
|
LL | struct S<T: ?const ?Sized>(std::marker::PhantomData<T>);
| ^^^^^^^^^^^^^

error: aborting due to 2 previous errors
error: aborting due to previous error

9 changes: 6 additions & 3 deletions src/test/ui/rfc-2632-const-trait-impl/inherent-impl.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// compile-flags: -Z parse-only

#![feature(const_trait_impl)]
#![feature(const_trait_bound_opt_out)]
#![allow(incomplete_features)]
Expand All @@ -8,7 +6,12 @@
struct S;
trait T {}

impl const S {}
//~^ ERROR inherent impls cannot be `const`
//~| ERROR const trait impls are not yet implemented

impl const T {}
//~^ ERROR `const` cannot modify an inherent impl
//~^ ERROR inherent impls cannot be `const`
//~| ERROR const trait impls are not yet implemented

fn main() {}
30 changes: 25 additions & 5 deletions src/test/ui/rfc-2632-const-trait-impl/inherent-impl.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
error: `const` cannot modify an inherent impl
--> $DIR/inherent-impl.rs:11:6
error: inherent impls cannot be `const`
--> $DIR/inherent-impl.rs:9:1
|
LL | impl const S {}
| ^^^^^^^^^^^^^^^
|
= note: only trait implementations may be annotated with `const`

error: inherent impls cannot be `const`
--> $DIR/inherent-impl.rs:13:1
|
LL | impl const T {}
| ^^^^^
| ^^^^^^^^^^^^^^^
|
= note: only trait implementations may be annotated with `const`

error: const trait impls are not yet implemented
--> $DIR/inherent-impl.rs:9:1
|
LL | impl const S {}
| ^^^^^^^^^^^^^^^

error: const trait impls are not yet implemented
--> $DIR/inherent-impl.rs:13:1
|
= help: only a trait impl can be `const`
LL | impl const T {}
| ^^^^^^^^^^^^^^^

error: aborting due to previous error
error: aborting due to 4 previous errors