Commit Graph

109614 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
ae122721dc Rollup merge of #69645 - DutchGhost:const-forget-tests, r=Dylan-DPC
const forget tests

Adds tests for https://github.com/rust-lang/rust/pull/69617
2020-03-11 10:36:24 +01:00
Mazdak Farrokhzad
25091ed9b7 Rollup merge of #69625 - Stebalien:feat/iter-copy-specialize, r=KodrAus
Implement nth, last, and count for iter::Copied

Implement nth, last and count for iter::Copied.
2020-03-11 10:36:22 +01:00
Mazdak Farrokhzad
d7f0b88ade Rollup merge of #69591 - matthewjasper:query-response-relate, r=nikomatsakis
Use TypeRelating for instantiating query responses

`eq` can add constraints to `RegionConstraintData`, which isn't allowed during borrow checking outside of a `CustomTypeOp`. Use `TypeRelating` instead to always push constraints to the obligations list.

closes #69490
2020-03-11 10:36:19 +01:00
Mazdak Farrokhzad
43079147f4 Rollup merge of #69373 - tspiteri:const_int_conversion, r=oli-obk
Stabilize const for integer {to,from}_{be,le,ne}_bytes methods

All of these functions can be implemented simply and naturally as const functions, e.g. `u32::from_le_bytes` can be implemented as
```rust
(bytes[0] as u32)
    | (bytes[1] as u32) << 8
    | (bytes[2] as u32) << 16
    | (bytes[3] as u32) << 24
```
So stabilizing the constness will not expose that internally they are implemented using transmute which is not const in stable.
2020-03-11 10:36:18 +01:00
Mazdak Farrokhzad
a7c2eef2ae Rollup merge of #66059 - RalfJung:panic-on-non-zero, r=eddyb
mem::zeroed/uninit: panic on types that do not permit zero-initialization

r? @eddyb @oli-obk

Cc https://github.com/rust-lang/rust/issues/62825

Also see [this summary comment](https://github.com/rust-lang/rust/pull/66059#issuecomment-586734747)
2020-03-11 10:36:16 +01:00
Oliver Scherer
db9ddf1cf1 Address review comments 2020-03-11 09:39:58 +01:00
Oliver Scherer
2e91065a6f Generalize typed value printing and use for undef printing 2020-03-11 09:10:50 +01:00
Oliver Scherer
cc9ca640c2 Don't print literal type suffixes if print_ty is false 2020-03-11 09:10:49 +01:00
Oliver Scherer
fff2e0f806 Print function pointer type for function pointer const generics 2020-03-11 09:10:49 +01:00
Oliver Scherer
b78dbf43f4 Reuse type ascripted printing for type cast printing 2020-03-11 09:10:49 +01:00
Oliver Scherer
154f3f19ab Don't print all zsts as their type as it makes no sense for more complex examples (e.g. structs) 2020-03-11 09:10:49 +01:00
Oliver Scherer
1191eb4585 Prefer fall through to code repetition 2020-03-11 09:10:49 +01:00
Oliver Scherer
b2e93a41a6 Print leading zeros for non pointers 2020-03-11 09:10:49 +01:00
Oliver Scherer
b837e71732 Reduce special casing in the const pretty printer 2020-03-11 09:10:49 +01:00
Oliver Scherer
e22ddfd80d Don't print leading zeros on hex dumps constants 2020-03-11 09:10:49 +01:00
Oliver Scherer
4ddb4bdaad Eliminate all ParamEnv::empty uses in pretty printing 2020-03-11 09:10:49 +01:00
Oliver Scherer
3b82edd279 Print braces only in print_ty mode 2020-03-11 09:10:49 +01:00
Oliver Scherer
02f4eeb7cb Address review comments around type_ascribed_value 2020-03-11 09:10:49 +01:00
Oliver Scherer
02dbb35b2b Deduplicate and clean up pretty printing logic 2020-03-11 09:10:48 +01:00
Tomasz Miąsko
1106579c78 librustc_codegen_llvm: Use slices instead of 0-terminated strings
Changed functions:
* LLVMRustGetOrInsertFunction
* LLVMRustGetNamedValue
* LLVMRustBuildCall (removed unused name argument)
* LLVMRustInlineAsm
* LLVMRustInlineAsmVerify
* LLVMRustAppendModuleInlineAsm
2020-03-11 08:10:21 +01:00
Ryan Lopopolo
533784d3a2 Add docs for From::<&mut str>::from String impl 2020-03-10 18:47:19 -07:00
Ryan Lopopolo
18feaa3fa2 Add stable feature name 2020-03-10 18:45:08 -07:00
Esteban Küber
29be741c9c review comments 2020-03-10 17:59:32 -07:00
Dylan MacKenzie
68f20019f7 Ignore mir-opt test when panic=abort 2020-03-10 17:18:16 -07:00
Dylan MacKenzie
8ea5ac60b6 Add mir-opt test for better drop elaboration 2020-03-10 17:18:16 -07:00
Joshua Nelson
3477e67a92 Allow vec.rs to be over 3000 lines :( 2020-03-10 23:49:45 +00:00
Joshua Nelson
8212584c9e Bump release cutoff 2020-03-10 23:44:46 +00:00
Joshua Nelson
1ac4a46142 make the impl a little prettier 2020-03-10 23:44:46 +00:00
Joshua Nelson
96794d86f1 fix test failure 2020-03-10 23:44:46 +00:00
Joshua Nelson
ba46b61bbc bless UI tests 2020-03-10 23:44:46 +00:00
Joshua Nelson
e3d5eaf2bb add ui-tests 2020-03-10 23:44:46 +00:00
Joshua Nelson
f267d9dc19 limit From impl to LengthAtMost32
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2020-03-10 23:44:46 +00:00
Joshua Nelson
daeb8ece8c fix error compiling stage2
Co-Authored-By: lzutao <taolzu@gmail.com>
2020-03-10 23:44:46 +00:00
Joshua Nelson
62722735fb impl From<[T; N]> for Vec<T> 2020-03-10 23:44:46 +00:00
Wesley Wiser
5357f83ee8 [Miri] Use a session variable instead of checking for an env var always
In CTFE heavy code, checking the env var everytime is inefficient. We
can do a lot better by using a `Session` variable instead.
2020-03-10 18:18:04 -04:00
Ralf Jung
9552d2e4ab bump backtrace-sys 2020-03-10 21:45:31 +01:00
Santiago Pastorino
b3b32b74bc rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.org 2020-03-10 17:08:18 -03:00
Santiago Pastorino
d00b2696d8 Rename Rustc Guide to Rustc Dev Guide 2020-03-10 17:08:18 -03:00
Santiago Pastorino
1ddcea3422 Rename rustc_guide to rustc_dev_guide 2020-03-10 17:08:17 -03:00
Santiago Pastorino
9d4fdba8be Rename rustc guide to rustc dev guide 2020-03-10 17:08:16 -03:00
Santiago Pastorino
0037f4e37c Rename rustc-guide to rustc-dev-guide 2020-03-10 17:08:10 -03:00
Vadim Petrochenkov
6b27e8d2a6 parse: Tweak the function parameter edition check
Move anon-params tests to ui/anon-params.
2020-03-10 22:35:01 +03:00
Matt Cooper
a942b39465 fix how we detect an unset variable 2020-03-10 14:13:39 -04:00
Matt Cooper
ec7010a1a8 establish immutable source for RUST_CONFIGURE_ARGS 2020-03-10 13:46:39 -04:00
bors
1581278534 Auto merge of #66364 - Centril:cleanup-macro-def, r=petrochenkov,eddyb
Cleanup `rmeta::MacroDef`

Avoid using rountrip parsing in the encoder and in `fn load_macro_untracked`.

The main reason I was interested in this was to remove `rustc_parse` as a dependency of `rustc_metadata` but it seems like this had other benefits as well.

Fixes #49511.

r? @eddyb
cc @matthewjasper @estebank @petrochenkov
2020-03-10 17:12:48 +00:00
Florian Gilcher
69aaed872c Make Point Copy in arithmetic documentation
Small composite types like `Point { x: i32, y: i32}` are plain
old data and we should encourage users to derive `Copy` on them.

This changes the semantics of the edited examples slightly: instead
of consuming the operands during addition, it will copy them. This
is desired behaviour.

Co-Authored-By: Jake Goulding <shepmaster@mac.com>
2020-03-10 18:11:36 +01:00
Mazdak Farrokhzad
4d16c217b8 Matrix::push: recursively expand or-patterns 2020-03-10 17:46:19 +01:00
Bastian Kauschke
7b3e3ff39a explain the use of a custom identity function 2020-03-10 12:46:22 +01:00
Lena Wildervanck
88f8b88160 Remove deprecated description function of TryReserveError 2020-03-10 11:19:40 +01:00
Ralf Jung
0b2329da9a also make panic_fmt track_caller 2020-03-10 10:31:03 +01:00