Skip to content

Commit e68cb00

Browse files
committed
address review comments
1 parent bd2d70d commit e68cb00

File tree

3 files changed

+12
-92
lines changed

3 files changed

+12
-92
lines changed

tests/ui/const-generics/generic_const_exprs/ice-generics_of-no-entry-found-for-key-113017.rs

+4-11
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,11 @@
33
#![feature(generic_const_exprs)]
44
#![allow(incomplete_features)]
55

6-
pub fn String<V>(elem)
7-
//~^ ERROR expected one of `:`, `@`, or `|`, found `)`
6+
pub fn foo()
87
where
9-
V: 'a,
10-
//~^ ERROR use of undeclared lifetime name `'a`
11-
for<const N: usize = { || {}}> V: 'a,
12-
//~^ ERROR use of undeclared lifetime name `'a`
13-
//~^^ ERROR only lifetime parameters can be used in this context
14-
//~^^^ ERROR defaults for generic parameters are not allowed in `for<...>` binders
15-
for<C2: , R2, R3: > <&str as IntoIterator>::Item: 'static,
16-
//~^ ERROR `&` without an explicit lifetime name cannot be used here
17-
//~^^ ERROR only lifetime parameters can be used in this context
8+
for<const N: usize = { || {}; 1 }> ():,
9+
//~^ ERROR only lifetime parameters can be used in this context
10+
//~^^ ERROR defaults for generic parameters are not allowed in `for<...>` binders
1811
{}
1912

2013
pub fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,19 @@
1-
error: expected one of `:`, `@`, or `|`, found `)`
2-
--> $DIR/ice-generics_of-no-entry-found-for-key-113017.rs:6:22
3-
|
4-
LL | pub fn String<V>(elem)
5-
| ^ expected one of `:`, `@`, or `|`
6-
|
7-
= note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
8-
help: if this is a `self` type, give it a parameter name
9-
|
10-
LL | pub fn String<V>(self: elem)
11-
| +++++
12-
help: if this is a parameter name, give it a type
13-
|
14-
LL | pub fn String<V>(elem: TypeName)
15-
| ++++++++++
16-
help: if this is a type, explicitly ignore the parameter name
17-
|
18-
LL | pub fn String<V>(_: elem)
19-
| ++
20-
21-
error[E0261]: use of undeclared lifetime name `'a`
22-
--> $DIR/ice-generics_of-no-entry-found-for-key-113017.rs:9:8
23-
|
24-
LL | V: 'a,
25-
| ^^ undeclared lifetime
26-
|
27-
= note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
28-
help: consider making the bound lifetime-generic with a new `'a` lifetime
29-
|
30-
LL | for<'a> V: 'a,
31-
| +++++++
32-
help: consider introducing lifetime `'a` here
33-
|
34-
LL | pub fn String<'a, V>(elem)
35-
| +++
36-
37-
error[E0261]: use of undeclared lifetime name `'a`
38-
--> $DIR/ice-generics_of-no-entry-found-for-key-113017.rs:11:39
39-
|
40-
LL | for<const N: usize = { || {}}> V: 'a,
41-
| ^^ undeclared lifetime
42-
|
43-
help: consider making the bound lifetime-generic with a new `'a` lifetime
44-
|
45-
LL | for<'a, const N: usize = { || {}}> V: 'a,
46-
| +++
47-
help: consider introducing lifetime `'a` here
48-
|
49-
LL | pub fn String<'a, V>(elem)
50-
| +++
51-
52-
error[E0637]: `&` without an explicit lifetime name cannot be used here
53-
--> $DIR/ice-generics_of-no-entry-found-for-key-113017.rs:15:26
54-
|
55-
LL | for<C2: , R2, R3: > <&str as IntoIterator>::Item: 'static,
56-
| ^ explicit lifetime name needed here
57-
|
58-
help: consider introducing a higher-ranked lifetime here
59-
|
60-
LL | for<'a> for<C2: , R2, R3: > <&'a str as IntoIterator>::Item: 'static,
61-
| +++++++ ++
62-
631
error[E0658]: only lifetime parameters can be used in this context
64-
--> $DIR/ice-generics_of-no-entry-found-for-key-113017.rs:11:15
2+
--> $DIR/ice-generics_of-no-entry-found-for-key-113017.rs:8:15
653
|
66-
LL | for<const N: usize = { || {}}> V: 'a,
4+
LL | for<const N: usize = { || {}; 1 }> ():,
675
| ^
686
|
697
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
708
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable
719
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
7210

73-
error[E0658]: only lifetime parameters can be used in this context
74-
--> $DIR/ice-generics_of-no-entry-found-for-key-113017.rs:15:9
75-
|
76-
LL | for<C2: , R2, R3: > <&str as IntoIterator>::Item: 'static,
77-
| ^^ ^^ ^^
78-
|
79-
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
80-
= help: add `#![feature(non_lifetime_binders)]` to the crate attributes to enable
81-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
82-
8311
error: defaults for generic parameters are not allowed in `for<...>` binders
84-
--> $DIR/ice-generics_of-no-entry-found-for-key-113017.rs:11:9
12+
--> $DIR/ice-generics_of-no-entry-found-for-key-113017.rs:8:9
8513
|
86-
LL | for<const N: usize = { || {}}> V: 'a,
87-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
14+
LL | for<const N: usize = { || {}; 1 }> ():,
15+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8816

89-
error: aborting due to 7 previous errors
17+
error: aborting due to 2 previous errors
9018

91-
Some errors have detailed explanations: E0261, E0637, E0658.
92-
For more information about an error, try `rustc --explain E0261`.
19+
For more information about this error, try `rustc --explain E0658`.

tests/ui/type-alias-impl-trait/ice-failed-to-resolve-instance-for-110696.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl<T> MyFrom<Phantom2<T>> for Phantom1<T> {
4040
}
4141

4242
impl<T: MyFrom<Phantom2<DummyT<U>>>, U> MyIndex<DummyT<T>> for Scope<U> {
43-
//~^ ERROR the type parameter `T` is not constrained by the impl trait, self type, or predicates
43+
//~^ ERROR the type parameter `T` is not constrained by the impl
4444
type O = T;
4545
fn my_index(self) -> Self::O {
4646
MyFrom::my_from(self.0).ok().unwrap()

0 commit comments

Comments
 (0)