-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #86757 - JohnTitor:rollup-acevhz7, r=JohnTitor
Rollup of 8 pull requests Successful merges: - #85504 (the foundation owns rust trademarks) - #85520 (Fix typo and improve documentation for E0632) - #86680 (Improve error for missing -Z with debugging option) - #86728 (Check node kind to avoid ICE in `check_expr_return()`) - #86740 (copy rust-lld as ld in dist) - #86746 (Fix rustdoc query type filter) - #86750 (Test cross-crate usage of `feature(const_trait_impl)`) - #86755 (alloc: `RawVec<T, A>::shrink` can be in `no_global_oom_handling`.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
30 changed files
with
258 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
An explicit generic argument was provided when calling a function that | ||
uses `impl Trait` in argument position. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0632 | ||
fn foo<T: Copy>(a: T, b: impl Clone) {} | ||
foo::<i32>(0i32, "abc".to_string()); | ||
``` | ||
|
||
Either all generic arguments should be inferred at the call site, or | ||
the function definition should use an explicit generic type parameter | ||
instead of `impl Trait`. Example: | ||
|
||
``` | ||
fn foo<T: Copy>(a: T, b: impl Clone) {} | ||
fn bar<T: Copy, U: Clone>(a: T, b: U) {} | ||
foo(0i32, "abc".to_string()); | ||
bar::<i32, String>(0i32, "abc".to_string()); | ||
bar::<_, _>(0i32, "abc".to_string()); | ||
bar(0i32, "abc".to_string()); | ||
``` |
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,12 @@ | ||
// exact-check | ||
|
||
const QUERY = 'macro:print'; | ||
|
||
const EXPECTED = { | ||
'others': [ | ||
{ 'path': 'std', 'name': 'print' }, | ||
{ 'path': 'std', 'name': 'eprint' }, | ||
{ 'path': 'std', 'name': 'println' }, | ||
{ 'path': 'std', 'name': 'eprintln' }, | ||
], | ||
}; |
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
1 change: 1 addition & 0 deletions
1
src/test/ui/invalid-compile-flags/codegen-option-without-group.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 @@ | ||
// compile-flags: --llvm-args |
2 changes: 2 additions & 0 deletions
2
src/test/ui/invalid-compile-flags/codegen-option-without-group.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,2 @@ | ||
error: Unrecognized option: 'llvm-args'. Did you mean `-C llvm-args`? | ||
|
1 change: 1 addition & 0 deletions
1
src/test/ui/invalid-compile-flags/debug-option-without-group.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 @@ | ||
// compile-flags: --unpretty=hir |
2 changes: 2 additions & 0 deletions
2
src/test/ui/invalid-compile-flags/debug-option-without-group.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,2 @@ | ||
error: Unrecognized option: 'unpretty'. Did you mean `-Z unpretty`? | ||
|
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
22 changes: 22 additions & 0 deletions
22
src/test/ui/rfc-2632-const-trait-impl/auxiliary/cross-crate.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,22 @@ | ||
#![feature(const_trait_impl)] | ||
#![allow(incomplete_features)] | ||
|
||
pub trait MyTrait { | ||
fn func(self); | ||
} | ||
|
||
pub struct NonConst; | ||
|
||
impl MyTrait for NonConst { | ||
fn func(self) { | ||
|
||
} | ||
} | ||
|
||
pub struct Const; | ||
|
||
impl const MyTrait for Const { | ||
fn func(self) { | ||
|
||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/test/ui/rfc-2632-const-trait-impl/cross-crate-feature-disabled.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,18 @@ | ||
// aux-build: cross-crate.rs | ||
extern crate cross_crate; | ||
|
||
use cross_crate::*; | ||
|
||
fn non_const_context() { | ||
NonConst.func(); | ||
Const.func(); | ||
} | ||
|
||
const fn const_context() { | ||
NonConst.func(); | ||
//~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
Const.func(); | ||
//~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
} | ||
|
||
fn main() {} |
15 changes: 15 additions & 0 deletions
15
src/test/ui/rfc-2632-const-trait-impl/cross-crate-feature-disabled.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,15 @@ | ||
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
--> $DIR/cross-crate-feature-disabled.rs:12:5 | ||
| | ||
LL | NonConst.func(); | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
--> $DIR/cross-crate-feature-disabled.rs:14:5 | ||
| | ||
LL | Const.func(); | ||
| ^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0015`. |
20 changes: 20 additions & 0 deletions
20
src/test/ui/rfc-2632-const-trait-impl/cross-crate-feature-enabled.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,20 @@ | ||
#![feature(const_trait_impl)] | ||
#![allow(incomplete_features)] | ||
|
||
// aux-build: cross-crate.rs | ||
extern crate cross_crate; | ||
|
||
use cross_crate::*; | ||
|
||
fn non_const_context() { | ||
NonConst.func(); | ||
Const.func(); | ||
} | ||
|
||
const fn const_context() { | ||
NonConst.func(); | ||
//~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
Const.func(); | ||
} | ||
|
||
fn main() {} |
9 changes: 9 additions & 0 deletions
9
src/test/ui/rfc-2632-const-trait-impl/cross-crate-feature-enabled.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,9 @@ | ||
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants | ||
--> $DIR/cross-crate-feature-enabled.rs:15:5 | ||
| | ||
LL | NonConst.func(); | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0015`. |
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,9 @@ | ||
error[E0572]: return statement outside of function body | ||
--> $DIR/issue-86721-return-expr-ice.rs:9:22 | ||
| | ||
LL | const U: usize = return; | ||
| ^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0572`. |
Oops, something went wrong.