-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Advent of tests/ui
(misc cleanups and improvements) [4/N]
#140036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
...gmented-assignments-feature-gate-cross.rs → ...inop/augmented-assignments-cross-crate.rs
This file contains hidden or 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
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
tests/ui/augmented-assignments.rs → tests/ui/borrowck/augmented-assignments.rs
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
//! Check that type parameters in generic function arg position and in "nested" return type position | ||
//! can be inferred on an invocation of the generic function. | ||
//! | ||
//! See <https://github.com/rust-lang/rust/issues/45>. | ||
|
||
//@ run-pass | ||
|
||
#![allow(dead_code)] | ||
#[derive(Debug)] | ||
struct Pair<T, U> { | ||
a: T, | ||
b: U, | ||
} | ||
|
||
struct Triple { | ||
x: isize, | ||
y: isize, | ||
z: isize, | ||
} | ||
|
||
fn f<T, U>(x: T, y: U) -> Pair<T, U> { | ||
return Pair { a: x, b: y }; | ||
} | ||
|
||
pub fn main() { | ||
println!("{}", f(Triple {x: 3, y: 4, z: 5}, 4).a.x); | ||
println!("{}", f(5, 6).a); | ||
} | ||
File renamed without changes.
This file contains hidden or 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,4 @@ | ||
error: target requires explicitly specifying a cpu with `-C target-cpu` | ||
|
||
error: aborting due to 1 previous error | ||
|
This file contains hidden or 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,37 @@ | ||
//! Check that certain target *requires* the user to specify a target CPU via `-C target-cpu`. | ||
|
||
//@ revisions: amdgcn_nocpu amdgcn_cpu | ||
|
||
//@[amdgcn_nocpu] compile-flags: --target=amdgcn-amd-amdhsa | ||
//@[amdgcn_nocpu] needs-llvm-components: amdgpu | ||
//@[amdgcn_nocpu] build-fail | ||
|
||
//@[amdgcn_cpu] compile-flags: --target=amdgcn-amd-amdhsa | ||
//@[amdgcn_cpu] needs-llvm-components: amdgpu | ||
//@[amdgcn_cpu] compile-flags: -Ctarget-cpu=gfx900 | ||
//@[amdgcn_cpu] build-pass | ||
|
||
//@ revisions: avr_nocpu avr_cpu | ||
|
||
//@[avr_nocpu] compile-flags: --target=avr-none | ||
//@[avr_nocpu] needs-llvm-components: avr | ||
//@[avr_nocpu] build-fail | ||
|
||
//@[avr_cpu] compile-flags: --target=avr-none | ||
//@[avr_cpu] needs-llvm-components: avr | ||
//@[avr_cpu] compile-flags: -Ctarget-cpu=atmega328p | ||
//@[avr_cpu] build-pass | ||
|
||
#![crate_type = "rlib"] | ||
|
||
// FIXME(#140038): this can't use `minicore` yet because `minicore` doesn't currently propagate the | ||
// `-C target-cpu` for targets that *require* a `target-cpu` being specified. | ||
#![feature(no_core, lang_items)] | ||
#![no_core] | ||
|
||
#[lang="sized"] | ||
trait Sized {} | ||
|
||
pub fn foo() {} | ||
|
||
//[amdgcn_nocpu,avr_nocpu]~? ERROR target requires explicitly specifying a cpu with `-C target-cpu` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion: this test is also kinda exercising a bunch of things tho -- e.g. I think it also exercises
{integer} -> isize
coercion. Thatreturn Pair { a: x, b: y };
can also be materially different fromPair { a: x, b: y }
in terms of which HIR typeck path we take. lmw if u have a better wording for the intention of this test.