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

Commit 6052cc1

Browse files
committed
Mark change in errors as accepted
1 parent ed16571 commit 6052cc1

File tree

15 files changed

+25
-32
lines changed

15 files changed

+25
-32
lines changed

compiler/rustc_hir/src/hir.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ impl<'hir> ConstArg<'hir> {
255255

256256
#[derive(Clone, Copy, Debug, HashStable_Generic)]
257257
pub enum ConstArgKind<'hir> {
258+
/// **Note:** Currently this is only used for bare const params, not paths to any const.
259+
/// However, in the future, we'll be using it for all of those.
258260
Path(QPath<'hir>),
259261
Anon(&'hir AnonConst),
260262
}

tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
#![feature(with_negative_coherence)]
66
trait Trait {}
77
impl<const N: u8> Trait for [(); N] {}
8-
//~^ ERROR: mismatched types
98
impl<const N: i8> Trait for [(); N] {}
10-
//~^ ERROR: mismatched types
11-
//~| ERROR: conflicting implementations of trait `Trait`
9+
//~^ ERROR: conflicting implementations of trait `Trait`
1210

1311
fn main() {}

tests/ui/coherence/negative-coherence/generic_const_type_mismatch.stderr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
error[E0119]: conflicting implementations of trait `Trait` for type `[(); _]`
2-
--> $DIR/generic_const_type_mismatch.rs:9:1
2+
--> $DIR/generic_const_type_mismatch.rs:8:1
33
|
44
LL | impl<const N: u8> Trait for [(); N] {}
55
| ----------------------------------- first implementation here
6-
LL |
76
LL | impl<const N: i8> Trait for [(); N] {}
87
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `[(); _]`
98

tests/ui/const-generics/bad-subst-const-kind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ trait Q {
66
}
77

88
impl<const N: u64> Q for [u8; N] {
9-
//~^ ERROR mismatched types
9+
//~^ ERROR: the constant `N` is not of type `usize`
1010
const ASSOC: usize = 1;
1111
}
1212

tests/ui/const-generics/generic_const_exprs/type_mismatch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trait Q {
77

88
impl<const N: u64> Q for [u8; N] {}
99
//~^ ERROR not all trait items implemented
10-
//~| ERROR mismatched types
10+
//~| ERROR the constant `N` is not of type `usize`
1111

1212
pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {}
1313
//~^ ERROR the constant `13` is not of type `u64`

tests/ui/const-generics/transmute-fail.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ fn foo<const W: usize, const H: usize>(v: [[u32;H+1]; W]) -> [[u32; W+1]; H] {
1010
}
1111

1212
fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] {
13-
//~^ ERROR mismatched types
14-
//~| ERROR mismatched types
13+
//~^ ERROR the constant `W` is not of type `usize`
1514
unsafe {
1615
std::mem::transmute(v)
17-
//~^ ERROR cannot transmute between types
16+
//~^ ERROR the constant `W` is not of type `usize`
1817
}
1918
}
2019

tests/ui/const-generics/transmute-fail.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ LL | std::mem::transmute(v)
1414
= note: target type: `[[u32; W+1]; H]` (size can vary because of [u32; W+1])
1515

1616
error: the constant `W` is not of type `usize`
17-
--> $DIR/transmute-fail.rs:16:5
17+
--> $DIR/transmute-fail.rs:15:5
1818
|
1919
LL | std::mem::transmute(v)
2020
| ^^^^^^^^^^^^^^^^^^^ expected `usize`, found `bool`
2121

2222
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
23-
--> $DIR/transmute-fail.rs:23:5
23+
--> $DIR/transmute-fail.rs:22:5
2424
|
2525
LL | std::mem::transmute(v)
2626
| ^^^^^^^^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL | std::mem::transmute(v)
2929
= note: target type: `[u32; W * H * H]` (this type does not have a fixed size)
3030

3131
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
32-
--> $DIR/transmute-fail.rs:30:5
32+
--> $DIR/transmute-fail.rs:29:5
3333
|
3434
LL | std::mem::transmute(v)
3535
| ^^^^^^^^^^^^^^^^^^^
@@ -38,7 +38,7 @@ LL | std::mem::transmute(v)
3838
= note: target type: `[[[u32; 9999999]; 777777777]; 8888888]` (values of the type `[[u32; 9999999]; 777777777]` are too big for the current architecture)
3939

4040
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
41-
--> $DIR/transmute-fail.rs:37:5
41+
--> $DIR/transmute-fail.rs:36:5
4242
|
4343
LL | std::mem::transmute(v)
4444
| ^^^^^^^^^^^^^^^^^^^
@@ -47,7 +47,7 @@ LL | std::mem::transmute(v)
4747
= note: target type: `[[u32; W]; H]` (size can vary because of [u32; W])
4848

4949
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
50-
--> $DIR/transmute-fail.rs:50:5
50+
--> $DIR/transmute-fail.rs:49:5
5151
|
5252
LL | std::mem::transmute(v)
5353
| ^^^^^^^^^^^^^^^^^^^
@@ -56,7 +56,7 @@ LL | std::mem::transmute(v)
5656
= note: target type: `[u32; W * H]` (this type does not have a fixed size)
5757

5858
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
59-
--> $DIR/transmute-fail.rs:57:5
59+
--> $DIR/transmute-fail.rs:56:5
6060
|
6161
LL | std::mem::transmute(v)
6262
| ^^^^^^^^^^^^^^^^^^^
@@ -65,7 +65,7 @@ LL | std::mem::transmute(v)
6565
= note: target type: `[[u32; W]; H]` (size can vary because of [u32; W])
6666

6767
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
68-
--> $DIR/transmute-fail.rs:66:5
68+
--> $DIR/transmute-fail.rs:65:5
6969
|
7070
LL | std::mem::transmute(v)
7171
| ^^^^^^^^^^^^^^^^^^^
@@ -74,7 +74,7 @@ LL | std::mem::transmute(v)
7474
= note: target type: `[u32; D * W * H]` (this type does not have a fixed size)
7575

7676
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
77-
--> $DIR/transmute-fail.rs:75:5
77+
--> $DIR/transmute-fail.rs:74:5
7878
|
7979
LL | std::mem::transmute(v)
8080
| ^^^^^^^^^^^^^^^^^^^
@@ -83,7 +83,7 @@ LL | std::mem::transmute(v)
8383
= note: target type: `[[u32; D * W]; H]` (size can vary because of [u32; D * W])
8484

8585
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
86-
--> $DIR/transmute-fail.rs:82:5
86+
--> $DIR/transmute-fail.rs:81:5
8787
|
8888
LL | std::mem::transmute(v)
8989
| ^^^^^^^^^^^^^^^^^^^
@@ -92,7 +92,7 @@ LL | std::mem::transmute(v)
9292
= note: target type: `[u8; L * 2]` (this type does not have a fixed size)
9393

9494
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
95-
--> $DIR/transmute-fail.rs:89:5
95+
--> $DIR/transmute-fail.rs:88:5
9696
|
9797
LL | std::mem::transmute(v)
9898
| ^^^^^^^^^^^^^^^^^^^
@@ -101,7 +101,7 @@ LL | std::mem::transmute(v)
101101
= note: target type: `[u16; L]` (this type does not have a fixed size)
102102

103103
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
104-
--> $DIR/transmute-fail.rs:96:5
104+
--> $DIR/transmute-fail.rs:95:5
105105
|
106106
LL | std::mem::transmute(v)
107107
| ^^^^^^^^^^^^^^^^^^^
@@ -110,7 +110,7 @@ LL | std::mem::transmute(v)
110110
= note: target type: `[[u8; 1]; L]` (this type does not have a fixed size)
111111

112112
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
113-
--> $DIR/transmute-fail.rs:105:5
113+
--> $DIR/transmute-fail.rs:104:5
114114
|
115115
LL | std::mem::transmute(v)
116116
| ^^^^^^^^^^^^^^^^^^^
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
fn foo<const N: usize>() -> [u8; N] {
2-
bar::<N>() //~ ERROR mismatched types
2+
bar::<N>()
33
//~^ ERROR the constant `N` is not of type `u8`
44
}
55

66
fn bar<const N: u8>() -> [u8; N] {}
7-
//~^ ERROR mismatched types
7+
//~^ ERROR the constant `N` is not of type `usize`
88
//~| ERROR mismatched types
99

1010
fn main() {}

tests/ui/lifetimes/issue-95023.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ impl Fn(&isize) for Error {
99
//~^ ERROR associated function in `impl` without body
1010
//~^^ ERROR method `foo` is not a member of trait `Fn` [E0407]
1111
//~^^^ ERROR associated type `B` not found for `Self` [E0220]
12-
//~| ERROR associated type `B` not found for `Self` [E0220]
1312
}
1413
fn main() {}

tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ struct Wrapper<const C: <i32 as Trait>::Type> {}
1414

1515
impl<const C: usize> Wrapper<C> {}
1616
//~^ ERROR the constant `C` is not of type `<i32 as Trait>::Type`
17-
//~^^ ERROR mismatched types
1817

1918
fn main() {}

tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
struct S<const L: usize>;
77

88
impl<const N: i32> Copy for S<N> {}
9-
//~^ ERROR: mismatched types
109
impl<const M: usize> Copy for S<M> {}
1110
//~^ ERROR: conflicting implementations of trait `Copy` for type `S<_>`
1211

tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
error[E0119]: conflicting implementations of trait `Copy` for type `S<_>`
2-
--> $DIR/bad-const-wf-doesnt-specialize.rs:10:1
2+
--> $DIR/bad-const-wf-doesnt-specialize.rs:9:1
33
|
44
LL | impl<const N: i32> Copy for S<N> {}
55
| -------------------------------- first implementation here
6-
LL |
76
LL | impl<const M: usize> Copy for S<M> {}
87
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `S<_>`
98

tests/ui/transmutability/issue-101739-1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ mod assert {
77
where
88
Dst: BikeshedIntrinsicFrom<Src, ASSUME_ALIGNMENT>, //~ ERROR cannot find type `Dst` in this scope
99
//~^ the constant `ASSUME_ALIGNMENT` is not of type `Assume`
10-
//~| ERROR: mismatched types
1110
{
1211
}
1312
}

tests/ui/transmutability/issue-101739-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ mod assert {
1616
where
1717
Dst: BikeshedIntrinsicFrom< //~ ERROR trait takes at most 2 generic arguments but 5 generic arguments were supplied
1818
Src,
19-
ASSUME_ALIGNMENT, //~ ERROR: mismatched types
19+
ASSUME_ALIGNMENT,
2020
ASSUME_LIFETIMES,
2121
ASSUME_VALIDITY,
2222
ASSUME_VISIBILITY,

tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
trait Trait {
8-
fn func<const N: u32>() -> [ (); N ]; //~ ERROR mismatched types
8+
fn func<const N: u32>() -> [ (); N ]; //~ ERROR the constant `N` is not of type `usize`
99
}
1010

1111
struct S {}

0 commit comments

Comments
 (0)