Skip to content

Commit b77bb5c

Browse files
committed
Update with final comments
1 parent 1c1ce2f commit b77bb5c

File tree

6 files changed

+10
-31
lines changed

6 files changed

+10
-31
lines changed

Diff for: compiler/rustc_trait_selection/src/traits/auto_trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
756756
// when we started out trying to unify
757757
// some inference variables. See the comment above
758758
// for more infomration
759-
if p.term().skip_binder().ty().has_infer_types() {
759+
if p.term().skip_binder().has_infer_types() {
760760
if !self.evaluate_nested_obligations(
761761
ty,
762762
v.into_iter(),

Diff for: compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1804,11 +1804,11 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
18041804
}
18051805
ty::PredicateKind::Projection(data) => {
18061806
let self_ty = data.projection_ty.self_ty();
1807-
let ty = data.term.ty();
1807+
let term = data.term;
18081808
if predicate.references_error() || self.is_tainted_by_errors() {
18091809
return;
18101810
}
1811-
if self_ty.needs_infer() && ty.needs_infer() {
1811+
if self_ty.needs_infer() && term.needs_infer() {
18121812
// We do this for the `foo.collect()?` case to produce a suggestion.
18131813
let mut err = self.emit_inference_failure_err(
18141814
body_id,

Diff for: compiler/rustc_trait_selection/src/traits/project.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1802,7 +1802,7 @@ fn confirm_param_env_candidate<'cx, 'tcx>(
18021802
Ok(InferOk { value: _, obligations }) => {
18031803
nested_obligations.extend(obligations);
18041804
assoc_ty_own_obligations(selcx, obligation, &mut nested_obligations);
1805-
// FIXME(...): Handle consts here as well? Maybe this progress type should just take
1805+
// FIXME(associated_const_equality): Handle consts here as well? Maybe this progress type should just take
18061806
// a term instead.
18071807
Progress { ty: cache_entry.term.ty().unwrap(), obligations: nested_obligations }
18081808
}

Diff for: compiler/rustc_typeck/src/astconv/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1403,9 +1403,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
14031403
// `trait_object_dummy_self`, so check for that.
14041404
let references_self = match pred.skip_binder().term {
14051405
ty::Term::Ty(ty) => ty.walk().any(|arg| arg == dummy_self.into()),
1406-
ty::Term::Const(c) => {
1407-
c.ty.walk().any(|arg| arg == dummy_self.into())
1408-
}
1406+
ty::Term::Const(c) => c.ty.walk().any(|arg| arg == dummy_self.into()),
14091407
};
14101408

14111409
// If the projection output contains `Self`, force the user to

Diff for: src/test/ui/associated-consts/assoc-const.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![feature(associated_const_equality)]
2+
13
pub trait Foo {
24
const N: usize;
35
}
@@ -13,9 +15,7 @@ const TEST:usize = 3;
1315

1416
fn foo<F: Foo<N=3>>() {}
1517
//~^ ERROR associated const equality is incomplete
16-
//~| ERROR associated const equality is incomplete
1718
fn bar<F: Foo<N={TEST}>>() {}
1819
//~^ ERROR associated const equality is incomplete
19-
//~| ERROR associated const equality is incomplete
2020

2121
fn main() {}

Diff for: src/test/ui/associated-consts/assoc-const.stderr

+3-22
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,14 @@
1-
error[E0658]: associated const equality is incomplete
2-
--> $DIR/assoc-const.rs:14:15
3-
|
4-
LL | fn foo<F: Foo<N=3>>() {}
5-
| ^^^
6-
|
7-
= note: see issue #92827 <https://github.com/rust-lang/rust/issues/92827> for more information
8-
= help: add `#![feature(associated_const_equality)]` to the crate attributes to enable
9-
10-
error[E0658]: associated const equality is incomplete
11-
--> $DIR/assoc-const.rs:17:15
12-
|
13-
LL | fn bar<F: Foo<N={TEST}>>() {}
14-
| ^^^^^^^^
15-
|
16-
= note: see issue #92827 <https://github.com/rust-lang/rust/issues/92827> for more information
17-
= help: add `#![feature(associated_const_equality)]` to the crate attributes to enable
18-
191
error: associated const equality is incomplete
20-
--> $DIR/assoc-const.rs:14:15
2+
--> $DIR/assoc-const.rs:16:15
213
|
224
LL | fn foo<F: Foo<N=3>>() {}
235
| ^^^ cannot yet relate associated const
246

257
error: associated const equality is incomplete
26-
--> $DIR/assoc-const.rs:17:15
8+
--> $DIR/assoc-const.rs:18:15
279
|
2810
LL | fn bar<F: Foo<N={TEST}>>() {}
2911
| ^^^^^^^^ cannot yet relate associated const
3012

31-
error: aborting due to 4 previous errors
13+
error: aborting due to 2 previous errors
3214

33-
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)