Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
51b51b51d7931da85280382a81c4dd80c73ca754
rust/tests/ui/associated-consts/associated-const-generic-obligations.rs

19 lines
293 B
Rust
Raw Normal View History

associated_consts: check trait obligations and regionck for associated consts Closes #41323
2017-05-30 22:21:00 -07:00
trait Foo {
type Out: Sized;
}
impl Foo for String {
type Out = String;
}
trait Bar: Foo {
const FROM: Self::Out;
}
impl<T: Foo> Bar for T {
const FROM: &'static str = "foo";
Fix #54822 and associated faulty tests Type checking associated constants can require trait bounds, but an empty parameter environment was provided to the trait solver. Providing an appropriate parameter environment seems to fix #54822 and also make one of the cases in src/test/ui/nll/trait-associated-constant.rs that should compile successfully do so. It also (slightly) improves the error message in src/test/ui/associated-const/associated-const-generic-obligations.rs
2019-03-10 22:18:38 -04:00
//~^ ERROR implemented const `FROM` has an incompatible type for trait [E0326]
associated_consts: check trait obligations and regionck for associated consts Closes #41323
2017-05-30 22:21:00 -07:00
}
fn main() {}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2264ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API