Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/69415.sh: fixed with errors #366

Merged
merged 1 commit into from
May 17, 2020
Merged

ices/69415.sh: fixed with errors #366

merged 1 commit into from
May 17, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#69415

#!/bin/bash

cat > 69415.rs <<EOF

#![feature(untagged_unions)]

trait Tr1 { type As1: Copy; }
trait Tr2 { type As2: Copy; }

struct S1;
#[derive(Copy, Clone)]
struct S2;
impl Tr1 for S1 { type As1 = S2; }

trait _Tr3 {
    type A: Iterator<Item: Copy>;
    //~^ ERROR associated type bounds are unstable

    type B: Iterator<Item: 'static>;
    //~^ ERROR associated type bounds are unstable
}

struct _St1<T: Tr1<As1: Tr2>> {
//~^ ERROR associated type bounds are unstable
    outest: T,
    outer: T::As1,
    inner: <T::As1 as Tr2>::As2,
}

enum _En1<T: Tr1<As1: Tr2>> {
//~^ ERROR associated type bounds are unstable
    Outest(T),
    Outer(T::As1),
    Inner(<T::As1 as Tr2>::As2),
}

union _Un1<T: Tr1<As1: Tr2>> {
//~^ ERROR associated type bounds are unstable
    outest: std::mem::ManuallyDrop<T>,
    outer: T::As1,
    inner: <T::As1 as Tr2>::As2,
}

type _TaWhere1<T> where T: Iterator<Item: Copy> = T;
//~^ ERROR associated type bounds are unstable

fn _apit(_: impl Tr1<As1: Copy>) {}
//~^ ERROR associated type bounds are unstable
fn _apit_dyn(_: &dyn Tr1<As1: Copy>) {}
//~^ ERROR associated type bounds are unstable

fn _rpit() -> impl Tr1<As1: Copy> { S1 }
//~^ ERROR associated type bounds are unstable

fn _rpit_dyn() -> Box<dyn Tr1<As1: Copy>> { Box::new(S1) }
//~^ ERROR associated type bounds are unstable

const _cdef: impl Tr1<As1: Copy> = S1;
//~^ ERROR associated type bounds are unstable
//~| ERROR impl Trait not allowed outside of function and inherent method return types [E0562]
// FIXME: uncomment when impl_trait_in_bindings feature is fixed.
// const _cdef_dyn: &dyn Tr1<As1: Copy> = &S1;

static _sdef: impl Tr1<As1: Copy> = S1;
//~^ ERROR associated type bounds are unstable
//~| ERROR impl Trait not allowed outside of function and inherent method return types [E0562]
// FIXME: uncomment when impl_trait_in_bindings feature is fixed.
// static _sdef_dyn: &dyn Tr1<As1: Copy> = &S1;

fn main() {
    let _: impl Tr1<As1: Copy> = S1;
    //~^ ERROR associated type bounds are unstable
    //~| ERROR impl Trait not allowed outside of function and inherent method return types [E0562]
    // FIXME: uncomment when impl_trait_in_bindings feature is fixed.
    // let _: &dyn Tr1<As1: Copy> = &S1;
}

EOF

rustc -Z save-analysis 69415.rs
=== stdout ===
=== stderr ===
error[E0658]: associated type bounds are unstable
  --> 69415.rs:13:22
   |
13 |     type A: Iterator<Item: Copy>;
   |                      ^^^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:16:22
   |
16 |     type B: Iterator<Item: 'static>;
   |                      ^^^^^^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:20:20
   |
20 | struct _St1<T: Tr1<As1: Tr2>> {
   |                    ^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:27:18
   |
27 | enum _En1<T: Tr1<As1: Tr2>> {
   |                  ^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:34:19
   |
34 | union _Un1<T: Tr1<As1: Tr2>> {
   |                   ^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:41:37
   |
41 | type _TaWhere1<T> where T: Iterator<Item: Copy> = T;
   |                                     ^^^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:44:22
   |
44 | fn _apit(_: impl Tr1<As1: Copy>) {}
   |                      ^^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:46:26
   |
46 | fn _apit_dyn(_: &dyn Tr1<As1: Copy>) {}
   |                          ^^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:49:24
   |
49 | fn _rpit() -> impl Tr1<As1: Copy> { S1 }
   |                        ^^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:52:31
   |
52 | fn _rpit_dyn() -> Box<dyn Tr1<As1: Copy>> { Box::new(S1) }
   |                               ^^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:55:23
   |
55 | const _cdef: impl Tr1<As1: Copy> = S1;
   |                       ^^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:61:24
   |
61 | static _sdef: impl Tr1<As1: Copy> = S1;
   |                        ^^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:68:21
   |
68 |     let _: impl Tr1<As1: Copy> = S1;
   |                     ^^^^^^^^^
   |
   = note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
  --> 69415.rs:55:14
   |
55 | const _cdef: impl Tr1<As1: Copy> = S1;
   |              ^^^^^^^^^^^^^^^^^^^
   |
   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable

error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
  --> 69415.rs:61:15
   |
61 | static _sdef: impl Tr1<As1: Copy> = S1;
   |               ^^^^^^^^^^^^^^^^^^^
   |
   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable

error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
  --> 69415.rs:68:12
   |
68 |     let _: impl Tr1<As1: Copy> = S1;
   |            ^^^^^^^^^^^^^^^^^^^
   |
   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable

error: aborting due to 16 previous errors

Some errors have detailed explanations: E0562, E0658.
For more information about an error, try `rustc --explain E0562`.
==============

=== stdout ===
=== stderr ===
error[E0658]: associated type bounds are unstable
  --> 69415.rs:13:22
   |
13 |     type A: Iterator<Item: Copy>;
   |                      ^^^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:16:22
   |
16 |     type B: Iterator<Item: 'static>;
   |                      ^^^^^^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:20:20
   |
20 | struct _St1<T: Tr1<As1: Tr2>> {
   |                    ^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:27:18
   |
27 | enum _En1<T: Tr1<As1: Tr2>> {
   |                  ^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:34:19
   |
34 | union _Un1<T: Tr1<As1: Tr2>> {
   |                   ^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:41:37
   |
41 | type _TaWhere1<T> where T: Iterator<Item: Copy> = T;
   |                                     ^^^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:44:22
   |
44 | fn _apit(_: impl Tr1<As1: Copy>) {}
   |                      ^^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:46:26
   |
46 | fn _apit_dyn(_: &dyn Tr1<As1: Copy>) {}
   |                          ^^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:49:24
   |
49 | fn _rpit() -> impl Tr1<As1: Copy> { S1 }
   |                        ^^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:52:31
   |
52 | fn _rpit_dyn() -> Box<dyn Tr1<As1: Copy>> { Box::new(S1) }
   |                               ^^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:55:23
   |
55 | const _cdef: impl Tr1<As1: Copy> = S1;
   |                       ^^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:61:24
   |
61 | static _sdef: impl Tr1<As1: Copy> = S1;
   |                        ^^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0658]: associated type bounds are unstable
  --> 69415.rs:68:21
   |
68 |     let _: impl Tr1<As1: Copy> = S1;
   |                     ^^^^^^^^^
   |
   = note: see issue #52662 <rust-lang/rust#52662> for more information
   = help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable

error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
  --> 69415.rs:55:14
   |
55 | const _cdef: impl Tr1<As1: Copy> = S1;
   |              ^^^^^^^^^^^^^^^^^^^
   |
   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable

error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
  --> 69415.rs:61:15
   |
61 | static _sdef: impl Tr1<As1: Copy> = S1;
   |               ^^^^^^^^^^^^^^^^^^^
   |
   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable

error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
  --> 69415.rs:68:12
   |
68 |     let _: impl Tr1<As1: Copy> = S1;
   |            ^^^^^^^^^^^^^^^^^^^
   |
   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable

error: aborting due to 16 previous errors

Some errors have detailed explanations: E0562, E0658.
For more information about an error, try `rustc --explain E0562`.
==============
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment to the issue.

@JohnTitor JohnTitor merged commit 3cbbb76 into master May 17, 2020
@JohnTitor JohnTitor deleted the autofix/ices/69415.sh branch May 17, 2020 01:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants