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#115672 - GuillaumeGomez:rollup-mjiy56f, r=Gui…
…llaumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#104299 (Clarify stability guarantee for lifetimes in enum discriminants) - rust-lang#115088 (Fix Step Skipping Caused by Using the `--exclude` Option) - rust-lang#115201 (rustdoc: list matching impls on type aliases) - rust-lang#115633 (Lint node for `PRIVATE_BOUNDS`/`PRIVATE_INTERFACES` is the item which names the private type) - rust-lang#115638 (`-Cllvm-args` usability improvement) - rust-lang#115643 (fix: return early when has tainted in mir-lint) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
13 changed files
with
173 additions
and
22 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Regression test for <https://github.com/rust-lang/rust/issues/32077>. | ||
|
||
#![crate_name = "foo"] | ||
|
||
pub struct GenericStruct<T>(T); | ||
|
||
impl<T> GenericStruct<T> { | ||
pub fn on_gen(arg: T) {} | ||
} | ||
|
||
impl GenericStruct<u32> { | ||
pub fn on_u32(arg: u32) {} | ||
} | ||
|
||
pub trait Foo {} | ||
pub trait Bar {} | ||
|
||
impl<T> Foo for GenericStruct<T> {} | ||
impl Bar for GenericStruct<u32> {} | ||
|
||
// @has 'foo/type.TypedefStruct.html' | ||
// We check that we have the implementation of the type alias itself. | ||
// @has - '//*[@id="impl-TypedefStruct"]/h3' 'impl TypedefStruct' | ||
// @has - '//*[@id="method.on_alias"]/h4' 'pub fn on_alias()' | ||
// @has - '//*[@id="impl-GenericStruct%3CT%3E"]/h3' 'impl<T> GenericStruct<T>' | ||
// @has - '//*[@id="method.on_gen"]/h4' 'pub fn on_gen(arg: T)' | ||
// @has - '//*[@id="impl-Foo-for-GenericStruct%3CT%3E"]/h3' 'impl<T> Foo for GenericStruct<T>' | ||
// This trait implementation doesn't match the type alias parameters so shouldn't appear in docs. | ||
// @!has - '//h3' 'impl Bar for GenericStruct<u32> {}' | ||
// Same goes for the `Deref` impl. | ||
// @!has - '//h2' 'Methods from Deref<Target = u32>' | ||
pub type TypedefStruct = GenericStruct<u8>; | ||
|
||
impl TypedefStruct { | ||
pub fn on_alias() {} | ||
} | ||
|
||
impl std::ops::Deref for GenericStruct<u32> { | ||
type Target = u32; | ||
|
||
fn deref(&self) -> &Self::Target { | ||
&self.0 | ||
} | ||
} | ||
|
||
pub struct Wrap<T>(GenericStruct<T>); | ||
|
||
// @has 'foo/type.Alias.html' | ||
// @has - '//h2' 'Methods from Deref<Target = u32>' | ||
// @has - '//*[@id="impl-Deref-for-Wrap%3CT%3E"]/h3' 'impl<T> Deref for Wrap<T>' | ||
pub type Alias = Wrap<u32>; | ||
|
||
impl<T> std::ops::Deref for Wrap<T> { | ||
type Target = GenericStruct<T>; | ||
|
||
fn deref(&self) -> &Self::Target { | ||
&self.0 | ||
} | ||
} |
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,7 @@ | ||
// check-pass | ||
// compile-flags: --crate-type=lib | ||
|
||
#[allow(private_bounds)] | ||
pub trait Foo: FooImpl {} | ||
|
||
trait FooImpl {} |
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,11 @@ | ||
// compile-flags: --emit link | ||
|
||
fn main() { | ||
let a: [i32; 0] = []; | ||
match [a[..]] { | ||
//~^ ERROR cannot move a value of type `[i32] | ||
//~| ERROR cannot move out of type `[i32]`, a non-copy slice | ||
[[]] => (), | ||
_ => (), | ||
} | ||
} |
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,19 @@ | ||
error[E0161]: cannot move a value of type `[i32]` | ||
--> $DIR/issue-115203.rs:5:12 | ||
| | ||
LL | match [a[..]] { | ||
| ^^^^^ the size of `[i32]` cannot be statically determined | ||
|
||
error[E0508]: cannot move out of type `[i32]`, a non-copy slice | ||
--> $DIR/issue-115203.rs:5:12 | ||
| | ||
LL | match [a[..]] { | ||
| ^^^^^ | ||
| | | ||
| cannot move out of here | ||
| move occurs because value has type `[i32]`, which does not implement the `Copy` trait | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0161, E0508. | ||
For more information about an error, try `rustc --explain E0161`. |