forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#112914 - matthiaskrgr:rollup-f0kdqh9, r=matth…
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#112876 (Don't substitute a GAT that has mismatched generics in `OpaqueTypeCollector`) - rust-lang#112906 (rustdoc: render the body of associated types before the where-clause) - rust-lang#112907 (Update cargo) - rust-lang#112908 (Print def_id on EarlyBoundRegion debug) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
13 changed files
with
207 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule cargo
updated
6 files
+1 −1 | src/bin/cargo/cli.rs | |
+5 −10 | src/bin/cargo/commands/run.rs | |
+29 −16 | src/cargo/util/command_prelude.rs | |
+5 −2 | src/cargo/util/toml/mod.rs | |
+5 −2 | src/doc/src/reference/unstable.md | |
+478 −0 | tests/testsuite/script.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#![feature(impl_trait_in_assoc_type)] | ||
|
||
// We weren't checking that the trait and impl generics line up in the | ||
// normalization-shortcut code in `OpaqueTypeCollector`. | ||
|
||
use std::ops::Deref; | ||
|
||
trait Foo { | ||
type Bar<'a>; | ||
|
||
type Baz<'a>; | ||
|
||
fn test<'a>() -> Self::Bar<'a>; | ||
} | ||
|
||
impl Foo for () { | ||
type Bar<'a> = impl Deref<Target = Self::Baz<'a>>; | ||
|
||
type Baz<T> = impl Sized; | ||
//~^ ERROR type `Baz` has 1 type parameter but its trait declaration has 0 type parameters | ||
//~| ERROR unconstrained opaque type | ||
|
||
fn test<'a>() -> Self::Bar<'a> { | ||
&() | ||
} | ||
} | ||
|
||
fn main() {} |
20 changes: 20 additions & 0 deletions
20
tests/ui/type-alias-impl-trait/impl-trait-in-type-alias-with-bad-substs.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error[E0049]: type `Baz` has 1 type parameter but its trait declaration has 0 type parameters | ||
--> $DIR/impl-trait-in-type-alias-with-bad-substs.rs:19:14 | ||
| | ||
LL | type Baz<'a>; | ||
| -- expected 0 type parameters | ||
... | ||
LL | type Baz<T> = impl Sized; | ||
| ^ found 1 type parameter | ||
|
||
error: unconstrained opaque type | ||
--> $DIR/impl-trait-in-type-alias-with-bad-substs.rs:19:19 | ||
| | ||
LL | type Baz<T> = impl Sized; | ||
| ^^^^^^^^^^ | ||
| | ||
= note: `Baz` must be used in combination with a concrete type within the same impl | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0049`. |
33 changes: 33 additions & 0 deletions
33
tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#![feature(impl_trait_in_assoc_type)] | ||
|
||
trait Foo<T> { | ||
type Assoc; | ||
|
||
fn test() -> u32; | ||
} | ||
|
||
struct DefinesOpaque; | ||
impl Foo<DefinesOpaque> for () { | ||
type Assoc = impl Sized; | ||
|
||
// This test's return type is `u32`, *not* the opaque that is defined above. | ||
// Previously we were only checking that the self type of the assoc matched, | ||
// but this doesn't account for other impls with different trait substs. | ||
fn test() -> <() as Foo<NoOpaques>>::Assoc { | ||
let _: <Self as Foo<DefinesOpaque>>::Assoc = ""; | ||
//~^ ERROR mismatched types | ||
|
||
1 | ||
} | ||
} | ||
|
||
struct NoOpaques; | ||
impl Foo<NoOpaques> for () { | ||
type Assoc = u32; | ||
|
||
fn test() -> u32 { | ||
1 | ||
} | ||
} | ||
|
||
fn main() {} |
22 changes: 22 additions & 0 deletions
22
tests/ui/type-alias-impl-trait/not-matching-trait-refs-isnt-defining.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/not-matching-trait-refs-isnt-defining.rs:17:54 | ||
| | ||
LL | type Assoc = impl Sized; | ||
| ---------- the expected opaque type | ||
... | ||
LL | let _: <Self as Foo<DefinesOpaque>>::Assoc = ""; | ||
| ----------------------------------- ^^ expected opaque type, found `&str` | ||
| | | ||
| expected due to this | ||
| | ||
= note: expected opaque type `<() as Foo<DefinesOpaque>>::Assoc` | ||
found reference `&'static str` | ||
note: this item must have the opaque type in its signature in order to be able to register hidden types | ||
--> $DIR/not-matching-trait-refs-isnt-defining.rs:16:5 | ||
| | ||
LL | fn test() -> <() as Foo<NoOpaques>>::Assoc { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |