mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-10 05:53:10 +00:00
lessen restriction in check_kind_count
This commit is contained in:
parent
49c0b318df
commit
06c9c599ed
@ -409,7 +409,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
(required, "")
|
||||
};
|
||||
|
||||
let (spans, label) = if required == permitted && provided > permitted {
|
||||
let (spans, label) = if provided > permitted {
|
||||
// In the case when the user has provided too many arguments,
|
||||
// we want to point to the unexpected arguments.
|
||||
let spans: Vec<Span> = args.args[offset + permitted..offset + provided]
|
||||
|
@ -32,10 +32,10 @@ LL | let _: Example<CompileFlag::A, _> = Example { x: 0 };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 const argument
|
||||
|
||||
error[E0107]: wrong number of type arguments: expected at most 1, found 2
|
||||
--> $DIR/invalid-enum.rs:31:10
|
||||
--> $DIR/invalid-enum.rs:31:34
|
||||
|
|
||||
LL | let _: Example<CompileFlag::A, _> = Example { x: 0 };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected at most 1 type argument
|
||||
| ^ unexpected type argument
|
||||
|
|
||||
help: If this generic argument was intended as a const parameter, try surrounding it with braces:
|
||||
|
|
||||
@ -49,10 +49,10 @@ LL | let _: Example<Example::ASSOC_FLAG, _> = Example { x: 0 };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 const argument
|
||||
|
||||
error[E0107]: wrong number of type arguments: expected at most 1, found 2
|
||||
--> $DIR/invalid-enum.rs:36:10
|
||||
--> $DIR/invalid-enum.rs:36:39
|
||||
|
|
||||
LL | let _: Example<Example::ASSOC_FLAG, _> = Example { x: 0 };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected at most 1 type argument
|
||||
| ^ unexpected type argument
|
||||
|
|
||||
help: If this generic argument was intended as a const parameter, try surrounding it with braces:
|
||||
|
|
||||
|
@ -1,8 +1,8 @@
|
||||
error[E0107]: wrong number of type arguments: expected at most 2, found 3
|
||||
--> $DIR/generic-impl-more-params-with-defaults.rs:13:5
|
||||
--> $DIR/generic-impl-more-params-with-defaults.rs:13:24
|
||||
|
|
||||
LL | Vec::<isize, Heap, bool>::new();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type arguments
|
||||
| ^^^^ unexpected type argument
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
error[E0107]: wrong number of type arguments: expected at most 2, found 3
|
||||
--> $DIR/generic-type-more-params-with-defaults.rs:9:12
|
||||
--> $DIR/generic-type-more-params-with-defaults.rs:9:29
|
||||
|
|
||||
LL | let _: Vec<isize, Heap, bool>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type arguments
|
||||
| ^^^^ unexpected type argument
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user