Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uprustc: Add `#[rustc_args_required_const]` #48018
Conversation
rust-highfive
assigned
pnkfelix
Feb 5, 2018
This comment has been minimized.
This comment has been minimized.
|
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
|
r? @eddyb |
rust-highfive
assigned
eddyb
and unassigned
pnkfelix
Feb 5, 2018
eddyb
reviewed
Feb 5, 2018
| @@ -73,7 +73,7 @@ pub enum Candidate { | |||
|
|
|||
| /// Array of indices found in the third argument of | |||
| /// a call to one of the simd_shuffleN intrinsics. | |||
This comment has been minimized.
This comment has been minimized.
eddyb
reviewed
Feb 5, 2018
| let terminator = mir[bb].terminator(); | ||
| let ty = match terminator.kind { | ||
| TerminatorKind::Call { ref args, .. } => { | ||
| args[2].ty(mir, tcx) | ||
| args[index].ty(mir, tcx) | ||
| } | ||
| _ => { | ||
| span_bug!(terminator.source_info.span, |
This comment has been minimized.
This comment has been minimized.
alexcrichton
force-pushed the
alexcrichton:require-const-arg
branch
from
dfca1b7
to
27a4e73
Feb 5, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors: r=eddyb |
This comment has been minimized.
This comment has been minimized.
|
|
alexcrichton
referenced this pull request
Feb 5, 2018
Open
Improve handling of immediate mode arguments #248
pietroalbini
added
the
S-waiting-on-bors
label
Feb 5, 2018
This comment has been minimized.
This comment has been minimized.
|
Out of curiosity, is there a reason you decided to use argument indices rather than names, which would appear to me to be more readable and harder to get wrong? |
This comment has been minimized.
This comment has been minimized.
|
@varkor Names come from pattern-matching bindings, arguments don't (necessarily) have them. |
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Feb 7, 2018
bors
added a commit
that referenced
this pull request
Feb 7, 2018
bors
merged commit 27a4e73
into
rust-lang:master
Feb 7, 2018
1 check passed
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
alexcrichton
deleted the
alexcrichton:require-const-arg
branch
Feb 26, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
alexcrichton commentedFeb 5, 2018
This commit adds a new unstable attribute to the compiler which requires that
arguments to a function are always provided as constants. The primary use case
for this is SIMD intrinsics where arguments are defined by vendors to be
constant and in LLVM they indeed must be constant as well.
For now this is mostly just a semantic guarantee in rustc that an argument is a
constant when invoked, phases like trans don't actually take advantage of it
yet. This means that we'll be able to use this in stdsimd but we won't be able
to remove the
constify_*macros just yet. Hopefully soon though!