diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-11-13 16:06:28 -0800 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-05 13:30:08 -0500 |
| commit | 3bd39840cb2b74661eddedc600fd39ad77feb2cc (patch) | |
| tree | 83ddcee9694446414e402984fd89f6887c5fa274 /src/test/ui/issues | |
| parent | 9788354fffa92cbd0e277334842b0f7872a8bd55 (diff) | |
| download | rust-3bd39840cb2b74661eddedc600fd39ad77feb2cc.tar.gz rust-3bd39840cb2b74661eddedc600fd39ad77feb2cc.zip | |
Do not ICE on trait aliases with missing obligations
Diffstat (limited to 'src/test/ui/issues')
| -rw-r--r-- | src/test/ui/issues/issue-65673.rs | 12 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-65673.stderr | 17 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-65673.rs b/src/test/ui/issues/issue-65673.rs new file mode 100644 index 00000000000..ea1d70194b1 --- /dev/null +++ b/src/test/ui/issues/issue-65673.rs @@ -0,0 +1,12 @@ +#![feature(trait_alias)] +trait Trait {} +trait WithType { + type Ctx; +} +trait Alias<T> = where T: Trait; + +impl<T> WithType for T { + type Ctx = dyn Alias<T>; +//~^ ERROR the size for values of type `(dyn Trait + 'static)` cannot be known at compilation time +} +fn main() {} diff --git a/src/test/ui/issues/issue-65673.stderr b/src/test/ui/issues/issue-65673.stderr new file mode 100644 index 00000000000..a556e35b6a9 --- /dev/null +++ b/src/test/ui/issues/issue-65673.stderr @@ -0,0 +1,17 @@ +error[E0277]: the size for values of type `(dyn Trait + 'static)` cannot be known at compilation time + --> $DIR/issue-65673.rs:9:5 + | +LL | type Ctx; + | --- associated type defined here +... +LL | impl<T> WithType for T { + | ---------------------- in this `impl` item +LL | type Ctx = dyn Alias<T>; + | ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `(dyn Trait + 'static)` + = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. |
