bors
367e783e6f
Auto merge of #56557 - pietroalbini:rollup, r=pietroalbini
...
Rollup of 11 pull requests
Successful merges:
- #56315 (Rustdoc inline macro reexport)
- #56332 ([rustdoc] Specific crate search)
- #56362 (Stabilise exhaustive integer patterns)
- #56426 (libsyntax_pos: A few tweaks)
- #56441 (rustbuild: Fix issues with compiler docs)
- #56446 (pass the parameter environment to `traits::find_associated_item`)
- #56500 (cleanup: remove static lifetimes from consts)
- #56525 (Avoid extra copy and syscall in std::env::current_exe)
- #56528 (Remove unused dependency (rustc_lint -> rustc_mir))
- #56548 (Optimized string FromIterator + Extend impls)
- #56553 (Don't print the profiling summary to stdout when -Zprofile-json is set)
Failed merges:
r? @ghost
2018-12-06 12:41:30 +00:00
bors
128a1fa4e1
Auto merge of #55635 - oli-obk:min_const_unsafe_fn, r=nikomatsakis
...
Allow calling `const unsafe fn` in `const fn` behind a feature gate
cc #55607
r? @Centril
2018-12-06 10:18:17 +00:00
Pietro Albini
e57ed0ddab
Rollup merge of #56362 - varkor:stabilise-exhaustive-integer-patterns, r=nikomatsakis
...
Stabilise exhaustive integer patterns
This is dependent on the FCP for https://github.com/rust-lang/rfcs/pull/2591 being completed, but that should happen tomorrow, so there's little harm in opening this PR early.
Closes #50907 .
2018-12-06 07:48:52 +01:00
Oliver Scherer
f4115765c5
Intrinsic checks are just needed for qualify_min_const_fn
2018-12-04 10:17:37 +01:00
Oliver Scherer
ae0b00cada
Add and update tests
2018-12-04 10:17:37 +01:00
Oliver Scherer
4497ff3762
Emit feature gate suggestion
2018-12-04 10:17:36 +01:00
Oliver Scherer
02b22323f1
Make sure the initialization of constrained int range newtypes is unsafe
2018-12-04 10:17:36 +01:00
Oliver Scherer
cc3470ce3b
Add test for dereferencing raw pointers and immediately referencing again
2018-12-04 10:17:36 +01:00
Oliver Scherer
f2ae7b78d6
Allow calling const unsafe fn in const fn behind a feature gate
2018-12-04 10:17:36 +01:00
Oliver Scherer
61efc3b71b
Update tests
2018-12-04 10:06:05 +01:00
varkor
4fc5758a67
Update existing tests with more precise error messages
2018-11-30 13:53:15 +00:00
Philipp Hansch
9b847f0f96
Fix const_fn ICE with non-const function pointer
2018-11-30 08:43:50 +01:00
bors
b51632e3f0
Auto merge of #56070 - oli-obk:const_let, r=eddyb
...
Allow assignments in const contexts
fixes https://github.com/rust-lang/rust/issues/54098
fixes https://github.com/rust-lang/rust/issues/51251
fixes https://github.com/rust-lang/rust/issues/52613
2018-11-26 08:17:36 +00:00
Pietro Albini
d21d510dde
Rollup merge of #56207 - SimonSapin:int_to_from_bytes, r=nagisa
...
Stabilize the int_to_from_bytes feature
Fixes #52963
FCP to merge completed: https://github.com/rust-lang/rust/issues/52963#issuecomment-416548327
2018-11-25 17:05:10 +01:00
Pietro Albini
1aa3ffaf99
Rollup merge of #56024 - oli-obk:const_fn_collect_inner, r=michaelwoerister
...
Don't auto-inline const functions
fixes #53451
2018-11-25 17:04:57 +01:00
Simon Sapin
68a26ec647
Stabilize the int_to_from_bytes feature
...
Fixes #52963
2018-11-25 08:29:01 +01:00
Oliver Scherer
b820cc79a9
Clean up array/slice of primitive validation
2018-11-24 11:36:32 +01:00
Oliver Scherer
87bd5d13d8
Remove stderr file, because the test passes now
2018-11-24 11:36:32 +01:00
Oliver Scherer
ef332959dc
Reintroduce zst-slice reading read_bytes method on Memory
2018-11-24 11:36:32 +01:00
Oliver Scherer
ebf03363f2
Properly test for int pointers in fat pointers to str slices of zero chars
2018-11-24 11:36:31 +01:00
Oliver Scherer
20dee47a66
Add regression test for integral pointers in zst str slice fat pointers
2018-11-24 11:36:31 +01:00
bors
6612100de5
Auto merge of #56065 - oli-obk:min_const_fn_loop_ice, r=davidtwco
...
Replace the ICEing on const fn loops with an error
fixes #56035
2018-11-21 23:24:15 +00:00
Oliver Scherer
6db8c6c6d9
Explain why we do not overwrite qualification of locals
2018-11-21 11:58:28 +01:00
Oliver Scherer
22aebd57c8
Add regression test for overwriting qualifs by assignment
2018-11-21 11:47:44 +01:00
Oliver Scherer
e05b61ccd8
Fix a comment
2018-11-21 11:47:16 +01:00
Oliver Scherer
42a3f730c7
Tidy
2018-11-21 11:13:49 +01:00
Oliver Scherer
3c290a5326
Ensure assignments don't allow skipping projection checks
2018-11-21 10:42:40 +01:00
Oliver Scherer
301ce8b2aa
Properly assign to aggregate fields
2018-11-21 10:37:18 +01:00
Oliver Scherer
3e081c7e82
Trailing newline
2018-11-20 12:28:24 +01:00
Oliver Scherer
f70abe8d07
Add sanity test for promotion and const_let
2018-11-20 11:33:46 +01:00
Oliver Scherer
6bcb0d6152
Explain missing error in test
2018-11-20 11:33:27 +01:00
Ralf Jung
c462e44c13
we now do proper validation on scalars
2018-11-19 23:02:28 +01:00
Ralf Jung
b50c1b243e
Make const_eval_raw query return just an AllocId
2018-11-19 22:42:46 +01:00
Oliver Scherer
59eff14120
Also catch static mutation at evaluation time
2018-11-19 16:46:03 +01:00
kennytm
8cea658b90
Rollup merge of #56059 - alexcrichton:fix-tests, r=sfackler
...
Increase `Duration` approximate equal threshold to 1us
Previously this threshold when testing was 100ns, but the Windows
documentation states:
> which is a high resolution (<1us) time stamp
which presumably means that we could have up to 1us resolution, which
means that 100ns doesn't capture "equivalent" time intervals due to
various bits of rounding here and there.
It's hoped that this..
Closes #56034
2018-11-19 22:06:45 +08:00
Pietro Albini
c0d48ce39a
Rollup merge of #56007 - RalfJung:non-const-call, r=oli-obk
...
CTFE: dynamically make sure we do not call non-const-fn
I'd love to have a test case for this, but I don't know how.
I am also really surprised by this test case that changed behavior: Why did it even start execution if it already determined that it shouldn't?!?
r? @oli-obk
2018-11-19 22:06:32 +08:00
Oliver Scherer
bc543d7e6c
Allow assignments in const contexts
2018-11-19 11:19:14 +01:00
Oliver Scherer
8ee9711a6c
Replace the ICEing on const fn loops with an error
2018-11-19 10:40:09 +01:00
bors
a9b791b3c0
Auto merge of #55672 - RalfJung:miri-extern-types, r=eddyb
...
miri: accept extern types in structs if they are the only field
Fixes https://github.com/rust-lang/rust/issues/55541
Cc @oli-obk @eddyb https://github.com/rust-lang/rust/issues/43467
2018-11-18 22:19:53 +00:00
Oliver Scherer
eb18ddd8f4
Don't auto-inline const fn
2018-11-17 17:50:37 +01:00
Ralf Jung
303dbccf04
CTFE: dynamically make sure we do not call non-const-fn
2018-11-16 18:05:08 +01:00
Ralf Jung
a3770c2547
do not accept out-of-bounds pointers in enum discriminants, they might be NULL
2018-11-15 10:59:39 +01:00
Ralf Jung
ffb6ba0828
validation: better error when the enum discriminant is Undef
2018-11-15 09:58:09 +01:00
bors
485397e49a
Auto merge of #55589 - oli-obk:min_length_ 💣 , r=pnkfelix
...
Add `VariantIdx` type and use instead of `usize`
2018-11-13 07:04:14 +00:00
bors
65204a97d4
Auto merge of #55278 - Centril:constification-1, r=alexcrichton
...
Minor standard library constification
This PR makes some bits of the standard library into `const fn`s.
I've tried to be as aggressive as I possibly could in the constification.
The list is rather small due to how restrictive `const fn` is at the moment.
r? @oli-obk cc @rust-lang/libs
Stable public APIs affected:
+ [x] `Cell::as_ptr`
+ [x] `UnsafeCell::get`
+ [x] `char::is_ascii`
+ [x] `iter::empty`
+ [x] `ManuallyDrop::{new, into_inner}`
+ [x] `RangeInclusive::{start, end}`
+ [x] `NonNull::as_ptr`
+ [x] `{[T], str}::as_ptr`
+ [x] `Duration::{as_secs, subsec_millis, subsec_micros, subsec_nanos}`
+ [x] `CStr::as_ptr`
+ [x] `Ipv4Addr::is_unspecified`
+ [x] `Ipv6Addr::new`
+ [x] `Ipv6Addr::octets`
Unstable public APIs affected:
+ [x] `Duration::{as_millis, as_micros, as_nanos, as_float_secs}`
+ [x] `Wrapping::{count_ones, count_zeros, trailing_zeros, rotate_left, rotate_right, swap_bytes, reverse_bits, from_be, from_le, to_be, to_le, leading_zeros, is_positive, is_negative, leading_zeros}`
+ [x] `core::convert::identity`
--------------------------
## Removed from list in first pass:
Stable public APIs affected:
+ [ ] `BTree{Map, Set}::{len, is_empty}`
+ [ ] `VecDeque::is_empty`
+ [ ] `String::{is_empty, len}`
+ [ ] `FromUtf8Error::utf8_error`
+ [ ] `Vec<T>::{is_empty, len}`
+ [ ] `Layout::size`
+ [ ] `DecodeUtf16Error::unpaired_surrogate`
+ [ ] `core::fmt::{fill, width, precision, sign_plus, sign_minus, alternate, sign_aware_zero_pad}`
+ [ ] `panic::Location::{file, line, column}`
+ [ ] `{ChunksExact, RChunksExact}::remainder`
+ [ ] `Utf8Error::valid_up_to`
+ [ ] `VacantEntry::key`
+ [ ] `NulError::nul_position`
+ [ ] `IntoStringError::utf8_error`
+ [ ] `IntoInnerError::error`
+ [ ] `io::Chain::get_ref`
+ [ ] `io::Take::{limit, get_ref}`
+ [ ] `SocketAddrV6::{flowinfo, scope_id}`
+ [ ] `PrefixComponent::{kind, as_os_str}`
+ [ ] `Path::{ancestors, display}`
+ [ ] `WaitTimeoutResult::timed_out`
+ [ ] `Receiver::{iter, try_iter}`
+ [ ] `thread::JoinHandle::thread`
+ [ ] `SystemTimeError::duration`
Unstable public APIs affected:
+ [ ] `core::fmt::Arguments::new_v1`
+ [ ] `core::fmt::Arguments::new_v1_formatted`
+ [ ] `Pin::{get_ref, into_ref}`
+ [ ] `Utf8Lossy::chunks`
+ [ ] `LocalWaker::as_waker`
+ [ ] `panic::PanicInfo::{internal_constructor, message, location}`
+ [ ] `panic::Location::{internal_constructor }`
## Removed from list in 2nd pass:
Stable public APIs affected:
+ [ ] `LinkedList::{new, iter, is_empty, len}`
+ [ ] `mem::forget`
+ [ ] `Cursor::{new, get_ref, position}`
+ [ ] `io::{empty, repeat, sink}`
+ [ ] `PoisonError::new`
+ [ ] `thread::Builder::new`
+ [ ] `process::Stdio::{piped, inherit, null}`
Unstable public APIs affected:
+ [ ] `io::Initializer::{zeroing, should_initialize}`
2018-11-12 18:54:11 +00:00
Oliver Scherer
b174b0b955
miri-engine value visitor update to VariantIdx
2018-11-12 14:24:45 +01:00
Pietro Albini
0f1c1eb480
Rollup merge of #55828 - oli-obk:promotion_strikes_again, r=eddyb
...
Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`
cc @pnkfelix
fixes #55806
2018-11-11 00:21:23 +01:00
Pietro Albini
e121305abd
Rollup merge of #55792 - oli-obk:propsicle, r=RalfJung
...
Prevent ICE in const-prop array oob check
fixes https://github.com/rust-lang/rust/issues/55772
fixes https://github.com/rust-lang/rust/issues/54541
2018-11-11 00:21:14 +01:00
Mazdak Farrokhzad
ac1c6b0378
adjust ui/../mod-static-with-const-fn.rs
2018-11-10 02:36:19 +01:00
Oliver Scherer
c8e23d8c4c
Tidy ♪ all ♪ the ♪ way ♪♪♪♪ with ♪ a ♪ newline ♪ missing ♪ cry ♪♪
2018-11-10 01:11:06 +01:00