Skip to content

Commit 88f810f

Browse files
committed
inverting speculative flag
1 parent f837c34 commit 88f810f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/librustc_typeck/astconv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
568568
}
569569
tcx.check_stability(assoc_ty.def_id, Some(ref_id), binding.span);
570570

571-
if speculative {
571+
if !speculative {
572572
dup_bindings.entry(assoc_ty.def_id)
573573
.and_modify(|prev_span| {
574574
let mut err = self.tcx().struct_span_lint_node(

src/test/ui/lint/issue-50589-multiple-associated-types.stderr

+11
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,14 @@ LL | fn test() -> Box<Iterator<Item = (), Item = Unit>> {
1010
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
1111
= note: for more information, see issue #50589 <https://github.com/rust-lang/rust/issues/50589>
1212

13+
warning: associated type binding `Item` specified more than once
14+
--> $DIR/issue-50589-multiple-associated-types.rs:17:39
15+
|
16+
LL | fn test() -> Box<Iterator<Item = (), Item = Unit>> {
17+
| --------- ^^^^^^^^^^^ used more than once
18+
| |
19+
| first use of `Item`
20+
|
21+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
22+
= note: for more information, see issue #50589 <https://github.com/rust-lang/rust/issues/50589>
23+

0 commit comments

Comments
 (0)