Skip to content

Commit 7e4c9ee

Browse files
committed
Auto merge of #90151 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] backports * Don't emit a warning for empty rmeta files. #90072 * Erase late-bound regions before computing vtable debuginfo name. #90050 * Fix wrong niche calculation when 2+ niches are placed at the start #90040 * Revert #86011 to fix an incorrect bound check #90025 * Fix macro_rules! duplication when reexported in the same module #89867 * Bump cargo to include rust-lang/cargo#9979 - Fix fetching git repos after a force push. r? `@Mark-Simulacrum`
2 parents d464727 + 88e4e0e commit 7e4c9ee

30 files changed

+167
-84
lines changed

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -480,14 +480,11 @@ pub fn compute_debuginfo_vtable_name<'tcx>(
480480
}
481481

482482
if let Some(trait_ref) = trait_ref {
483-
push_item_name(tcx, trait_ref.skip_binder().def_id, true, &mut vtable_name);
483+
let trait_ref =
484+
tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), trait_ref);
485+
push_item_name(tcx, trait_ref.def_id, true, &mut vtable_name);
484486
visited.clear();
485-
push_generic_params_internal(
486-
tcx,
487-
trait_ref.skip_binder().substs,
488-
&mut vtable_name,
489-
&mut visited,
490-
);
487+
push_generic_params_internal(tcx, trait_ref.substs, &mut vtable_name, &mut visited);
491488
} else {
492489
vtable_name.push_str("_");
493490
}

compiler/rustc_metadata/src/locator.rs

+9
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,15 @@ impl<'a> CrateLocator<'a> {
529529
let mut err_data: Option<Vec<PathBuf>> = None;
530530
for (lib, kind) in m {
531531
info!("{} reading metadata from: {}", flavor, lib.display());
532+
if flavor == CrateFlavor::Rmeta && lib.metadata().map_or(false, |m| m.len() == 0) {
533+
// Empty files will cause get_metadata_section to fail. Rmeta
534+
// files can be empty, for example with binaries (which can
535+
// often appear with `cargo check` when checking a library as
536+
// a unittest). We don't want to emit a user-visible warning
537+
// in this case as it is not a real problem.
538+
debug!("skipping empty file");
539+
continue;
540+
}
532541
let (hash, metadata) =
533542
match get_metadata_section(self.target, flavor, &lib, self.metadata_loader) {
534543
Ok(blob) => {

compiler/rustc_target/src/abi/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ impl Niche {
11171117
// In practice this means that enums with `count > 1` are unlikely to claim niche zero, since they have to fit perfectly.
11181118
// If niche zero is already reserved, the selection of bounds are of little interest.
11191119
let move_start = |v: WrappingRange| {
1120-
let start = v.start.wrapping_sub(1) & max_value;
1120+
let start = v.start.wrapping_sub(count) & max_value;
11211121
Some((start, Scalar { value, valid_range: v.with_start(start) }))
11221122
};
11231123
let move_end = |v: WrappingRange| {

compiler/rustc_typeck/src/bounds.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ impl<'tcx> Bounds<'tcx> {
6464
})
6565
});
6666

67-
self.region_bounds
68-
.iter()
69-
.map(|&(region_bound, span)| {
67+
sized_predicate
68+
.into_iter()
69+
.chain(self.region_bounds.iter().map(|&(region_bound, span)| {
7070
(
7171
region_bound
7272
.map_bound(|region_bound| ty::OutlivesPredicate(param_ty, region_bound))
7373
.to_predicate(tcx),
7474
span,
7575
)
76-
})
76+
}))
7777
.chain(self.trait_bounds.iter().map(|&(bound_trait_ref, span, constness)| {
7878
let predicate = bound_trait_ref.with_constness(constness).to_predicate(tcx);
7979
(predicate, span)
@@ -83,7 +83,6 @@ impl<'tcx> Bounds<'tcx> {
8383
.iter()
8484
.map(|&(projection, span)| (projection.to_predicate(tcx), span)),
8585
)
86-
.chain(sized_predicate.into_iter())
8786
.collect()
8887
}
8988
}

src/librustdoc/visit_ast.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,21 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
8787
// the rexport defines the path that a user will actually see. Accordingly,
8888
// we add the rexport as an item here, and then skip over the original
8989
// definition in `visit_item()` below.
90+
//
91+
// We also skip `#[macro_export] macro_rules!` that have already been inserted,
92+
// it can happen if within the same module a `#[macro_export] macro_rules!`
93+
// is declared but also a reexport of itself producing two exports of the same
94+
// macro in the same module.
95+
let mut inserted = FxHashSet::default();
9096
for export in self.cx.tcx.module_exports(CRATE_DEF_ID).unwrap_or(&[]) {
9197
if let Res::Def(DefKind::Macro(_), def_id) = export.res {
9298
if let Some(local_def_id) = def_id.as_local() {
9399
if self.cx.tcx.has_attr(def_id, sym::macro_export) {
94-
let hir_id = self.cx.tcx.hir().local_def_id_to_hir_id(local_def_id);
95-
let item = self.cx.tcx.hir().expect_item(hir_id);
96-
top_level_module.items.push((item, None));
100+
if inserted.insert(def_id) {
101+
let hir_id = self.cx.tcx.hir().local_def_id_to_hir_id(local_def_id);
102+
let item = self.cx.tcx.hir().expect_item(hir_id);
103+
top_level_module.items.push((item, None));
104+
}
97105
}
98106
}
99107
}

src/test/codegen/debug-vtable.rs

+10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
// MSVC-LABEL: !DIGlobalVariable(name: "impl$<debug_vtable::Foo, _>::vtable$"
1919
// CHECK: !DISubrange(count: 3
2020

21+
// NONMSVC-LABEL: !DIGlobalVariable(name: "<debug_vtable::bar::{closure#0} as core::ops::function::FnOnce<(core::option::Option<&dyn core::ops::function::Fn<(), Output=()>>)>>::{vtable}"
22+
// MSVC-LABEL: !DIGlobalVariable(name: "impl$<debug_vtable::bar::closure$0, core::ops::function::FnOnce<tuple$<enum$<core::option::Option<ref$<dyn$<core::ops::function::Fn<tuple$<>,assoc$<Output,tuple$<> > > > > >, {{.*}}, {{.*}}, Some> > > >::vtable$"
23+
2124
#![crate_type = "lib"]
2225

2326
pub struct Foo;
@@ -45,3 +48,10 @@ pub fn foo(x: &Foo) -> (u32, (u64, i8), &dyn Send) {
4548
let z: &dyn SomeTraitWithGenerics<u64, i8> = x;
4649
(y.method1(), z.method1(), x as &dyn Send)
4750
}
51+
52+
// Constructing the debuginfo name for the FnOnce vtable below initially caused an ICE on MSVC
53+
// because the trait type contains a late bound region that needed to be erased before the type
54+
// layout for the niche enum `Option<&dyn Fn()>` could be computed.
55+
pub fn bar() -> Box<dyn FnOnce(Option<&dyn Fn()>)> {
56+
Box::new(|_x: Option<&dyn Fn()>| {})
57+
}
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// edition:2018
2+
3+
#![no_core]
4+
#![feature(no_core)]
5+
6+
// @count macro.json "$.index[*][?(@.name=='macro')].inner.items[*]" 2
7+
8+
// @set repro_id = macro.json "$.index[*][?(@.name=='repro')].id"
9+
// @has - "$.index[*][?(@.name=='macro')].inner.items[*]" $repro_id
10+
#[macro_export]
11+
macro_rules! repro {
12+
() => {};
13+
}
14+
15+
// @set repro2_id = macro.json "$.index[*][?(@.inner.name=='repro2')].id"
16+
// @has - "$.index[*][?(@.name=='macro')].inner.items[*]" $repro2_id
17+
pub use crate::repro as repro2;

src/test/rustdoc/issue-89852.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// edition:2018
2+
3+
#![no_core]
4+
#![feature(no_core)]
5+
6+
// @matches 'issue_89852/sidebar-items.js' '"repro"'
7+
// @!matches 'issue_89852/sidebar-items.js' '"repro".*"repro"'
8+
9+
#[macro_export]
10+
macro_rules! repro {
11+
() => {};
12+
}
13+
14+
pub use crate::repro as repro2;

src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: required by a bound in `std::hash::Hash::hash`
1111
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
1212
|
1313
LL | fn hash<H: Hasher>(&self, state: &mut H);
14-
| ^^^^^^ required by this bound in `std::hash::Hash::hash`
14+
| ^ required by this bound in `std::hash::Hash::hash`
1515
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error: aborting due to previous error

src/test/ui/derives/derives-span-Hash-enum.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: required by a bound in `std::hash::Hash::hash`
1111
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
1212
|
1313
LL | fn hash<H: Hasher>(&self, state: &mut H);
14-
| ^^^^^^ required by this bound in `std::hash::Hash::hash`
14+
| ^ required by this bound in `std::hash::Hash::hash`
1515
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error: aborting due to previous error

src/test/ui/derives/derives-span-Hash-struct.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: required by a bound in `std::hash::Hash::hash`
1111
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
1212
|
1313
LL | fn hash<H: Hasher>(&self, state: &mut H);
14-
| ^^^^^^ required by this bound in `std::hash::Hash::hash`
14+
| ^ required by this bound in `std::hash::Hash::hash`
1515
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error: aborting due to previous error

src/test/ui/derives/derives-span-Hash-tuple-struct.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: required by a bound in `std::hash::Hash::hash`
1111
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
1212
|
1313
LL | fn hash<H: Hasher>(&self, state: &mut H);
14-
| ^^^^^^ required by this bound in `std::hash::Hash::hash`
14+
| ^ required by this bound in `std::hash::Hash::hash`
1515
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error: aborting due to previous error
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// run-pass
2+
3+
#[repr(u32)]
4+
pub enum Foo {
5+
// Greater than or equal to 2
6+
A = 2,
7+
}
8+
9+
pub enum Bar {
10+
A(Foo),
11+
// More than two const variants
12+
B,
13+
C,
14+
}
15+
16+
fn main() {
17+
match Bar::A(Foo::A) {
18+
Bar::A(_) => (),
19+
_ => unreachable!(),
20+
}
21+
}

src/test/ui/generic-associated-types/issue-74816.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
error[E0277]: the size for values of type `Self` cannot be known at compilation time
1+
error[E0277]: the trait bound `Self: Trait1` is not satisfied
22
--> $DIR/issue-74816.rs:9:5
33
|
44
LL | type Associated: Trait1 = Self;
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait1` is not implemented for `Self`
66
|
77
note: required by a bound in `Trait2::Associated`
8-
--> $DIR/issue-74816.rs:9:5
8+
--> $DIR/issue-74816.rs:9:22
99
|
1010
LL | type Associated: Trait1 = Self;
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Trait2::Associated`
11+
| ^^^^^^ required by this bound in `Trait2::Associated`
1212
help: consider further restricting `Self`
1313
|
14-
LL | trait Trait2: Sized {
15-
| +++++++
14+
LL | trait Trait2: Trait1 {
15+
| ++++++++
1616

17-
error[E0277]: the trait bound `Self: Trait1` is not satisfied
17+
error[E0277]: the size for values of type `Self` cannot be known at compilation time
1818
--> $DIR/issue-74816.rs:9:5
1919
|
2020
LL | type Associated: Trait1 = Self;
21-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait1` is not implemented for `Self`
21+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
2222
|
2323
note: required by a bound in `Trait2::Associated`
24-
--> $DIR/issue-74816.rs:9:22
24+
--> $DIR/issue-74816.rs:9:5
2525
|
2626
LL | type Associated: Trait1 = Self;
27-
| ^^^^^^ required by this bound in `Trait2::Associated`
27+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Trait2::Associated`
2828
help: consider further restricting `Self`
2929
|
30-
LL | trait Trait2: Trait1 {
31-
| ++++++++
30+
LL | trait Trait2: Sized {
31+
| +++++++
3232

3333
error: aborting due to 2 previous errors
3434

src/test/ui/generic-associated-types/issue-86483.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ LL | for<'a> T: 'a,
2020
| ^^
2121

2222
error[E0311]: the parameter type `T` may not live long enough
23-
--> $DIR/issue-86483.rs:9:19
23+
--> $DIR/issue-86483.rs:9:5
2424
|
2525
LL | pub trait IceIce<T>
2626
| - help: consider adding an explicit lifetime bound...: `T: 'a`
2727
...
2828
LL | type Ice<'v>: IntoIterator<Item = &'v T>;
29-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
29+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
3030
|
3131
note: ...that is required by this bound
3232
--> $DIR/issue-86483.rs:7:16

src/test/ui/generics/issue-61631-default-type-param-can-reference-self-in-trait.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ LL | impl Tsized for () {}
66
|
77
= help: the trait `Sized` is not implemented for `[()]`
88
note: required by a bound in `Tsized`
9-
--> $DIR/issue-61631-default-type-param-can-reference-self-in-trait.rs:17:17
9+
--> $DIR/issue-61631-default-type-param-can-reference-self-in-trait.rs:17:14
1010
|
1111
LL | trait Tsized<P: Sized = [Self]> {}
12-
| ^^^^^ required by this bound in `Tsized`
12+
| ^ required by this bound in `Tsized`
1313

1414
error: aborting due to previous error
1515

src/test/ui/issues/issue-16966.stderr

+2-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
error[E0283]: type annotations needed
1+
error[E0282]: type annotations needed
22
--> $DIR/issue-16966.rs:2:5
33
|
44
LL | panic!(std::default::Default::default());
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `M` declared on the function `begin_panic`
66
|
7-
= note: cannot satisfy `_: Any`
8-
note: required by a bound in `begin_panic`
9-
--> $SRC_DIR/std/src/panicking.rs:LL:COL
10-
|
11-
LL | pub fn begin_panic<M: Any + Send>(msg: M) -> ! {
12-
| ^^^ required by this bound in `begin_panic`
137
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
14-
help: consider specifying the type argument in the function call
15-
|
16-
LL | $crate::rt::begin_panic::<M>($msg)
17-
| +++++
188

199
error: aborting due to previous error
2010

21-
For more information about this error, try `rustc --explain E0283`.
11+
For more information about this error, try `rustc --explain E0282`.

src/test/ui/issues/issue-21160.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: required by a bound in `std::hash::Hash::hash`
1010
--> $SRC_DIR/core/src/hash/mod.rs:LL:COL
1111
|
1212
LL | fn hash<H: Hasher>(&self, state: &mut H);
13-
| ^^^^^^ required by this bound in `std::hash::Hash::hash`
13+
| ^ required by this bound in `std::hash::Hash::hash`
1414
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
1515

1616
error: aborting due to previous error

src/test/ui/issues/issue-23122-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next: Next`
1+
error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next: Sized`
22
--> $DIR/issue-23122-2.rs:9:17
33
|
44
LL | type Next = <GetNext<T::Next> as Next>::Next;

src/test/ui/issues/issue-54954.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ LL | const ARR_LEN: usize = Tt::const_val::<[i8; 123]>();
1212
|
1313
= note: cannot satisfy `_: Tt`
1414
note: required by a bound in `Tt::const_val`
15-
--> $DIR/issue-54954.rs:5:27
15+
--> $DIR/issue-54954.rs:5:24
1616
|
1717
LL | const fn const_val<T: Sized>() -> usize {
18-
| ^^^^^ required by this bound in `Tt::const_val`
18+
| ^ required by this bound in `Tt::const_val`
1919

2020
error: aborting due to 2 previous errors
2121

src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ error[E0277]: the trait bound `T: Bar` is not satisfied
2020
LL | T::c::<T>();
2121
| ^^^^^^^^^ the trait `Bar` is not implemented for `T`
2222
|
23-
note: required by a bound in `Foo::c`
24-
--> $DIR/trait-where-clause.rs:9:10
23+
note: required by `Foo::c`
24+
--> $DIR/trait-where-clause.rs:9:5
2525
|
2626
LL | fn c<T: ~const Bar>();
27-
| ^ required by this bound in `Foo::c`
27+
| ^^^^^^^^^^^^^^^^^^^^^^
2828
help: consider further restricting this bound
2929
|
3030
LL | const fn test1<T: ~const Foo + Bar + Bar>() {
@@ -52,11 +52,11 @@ error[E0277]: the trait bound `T: Bar` is not satisfied
5252
LL | T::c::<T>();
5353
| ^^^^^^^^^ the trait `Bar` is not implemented for `T`
5454
|
55-
note: required by a bound in `Foo::c`
56-
--> $DIR/trait-where-clause.rs:9:10
55+
note: required by `Foo::c`
56+
--> $DIR/trait-where-clause.rs:9:5
5757
|
5858
LL | fn c<T: ~const Bar>();
59-
| ^ required by this bound in `Foo::c`
59+
| ^^^^^^^^^^^^^^^^^^^^^^
6060
help: consider further restricting this bound
6161
|
6262
LL | fn test3<T: Foo + Bar>() {

src/test/ui/suggestions/issue-84973-blacklist.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ LL | f_sized(*ref_cl);
4949
|
5050
= help: the trait `Sized` is not implemented for `dyn Fn()`
5151
note: required by a bound in `f_sized`
52-
--> $DIR/issue-84973-blacklist.rs:9:15
52+
--> $DIR/issue-84973-blacklist.rs:9:12
5353
|
5454
LL | fn f_sized<T: Sized>(t: T) {}
55-
| ^^^^^ required by this bound in `f_sized`
55+
| ^ required by this bound in `f_sized`
5656

5757
error[E0277]: `Rc<{integer}>` cannot be sent between threads safely
5858
--> $DIR/issue-84973-blacklist.rs:27:12

0 commit comments

Comments
 (0)