Oliver Scherer
6ed596ebe2
Update tests to changes on master
2018-12-21 13:39:45 +01:00
Oliver Scherer
b9d74fc3ce
Also test projections
2018-12-21 11:27:29 +01:00
Oliver Scherer
f8e508cde4
Fix a recently introduces regression
2018-12-21 11:27:29 +01:00
bors
3f7c718926
Auto merge of #54125 - varkor:less-conservative-uninhabitedness-check, r=nikomatsakis
...
Less conservative uninhabitedness check
Extends the uninhabitedness check to structs, non-empty enums, tuples and arrays.
Pulled out of #47291 and #50262 .
Fixes https://github.com/rust-lang/rust/issues/54586 .
r? @nikomatsakis
2018-12-20 22:04:21 +00:00
bors
cb84844e83
Auto merge of #56160 - oli-obk:const_fn_let, r=nikomatsakis
...
Fix various aspects around `let` bindings inside const functions
* forbid `let` bindings in const contexts that use short circuiting operators
* harden analysis code against derefs of mutable references
Initially this PR was about stabilizing `let` bindings, but too many flaws were exposed that need some more testing on nightly
2018-12-18 14:21:07 +00:00
Oliver Scherer
d815e2b870
Explain that lack of short circuiting support in constants is temporary
2018-12-18 09:42:46 +01:00
Oliver Scherer
b678238070
Properly worded diagnostic message
2018-12-18 09:16:56 +01:00
varkor
2ba3e66fa6
Update tests
2018-12-11 12:19:23 +00:00
varkor
4d8a6eac39
Fix some misbehaving tests
2018-12-11 11:18:55 +00:00
varkor
cb4bd5a22c
Update ub-uninhabit tests
2018-12-11 11:18:55 +00:00
varkor
6e5e54f735
Use unions for uninhabitedness checking rather than mem::transmute
2018-12-11 11:18:55 +00:00
varkor
419d2d8f31
Update const eval uninhabited messages
2018-12-11 11:18:55 +00:00
Oliver Scherer
8d0b64f16d
Make const unsafe fn bodies unsafe
2018-12-11 10:27:00 +01:00
Alexander Regueiro
003c5b796e
Fixed nll stderr file.
2018-12-08 03:17:54 +00:00
Alexander Regueiro
ee89c088b0
Various minor/cosmetic improvements to code
2018-12-07 23:53:34 +00:00
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
Oliver Scherer
9d2f97be78
Test float assign ops
2018-11-30 09:44:16 +01:00
Oliver Scherer
16d2a92b3d
Improve the diagnostic message
2018-11-30 09:44:15 +01:00
Oliver Scherer
8937faa837
Reenable const_let feature gate
2018-11-30 09:44:15 +01:00
Oliver Scherer
866664c8bb
Add a test for single variant matches
2018-11-30 09:44:06 +01:00
Oliver Scherer
d8ece188b8
Improve the error around short circuiting and let bindings
2018-11-30 09:44:06 +01:00
Oliver Scherer
d62bcad38d
Allow let bindings everywhere
2018-11-30 09:44:06 +01:00
Oliver Scherer
7ec3c10d7e
Add tests for mutable borrows
2018-11-30 09:43:41 +01:00
Oliver Scherer
ef38afc83d
Add a test for various const let features
2018-11-30 09:43:41 +01:00
Oliver Scherer
52b67b1766
Remove a bunch of now-unnecessary const_let feature gates
2018-11-30 09:43:41 +01:00
Oliver Scherer
4d2bed9460
Stabilize const_let inside const functions
2018-11-30 09:43:41 +01: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