You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT// file at the top-level directory of this distribution and at// http://rust-lang.org/COPYRIGHT.//// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your// option. This file may not be copied, modified, or distributed// except according to those terms.#![feature(associated_consts)]structFoo;traitHasNum{constNUM:isize;}implHasNumforFoo{constNUM:isize = 1;}fnmain(){assert!(match2{
<Foo>::NUM ... 3 => true,
_ => false,});assert!(match0{
-1 ... <FooasHasNum>::NUM => true,
_ => false,});assert!(match1{
<FooasHasNum>::NUM ... <Foo>::NUM => true,
_ => false,});}
The problem here seems to have a similar or the same cause as that in #24938, namely that select is looking for a Self type in a Substs derived from a node's item_substs, but it is not finding it.
The text was updated successfully, but these errors were encountered:
…omatsakis
Closes#25046 (by rejecting the code that causes the ICE) and #24946. I haven't been able to deal with the array size or recursion issues yet for associated consts, though my hope was that the change I made for range match patterns might help with array sizes, too.
This PR is pretty much orthogonal to #25065.
Failing test case:
The problem here seems to have a similar or the same cause as that in #24938, namely that
select
is looking for aSelf
type in aSubsts
derived from a node'sitem_substs
, but it is not finding it.The text was updated successfully, but these errors were encountered: