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

ices/43924.rs: fixed with errors #297

Merged
merged 1 commit into from
Feb 27, 2020
Merged

ices/43924.rs: fixed with errors #297

merged 1 commit into from
Feb 27, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#43924

#![feature(associated_type_defaults)] 
trait Foo < T : Default + ToString >
{ 
  type Out : Default + ToString = ToString; 
}

impl Foo < u32 > for () {} 
impl Foo < u64 > for () {}

fn main ()
{ 
  assert_eq ! (< () as Foo < u32 >> :: Out :: default().to_string(), "false"); 
} 
=== stdout ===
=== stderr ===
warning: trait objects without an explicit `dyn` are deprecated
 --> /home/runner/work/glacier/glacier/ices/43924.rs:4:35
  |
4 |   type Out : Default + ToString = ToString; 
  |                                   ^^^^^^^^ help: use `dyn`: `dyn ToString`
  |
  = note: `#[warn(bare_trait_objects)]` on by default

error[E0277]: the size for values of type `(dyn std::string::ToString + 'static)` cannot be known at compilation time
 --> /home/runner/work/glacier/glacier/ices/43924.rs:4:3
  |
2 | trait Foo < T : Default + ToString >
  | ------------------------------------ required by `Foo`
3 | { 
4 |   type Out : Default + ToString = ToString; 
  |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
  |
  = help: the trait `std::marker::Sized` is not implemented for `(dyn std::string::ToString + 'static)`
  = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>

error[E0277]: the trait bound `(dyn std::string::ToString + 'static): std::default::Default` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/43924.rs:4:14
  |
2 | trait Foo < T : Default + ToString >
  | ------------------------------------ required by `Foo`
3 | { 
4 |   type Out : Default + ToString = ToString; 
  |              ^^^^^^^ the trait `std::default::Default` is not implemented for `(dyn std::string::ToString + 'static)`

error[E0277]: the trait bound `(dyn std::string::ToString + 'static): std::default::Default` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/43924.rs:7:6
  |
7 | impl Foo < u32 > for () {} 
  |      ^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `(dyn std::string::ToString + 'static)`

error[E0277]: the trait bound `(dyn std::string::ToString + 'static): std::default::Default` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/43924.rs:8:6
  |
8 | impl Foo < u64 > for () {}
  |      ^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `(dyn std::string::ToString + 'static)`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0277`.
==============

=== stdout ===
=== stderr ===
warning: trait objects without an explicit `dyn` are deprecated
 --> /home/runner/work/glacier/glacier/ices/43924.rs:4:35
  |
4 |   type Out : Default + ToString = ToString; 
  |                                   ^^^^^^^^ help: use `dyn`: `dyn ToString`
  |
  = note: `#[warn(bare_trait_objects)]` on by default

error[E0277]: the size for values of type `(dyn std::string::ToString + 'static)` cannot be known at compilation time
 --> /home/runner/work/glacier/glacier/ices/43924.rs:4:3
  |
2 | trait Foo < T : Default + ToString >
  | ------------------------------------ required by `Foo`
3 | { 
4 |   type Out : Default + ToString = ToString; 
  |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
  |
  = help: the trait `std::marker::Sized` is not implemented for `(dyn std::string::ToString + 'static)`
  = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>

error[E0277]: the trait bound `(dyn std::string::ToString + 'static): std::default::Default` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/43924.rs:4:14
  |
2 | trait Foo < T : Default + ToString >
  | ------------------------------------ required by `Foo`
3 | { 
4 |   type Out : Default + ToString = ToString; 
  |              ^^^^^^^ the trait `std::default::Default` is not implemented for `(dyn std::string::ToString + 'static)`

error[E0277]: the trait bound `(dyn std::string::ToString + 'static): std::default::Default` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/43924.rs:7:6
  |
7 | impl Foo < u32 > for () {} 
  |      ^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `(dyn std::string::ToString + 'static)`

error[E0277]: the trait bound `(dyn std::string::ToString + 'static): std::default::Default` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/43924.rs:8:6
  |
8 | impl Foo < u64 > for () {}
  |      ^^^^^^^^^^^ the trait `std::default::Default` is not implemented for `(dyn std::string::ToString + 'static)`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0277`.
==============
@JohnTitor JohnTitor merged commit e198aae into master Feb 27, 2020
@JohnTitor JohnTitor deleted the autofix/ices/43924.rs branch February 27, 2020 12:44
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