Auto merge of #38925 - petrochenkov:varass, r=jseyfried
Fix ICE when variant is used as a part of associated path Fixes https://github.com/rust-lang/rust/issues/38862 r? @jseyfried
This commit is contained in:
commit
0d03d51cc0
3 changed files with 24 additions and 5 deletions
17
src/test/compile-fail/resolve-variant-assoc-item.rs
Normal file
17
src/test/compile-fail/resolve-variant-assoc-item.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2016 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.
|
||||
|
||||
enum E { V }
|
||||
use E::V;
|
||||
|
||||
fn main() {
|
||||
E::V::associated_item; //~ ERROR failed to resolve. Not a module `V`
|
||||
V::associated_item; //~ ERROR failed to resolve. Not a module `V`
|
||||
}
|
||||
|
|
@ -55,9 +55,9 @@ fn main() {
|
|||
<u8 as E::N>::NN; //~ ERROR unresolved method or associated constant `E::N::NN`
|
||||
<u8 as A::N>::NN; //~ ERROR unresolved method or associated constant `A::N::NN`
|
||||
let _: <u8 as Tr::Y>::NN; //~ ERROR unresolved associated type `Tr::Y::NN`
|
||||
let _: <u8 as E::Y>::NN; //~ ERROR unresolved associated type `E::Y::NN`
|
||||
let _: <u8 as E::Y>::NN; //~ ERROR failed to resolve. Not a module `Y`
|
||||
<u8 as Tr::Y>::NN; //~ ERROR unresolved method or associated constant `Tr::Y::NN`
|
||||
<u8 as E::Y>::NN; //~ ERROR unresolved method or associated constant `E::Y::NN`
|
||||
<u8 as E::Y>::NN; //~ ERROR failed to resolve. Not a module `Y`
|
||||
|
||||
let _: <u8 as Dr>::Z; //~ ERROR expected associated type, found method `Dr::Z`
|
||||
<u8 as Dr>::X; //~ ERROR expected method or associated constant, found associated type `Dr::X`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue