|
1 |
| -error[E0658]: `R` cannot be used as the type of `self` without the `arbitrary_self_types` feature |
2 |
| - --> $DIR/arbitrary-self-from-method-substs.rs:8:43 |
| 1 | +error[E0799]: invalid generic `self` parameter type: `R` |
| 2 | + --> $DIR/arbitrary-self-from-method-substs.rs:9:43 |
3 | 3 | |
|
4 | 4 | LL | fn get<R: Deref<Target = Self>>(self: R) -> u32 {
|
5 | 5 | | ^
|
6 | 6 | |
|
| 7 | + = note: type of `self` must not be a method generic parameter type |
| 8 | + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`) |
| 9 | + |
| 10 | +error[E0799]: invalid generic `self` parameter type: `&R` |
| 11 | + --> $DIR/arbitrary-self-from-method-substs.rs:13:44 |
| 12 | + | |
| 13 | +LL | fn get1<R: Deref<Target = Self>>(self: &R) -> u32 { |
| 14 | + | ^^ |
| 15 | + | |
| 16 | + = note: type of `self` must not be a method generic parameter type |
| 17 | + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`) |
| 18 | + |
| 19 | +error[E0799]: invalid generic `self` parameter type: `&mut R` |
| 20 | + --> $DIR/arbitrary-self-from-method-substs.rs:17:44 |
| 21 | + | |
| 22 | +LL | fn get2<R: Deref<Target = Self>>(self: &mut R) -> u32 { |
| 23 | + | ^^^^^^ |
| 24 | + | |
| 25 | + = note: type of `self` must not be a method generic parameter type |
| 26 | + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`) |
| 27 | + |
| 28 | +error[E0799]: invalid generic `self` parameter type: `Rc<R>` |
| 29 | + --> $DIR/arbitrary-self-from-method-substs.rs:21:44 |
| 30 | + | |
| 31 | +LL | fn get3<R: Deref<Target = Self>>(self: std::rc::Rc<R>) -> u32 { |
| 32 | + | ^^^^^^^^^^^^^^ |
| 33 | + | |
| 34 | + = note: type of `self` must not be a method generic parameter type |
| 35 | + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`) |
| 36 | + |
| 37 | +error[E0799]: invalid generic `self` parameter type: `&Rc<R>` |
| 38 | + --> $DIR/arbitrary-self-from-method-substs.rs:25:44 |
| 39 | + | |
| 40 | +LL | fn get4<R: Deref<Target = Self>>(self: &std::rc::Rc<R>) -> u32 { |
| 41 | + | ^^^^^^^^^^^^^^^ |
| 42 | + | |
| 43 | + = note: type of `self` must not be a method generic parameter type |
| 44 | + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`) |
| 45 | + |
| 46 | +error[E0799]: invalid generic `self` parameter type: `Rc<&R>` |
| 47 | + --> $DIR/arbitrary-self-from-method-substs.rs:29:44 |
| 48 | + | |
| 49 | +LL | fn get5<R: Deref<Target = Self>>(self: std::rc::Rc<&R>) -> u32 { |
| 50 | + | ^^^^^^^^^^^^^^^ |
| 51 | + | |
| 52 | + = note: type of `self` must not be a method generic parameter type |
| 53 | + = help: use a concrete type such as `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`) |
| 54 | + |
| 55 | +error[E0658]: `<FR as FindReceiver>::Receiver` cannot be used as the type of `self` without the `arbitrary_self_types` feature |
| 56 | + --> $DIR/arbitrary-self-from-method-substs.rs:33:37 |
| 57 | + | |
| 58 | +LL | fn get6<FR: FindReceiver>(self: FR::Receiver, other: FR) -> u32 { |
| 59 | + | ^^^^^^^^^^^^ |
| 60 | + | |
7 | 61 | = note: see issue #44874 <https://github.com/rust-lang/rust/issues/44874> for more information
|
8 | 62 | = help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable
|
9 | 63 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
10 | 64 | = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
|
11 | 65 |
|
12 |
| -error: aborting due to 1 previous error |
| 66 | +error[E0658]: `R` cannot be used as the type of `self` without the `arbitrary_self_types` feature |
| 67 | + --> $DIR/arbitrary-self-from-method-substs.rs:61:18 |
| 68 | + | |
| 69 | +LL | fn get(self: R) {} |
| 70 | + | ^ |
| 71 | + | |
| 72 | + = note: see issue #44874 <https://github.com/rust-lang/rust/issues/44874> for more information |
| 73 | + = help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable |
| 74 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 75 | + = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`) |
| 76 | + |
| 77 | +error[E0271]: type mismatch resolving `<Silly as FindReceiver>::Receiver == Foo` |
| 78 | + --> $DIR/arbitrary-self-from-method-substs.rs:92:9 |
| 79 | + | |
| 80 | +LL | foo.get6(Silly); |
| 81 | + | ^^^^ type mismatch resolving `<Silly as FindReceiver>::Receiver == Foo` |
| 82 | + | |
| 83 | +note: expected this to be `Rc<Foo>` |
| 84 | + --> $DIR/arbitrary-self-from-method-substs.rs:71:21 |
| 85 | + | |
| 86 | +LL | type Receiver = std::rc::Rc<Foo>; |
| 87 | + | ^^^^^^^^^^^^^^^^ |
| 88 | + = note: expected struct `Rc<Foo>` |
| 89 | + found struct `Foo` |
| 90 | + |
| 91 | +error[E0271]: type mismatch resolving `<Silly as FindReceiver>::Receiver == &Foo` |
| 92 | + --> $DIR/arbitrary-self-from-method-substs.rs:96:9 |
| 93 | + | |
| 94 | +LL | foo.get6(Silly); |
| 95 | + | ^^^^ type mismatch resolving `<Silly as FindReceiver>::Receiver == &Foo` |
| 96 | + | |
| 97 | +note: expected this to be `Rc<Foo>` |
| 98 | + --> $DIR/arbitrary-self-from-method-substs.rs:71:21 |
| 99 | + | |
| 100 | +LL | type Receiver = std::rc::Rc<Foo>; |
| 101 | + | ^^^^^^^^^^^^^^^^ |
| 102 | + = note: expected struct `Rc<Foo>` |
| 103 | + found reference `&Foo` |
| 104 | + |
| 105 | +error[E0599]: the method `get` exists for struct `Rc<Bar<_>>`, but its trait bounds were not satisfied |
| 106 | + --> $DIR/arbitrary-self-from-method-substs.rs:100:7 |
| 107 | + | |
| 108 | +LL | struct Bar<R>(std::marker::PhantomData<R>); |
| 109 | + | ------------- doesn't satisfy `Bar<_>: Deref` |
| 110 | +... |
| 111 | +LL | t.get(); |
| 112 | + | ^^^ method cannot be called on `Rc<Bar<_>>` due to unsatisfied trait bounds |
| 113 | + | |
| 114 | +note: the following trait bounds were not satisfied: |
| 115 | + `<&Bar<_> as Deref>::Target = Bar<&Bar<_>>` |
| 116 | + `<&Rc<Bar<_>> as Deref>::Target = Bar<&Rc<Bar<_>>>` |
| 117 | + `<&mut Bar<_> as Deref>::Target = Bar<&mut Bar<_>>` |
| 118 | + `<&mut Rc<Bar<_>> as Deref>::Target = Bar<&mut Rc<Bar<_>>>` |
| 119 | + `<Rc<Bar<_>> as Deref>::Target = Bar<Rc<Bar<_>>>` |
| 120 | + `Bar<_>: Deref` |
| 121 | + --> $DIR/arbitrary-self-from-method-substs.rs:60:9 |
| 122 | + | |
| 123 | +LL | impl<R: std::ops::Deref<Target = Self>> Bar<R> { |
| 124 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------ |
| 125 | + | | | |
| 126 | + | | unsatisfied trait bound introduced here |
| 127 | + | unsatisfied trait bound introduced here |
| 128 | +note: the trait `Deref` must be implemented |
| 129 | + --> $SRC_DIR/core/src/ops/deref.rs:LL:COL |
| 130 | + = help: items from traits can only be used if the trait is implemented and in scope |
| 131 | + = note: the following trait defines an item `get`, perhaps you need to implement it: |
| 132 | + candidate #1: `SliceIndex` |
| 133 | + |
| 134 | +error[E0599]: the method `get` exists for reference `&Rc<Bar<_>>`, but its trait bounds were not satisfied |
| 135 | + --> $DIR/arbitrary-self-from-method-substs.rs:108:7 |
| 136 | + | |
| 137 | +LL | struct Bar<R>(std::marker::PhantomData<R>); |
| 138 | + | ------------- doesn't satisfy `Bar<_>: Deref` |
| 139 | +... |
| 140 | +LL | t.get(); |
| 141 | + | ^^^ method cannot be called on `&Rc<Bar<_>>` due to unsatisfied trait bounds |
| 142 | + | |
| 143 | +note: the following trait bounds were not satisfied: |
| 144 | + `<&&Rc<Bar<_>> as Deref>::Target = Bar<&&Rc<Bar<_>>>` |
| 145 | + `<&Bar<_> as Deref>::Target = Bar<&Bar<_>>` |
| 146 | + `<&Rc<Bar<_>> as Deref>::Target = Bar<&Rc<Bar<_>>>` |
| 147 | + `<&mut &Rc<Bar<_>> as Deref>::Target = Bar<&mut &Rc<Bar<_>>>` |
| 148 | + `<&mut Bar<_> as Deref>::Target = Bar<&mut Bar<_>>` |
| 149 | + `<&mut Rc<Bar<_>> as Deref>::Target = Bar<&mut Rc<Bar<_>>>` |
| 150 | + `<Rc<Bar<_>> as Deref>::Target = Bar<Rc<Bar<_>>>` |
| 151 | + `Bar<_>: Deref` |
| 152 | + --> $DIR/arbitrary-self-from-method-substs.rs:60:9 |
| 153 | + | |
| 154 | +LL | impl<R: std::ops::Deref<Target = Self>> Bar<R> { |
| 155 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------ |
| 156 | + | | | |
| 157 | + | | unsatisfied trait bound introduced here |
| 158 | + | unsatisfied trait bound introduced here |
| 159 | +note: the trait `Deref` must be implemented |
| 160 | + --> $SRC_DIR/core/src/ops/deref.rs:LL:COL |
| 161 | + = help: items from traits can only be used if the trait is implemented and in scope |
| 162 | + = note: the following trait defines an item `get`, perhaps you need to implement it: |
| 163 | + candidate #1: `SliceIndex` |
| 164 | + |
| 165 | +error: aborting due to 12 previous errors |
13 | 166 |
|
14 |
| -For more information about this error, try `rustc --explain E0658`. |
| 167 | +Some errors have detailed explanations: E0271, E0599, E0658, E0799. |
| 168 | +For more information about an error, try `rustc --explain E0271`. |
0 commit comments