Skip to content
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

update from origin 2020-06-23 #6

Merged
merged 334 commits into from
Jun 24, 2020
Merged
Changes from 8 commits
Commits
Show all changes
334 commits
Select commit Hold shift + click to select a range
0094f44
Remove old commented code
Lucretiel Jun 19, 2020
9245ba8
Remove the const_raw_ptr_comparison feature gate.
oli-obk Jun 12, 2020
e09b620
Add fuzzy pointer comparison intrinsics
oli-obk Jun 16, 2020
84f1d73
Tidy got confused on `rustc_const_unstable` `issue`s
oli-obk Jun 18, 2020
85e1c3b
Rollup merge of #71568 - hbina:document_unsafety_slice_sort, r=joshtr…
Manishearth Jun 19, 2020
55479de
Rollup merge of #72709 - LeSeulArtichaut:unsafe-liballoc, r=nikomatsakis
Manishearth Jun 19, 2020
bc773fe
Rollup merge of #73214 - androm3da:hex_inline_asm_00, r=Amanieu
Manishearth Jun 19, 2020
186640a
Rollup merge of #73248 - marmeladema:save-analysis-various-fixes, r=X…
Manishearth Jun 19, 2020
17064da
Rollup merge of #73257 - davidtwco:issue-73249-improper-ctypes-projec…
Manishearth Jun 19, 2020
4910206
Rollup merge of #73261 - estebank:generics-sized, r=nikomatsakis
Manishearth Jun 19, 2020
058971c
Rollup merge of #73300 - crlf0710:crate_level_only_check, r=petrochenkov
Manishearth Jun 19, 2020
b285d68
Rollup merge of #73334 - ayazhafiz:err/num-type-cannot-fit, r=estebank
Manishearth Jun 19, 2020
65c33ed
Rollup merge of #73357 - petrochenkov:tmap, r=davidtwco
Manishearth Jun 19, 2020
687f929
Rollup merge of #73364 - joshtriplett:inline-asm, r=Amanieu
Manishearth Jun 19, 2020
b443a10
Rollup merge of #73382 - Aaron1011:fix/self-receiver-candidates, r=pe…
Manishearth Jun 19, 2020
d2272d4
Rollup merge of #73465 - lzutao:spec-char-tostring, r=sfackler
Manishearth Jun 19, 2020
a88182f
Rollup merge of #73489 - sexxi-goose:init_place_refactor, r=nikomatsakis
Manishearth Jun 19, 2020
33b304c
Using xsave restore to restore complete FPU state
raoulstrackx Jun 19, 2020
2f9d338
forbid mutable references in all constants except const fns
pvdrz Jun 7, 2020
014e605
update tests
pvdrz Jun 8, 2020
1f48465
update diagnostics for &mut in constants
pvdrz Jun 15, 2020
8c7c84b
code coverage foundation for hash and num_counters
richkadel Jun 18, 2020
8fc2eeb
Use newtype to map from `Local` to `GeneratorSavedLocal`
ecstatic-morse Jun 10, 2020
c178e64
Look for stores between non-conflicting generator saved locals
ecstatic-morse Jun 10, 2020
b2ec645
Incorporate review suggestions
ecstatic-morse Jun 19, 2020
006b482
Add compare-mode=chalk and add a little bit more implementations and …
jackh726 May 13, 2020
16dd584
Update chalk
jackh726 May 13, 2020
6aa2e9d
Update chalk
jackh726 May 27, 2020
7c09ad0
Use builtin types for Never, Array, and FnDef
jackh726 May 27, 2020
a42e5a1
Implement fn_def_datum
jackh726 May 27, 2020
d0ad15d
Remove RustDefId
jackh726 May 27, 2020
e997375
Test error order is non-deterministic
jackh726 May 27, 2020
90e01ee
Update Chalk
jackh726 May 27, 2020
64c486b
Update chalk and add LifetimeOutlives and ObjectSafe lowering
jackh726 May 30, 2020
6a979d8
Lower consts
jackh726 May 30, 2020
a1c769b
Fix building
jackh726 May 30, 2020
b5d5994
Update chalk to 0.11.0
jackh726 Jun 2, 2020
16ad3f3
Nits and change skip_binder to no_bound_vars for fndef
jackh726 Jun 3, 2020
890cef6
Change InternedAdtDef to &'tcx AdtDef
jackh726 Jun 3, 2020
d63195b
Return type is bound too
jackh726 Jun 3, 2020
2d8bd9b
Auto merge of #73257 - davidtwco:issue-73249-improper-ctypes-projecti…
bors Jun 19, 2020
96031e2
add new error code
pvdrz Jun 18, 2020
8f0bd5f
Update the doc for std::prelude, removing the "technical part" section
poliorcetics Jun 19, 2020
e75fbae
add second message for livedrop errors
pvdrz Jun 19, 2020
562f496
Account for multiple impl/dyn Trait in return type when suggesting `'_`
estebank Jun 9, 2020
db0d70e
Refactor `try_find` a little
cuviper May 4, 2020
34c5cd9
Auto merge of #73511 - Manishearth:rollup-3iffxd8, r=Manishearth
bors Jun 19, 2020
95f8daa
Fix -Z unpretty=everybody_loops
jyn514 Jun 20, 2020
203305d
Rollup merge of #71420 - RalfJung:specialization-incomplete, r=matthe…
Manishearth Jun 20, 2020
5c9cd82
Rollup merge of #71899 - cuviper:try_find_map, r=dtolnay
Manishearth Jun 20, 2020
218b90f
Rollup merge of #72689 - lcnr:common_str, r=estebank
Manishearth Jun 20, 2020
c0a25be
Rollup merge of #72791 - lcnr:coerce-refactor, r=estebank
Manishearth Jun 20, 2020
dac512e
Rollup merge of #72934 - christianpoveda:mut-borrows-in-consts, r=oli…
Manishearth Jun 20, 2020
2d1bd57
Rollup merge of #73027 - doctorn:issue-72690, r=estebank
Manishearth Jun 20, 2020
17b80d9
Rollup merge of #73347 - tmiasko:incompatible-sanitizers, r=nikic
Manishearth Jun 20, 2020
fe4b485
Rollup merge of #73359 - jonas-schievink:do-the-shimmy, r=matthewjasper
Manishearth Jun 20, 2020
2dbb8b6
Rollup merge of #73399 - GuillaumeGomez:cleanup-e0668, r=Dylan-DPC
Manishearth Jun 20, 2020
2377a50
Rollup merge of #73436 - GuillaumeGomez:cleanup-e0670, r=Dylan-DPC
Manishearth Jun 20, 2020
d69d4c3
Rollup merge of #73440 - jyn514:bootstrap/build-rustdoc, r=Mark-Simul…
Manishearth Jun 20, 2020
db7203d
Rollup merge of #73442 - davidtwco:issue-72181-pretty-print-const-val…
Manishearth Jun 20, 2020
61f8c3e
Rollup merge of #73452 - matthewjasper:auto-rec, r=nikomatsakis
Manishearth Jun 20, 2020
fd1c783
Rollup merge of #73458 - tmiasko:arena-layout, r=matthewjasper
Manishearth Jun 20, 2020
7777b0b
Rollup merge of #73484 - poliorcetics:use-prelude-doc, r=sfackler
Manishearth Jun 20, 2020
3e40cca
Rollup merge of #73506 - Xanewok:update-rls, r=Xanewok
Manishearth Jun 20, 2020
033013c
Auto merge of #73528 - Manishearth:rollup-7djz8nd, r=Manishearth
bors Jun 20, 2020
a540b1b
Add ClashingExternDecl test case.
jumbatm Mar 31, 2020
6b74e3c
Add ClashingExternDecl lint.
jumbatm Jun 19, 2020
8f07952
Add clashing-extern-fn.rs stderr.
jumbatm Apr 5, 2020
556b7ba
Update existing test cases.
jumbatm Apr 6, 2020
0624a5a
Squashed all commits
rakshith-ravi Jun 20, 2020
2851c9f
Support sanitizers on aarch64-unknown-linux-gnu
tmiasko Jun 4, 2020
a3e88be
bootstrap: Build sanitizer runtimes for aarch64-unknown-linux-gnu
tmiasko Jun 6, 2020
d2e6e93
ci: Enable sanitizers on dist-aarch64-linux
tmiasko Jun 4, 2020
66e7a14
bootstrap: Factor out common code in supported_sanitizers
tmiasko Jun 8, 2020
c4840db
skol -> placeholder
lcnr Jun 6, 2020
a24c897
int -> i32
lcnr Jun 6, 2020
180334c
remove `pop_placeholders`
lcnr Jun 6, 2020
ef10694
Deprecate `Vec::remove_item`
LukasKalbertodt Jun 20, 2020
936b6bf
Move `trait_map` into `hir::Crate`
marmeladema Jun 12, 2020
a98f35f
Remove `NodeId` to `HirId` conversion APIs
marmeladema Jun 12, 2020
6a0f1af
Remove `HirId` to `NodeId` conversion APIs
marmeladema Jun 12, 2020
94817e3
Pre-compute `hir_id_to_def_id` mapping
marmeladema Jun 12, 2020
1e6e082
Remove uses of `Vec::remove_item`
LukasKalbertodt Jun 20, 2020
5155518
Decouple `Autoderef` with `FnCtxt` and move `Autoderef` to `librustc_…
ldm0 Jun 20, 2020
ef68bf3
Try to suggest dereferences when trait selection failed.
ldm0 Jun 20, 2020
2e781dd
lint: normalize projections using opaque types
davidtwco Jun 12, 2020
29272fc
Correctly handle binders inside trait predicates
matthewjasper May 30, 2020
04e589c
Consider fewer predicates for projection candidates
matthewjasper May 30, 2020
59d8c45
Clean up E0695 explanation
GuillaumeGomez Jun 20, 2020
5eaee0d
update Miri
RalfJung Jun 20, 2020
f1e0710
Prevent incorrect help message for dereference suggestion
ldm0 Jun 20, 2020
13104ef
Pre-compute `def_id_to_hir_id` table
marmeladema Jun 12, 2020
9e88b48
Refer just to the issue in the raw ptr cmp diagnostic instead of expl…
oli-obk Jun 20, 2020
53686b9
Satisfy tidy
oli-obk Jun 20, 2020
98e97a4
Address review comments
oli-obk Jun 20, 2020
d660dbc
Check associated type satisfy their bounds
matthewjasper May 30, 2020
9818bc0
Don't set STILL_FURTHER_SPECIALIZABLE for regions/bound variables
matthewjasper Jun 10, 2020
db4826d
Move bounds on associated types to the type
matthewjasper Jun 11, 2020
5e8c9f4
Explain what the substs we're creating are
matthewjasper Jun 13, 2020
5431ef6
Rollup merge of #72600 - Aaron1011:fix/anon-const-encoding, r=varkor
RalfJung Jun 20, 2020
b015b28
Rollup merge of #73055 - lcnr:skol-no-more, r=matthewjasper
RalfJung Jun 20, 2020
913aac8
Rollup merge of #73058 - tmiasko:aarch64-san, r=nagisa
RalfJung Jun 20, 2020
77efcab
Rollup merge of #73171 - tblah:riscv-qemu-test, r=pietroalbini
RalfJung Jun 20, 2020
91bd333
Rollup merge of #73404 - ajpaverd:cfguard_syntax, r=Mark-Simulacrum
RalfJung Jun 20, 2020
7930ee6
Rollup merge of #73444 - pietroalbini:ci-remove-try-alt, r=Mark-Simul…
RalfJung Jun 20, 2020
96b86ea
Rollup merge of #73471 - raoulstrackx:raoul/fpu_tag_word, r=jethrogb
RalfJung Jun 20, 2020
c1cad70
Rollup merge of #73539 - LukasKalbertodt:deprecate-vec-remove-item, r…
RalfJung Jun 20, 2020
bb0016b
Rollup merge of #73543 - GuillaumeGomez:cleanup-e0695, r=Dylan-DPC
RalfJung Jun 20, 2020
3ff5879
core/time: Add Duration methods for zero
jonhoo May 30, 2020
ad7fd62
Doctests need feature
jonhoo May 30, 2020
386114b
Revise according to review
jonhoo Jun 20, 2020
c883fa4
Allow multiple `asm!` options
camelid Jun 11, 2020
e614116
Update tests
camelid Jun 11, 2020
1d2acdf
Use `Vec<Span>` instead of `Option<Vec<Span>>`
camelid Jun 12, 2020
27cc7c7
Clean up
camelid Jun 12, 2020
820bba1
Add codegen test for multiple `asm!` options
camelid Jun 12, 2020
2be403c
Warn on duplicate `asm!` options
camelid Jun 14, 2020
7aaadb6
Add UI test for duplicate `asm!` options warning
camelid Jun 14, 2020
b94b7e7
Make warning an error; use help instead of suggestion; clean up code
camelid Jun 14, 2020
ac54265
Use `span_label`
camelid Jun 15, 2020
7c5b66f
Update duplicate options test
camelid Jun 15, 2020
c7da50d
Get option name from symbol instead of snippet
camelid Jun 15, 2020
e8be797
Use bitflags function instead of custom one
camelid Jun 15, 2020
b00b1a4
Use `span_suggestion` instead of `span_label`
camelid Jun 16, 2020
f4dfc61
Add more to duplicate options test
camelid Jun 16, 2020
4ba6697
Make suggestion machine-applicable
camelid Jun 16, 2020
8fe6710
Create a separate, tool-only suggestion for the comma
camelid Jun 16, 2020
db9d376
Add documentation
camelid Jun 17, 2020
58f812b
Use `p.token` instead of `p.look_ahead()`
camelid Jun 18, 2020
8d80cc5
Fix duplicate options error
camelid Jun 20, 2020
c31785a
Run `./x.py fmt`
camelid Jun 20, 2020
5a8e915
Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d8e 2020-06-15)
ehuss Jun 16, 2020
f455e46
Auto merge of #73550 - RalfJung:rollup-5huj1k1, r=RalfJung
bors Jun 20, 2020
bfb0e8d
Fix broken inner_deref doc tests.
ehuss Jun 20, 2020
9355168
update tests
Jun 20, 2020
a1404a9
Rollup merge of #72456 - ldm0:dereftrait, r=estebank
Manishearth Jun 20, 2020
1a171d0
Rollup merge of #72788 - matthewjasper:projection-bound-validation, r…
Manishearth Jun 20, 2020
c47550f
Rollup merge of #72790 - jonhoo:duration-is-zero, r=LukasKalbertodt
Manishearth Jun 20, 2020
45d6aef
Rollup merge of #73227 - camelid:multiple-asm-options, r=Amanieu
Manishearth Jun 20, 2020
9003087
Rollup merge of #73287 - davidtwco:issue-73251-opaque-types-in-projec…
Manishearth Jun 20, 2020
0a8fd43
Rollup merge of #73291 - marmeladema:hir-id-ification-fix, r=petroche…
Manishearth Jun 20, 2020
a876a5a
Rollup merge of #73378 - matthewjasper:arena-not-special, r=oli-obk
Manishearth Jun 20, 2020
9a82736
Rollup merge of #73411 - ehuss:bump-stage0, r=Mark-Simulacrum
Manishearth Jun 20, 2020
929f032
Rollup merge of #73443 - pietroalbini:gha-auto-fallible, r=Mark-Simul…
Manishearth Jun 20, 2020
fc60282
impl PartialEq<Vec<B>> for &[A], &mut [A]
sollyucko Apr 29, 2020
7058471
Auto merge of #73563 - Manishearth:rollup-oowgwwm, r=Manishearth
bors Jun 20, 2020
4896a06
Update stability attribute of new Vec PartialEq impls
dtolnay Jun 20, 2020
a63eb3c
Clarify --extern documentation.
adetaylor Jun 21, 2020
228a0ed
Auto merge of #70946 - jumbatm:clashing-extern-decl, r=nagisa
bors Jun 21, 2020
6374054
Fix typos in doc comments
JOE1994 Jun 21, 2020
38bd83d
Auto merge of #71911 - wesleywiser:const_prop_small_cleanups, r=oli-obk
bors Jun 21, 2020
e3d735d
Fix typo in error_codes doc
dario23 Jun 21, 2020
8ea55f1
Cache decoded predicate shorthands
matthewjasper Jun 10, 2020
f802ee1
Cache flags and escaping vars for predicates
matthewjasper Jun 10, 2020
6e12272
Replace `is_global` call on data with call on predicate
matthewjasper Jun 10, 2020
7adbc0d
Auto merge of #73546 - RalfJung:miri, r=RalfJung
bors Jun 21, 2020
1c74ab4
Make is_freeze and is_copy_modulo_regions take TyCtxtAt
RalfJung Jun 21, 2020
e465b22
`icmp` can handle raw pointers just fine, there's no need to cast to …
oli-obk Jun 21, 2020
467415d
deprecate wrapping_offset_from
RalfJung Jun 21, 2020
a657be4
Create E0765 error for unterminated double quote strings
GuillaumeGomez Jun 21, 2020
349f6bf
Auto merge of #72696 - jethrogb:jb/llvm-zlib, r=Mark-Simulacrum
bors Jun 21, 2020
726b6f4
Miri: replace many bug! by span_bug!
RalfJung Jun 21, 2020
c14d85f
Update UI tests
GuillaumeGomez Jun 21, 2020
893077c
Update src/librustc_mir/monomorphize/collector.rs
JOE1994 Jun 21, 2020
fea5ab1
Prefer accessible paths in 'use' suggestions
da-x Jun 13, 2020
3bfd0c9
remove switch_ty reliance in codegen
RalfJung Jun 21, 2020
6297228
MIR validation: check switch_ty
RalfJung Jun 21, 2020
a8cf399
Auto merge of #72936 - jackh726:chalk-more, r=nikomatsakis
bors Jun 21, 2020
7447bf2
fmt
RalfJung Jun 21, 2020
ae71e96
Do not send a notification for P-high stable regressions
LeSeulArtichaut Jun 21, 2020
1a4e2b6
Auto merge of #73180 - matthewjasper:predicate-cache, r=nikomatsakis
bors Jun 21, 2020
f60513e
Move remaining `NodeId` APIs from `Definitions` to `Resolver`
marmeladema Jun 20, 2020
1d3f49f
Always create a root definition when creating a new `Definitions` obj…
marmeladema Jun 21, 2020
bd4f6f0
Move `next_disambiguator` to `Resolver`
marmeladema Jun 21, 2020
953104e
Fix spurious 'value moved here in previous iteration of loop' messages
Aaron1011 Jun 22, 2020
933fe80
num_counters to u32, after implementing TypeFoldable
richkadel Jun 22, 2020
b60ec47
bootstrap: no `config.toml` exists regression
davidtwco Jun 21, 2020
c474317
Clean up E0699 explanation
GuillaumeGomez Jun 22, 2020
932237b
fix `intrinsics::needs_drop` docs
lcnr Jun 22, 2020
8da1dd0
Rollup merge of #71660 - sollyucko:master, r=dtolnay
Dylan-DPC Jun 22, 2020
fdd241f
Rollup merge of #72623 - da-x:use-suggest-public-path, r=petrochenkov
Dylan-DPC Jun 22, 2020
d22b80d
Rollup merge of #73502 - GuillaumeGomez:add-e0764, r=estebank
Dylan-DPC Jun 22, 2020
35ecb26
Rollup merge of #73580 - RalfJung:deprecate-wrapping-offset-from, r=A…
Dylan-DPC Jun 22, 2020
cb85f4b
Rollup merge of #73582 - RalfJung:miri-span-bug, r=oli-obk
Dylan-DPC Jun 22, 2020
c5e6f48
Rollup merge of #73585 - LeSeulArtichaut:patch-3, r=Mark-Simulacrum
Dylan-DPC Jun 22, 2020
62878c2
Auto merge of #73617 - Dylan-DPC:rollup-zugh80o, r=Dylan-DPC
bors Jun 22, 2020
bcc0a9c
modify leak-check to track only outgoing edges from placeholders
nikomatsakis May 18, 2020
4199b3a
Revert "modify leak-check to track only outgoing edges from placehold…
nikomatsakis May 18, 2020
f2cf994
rewrite leak check to be based on universes
nikomatsakis May 19, 2020
5a7a850
move leak-check to during coherence, candidate eval
nikomatsakis May 20, 2020
1e00e1b
upcasting traits requires only that things become more general
nikomatsakis May 20, 2020
6bb3dbf
Auto merge of #73415 - ehuss:update-cargo, r=ehuss
bors Jun 22, 2020
ad9972a
Revert "Rollup merge of #72389 - Aaron1011:feature/move-fn-self-msg, …
Aaron1011 Jun 21, 2020
d3feb8b
Re-enable Clippy tests
Aaron1011 Jun 21, 2020
e2ab98d
Stop using old version of `syn` in `rustc-workspace-hack`
Aaron1011 Jun 22, 2020
3ed96a6
Point at the call spawn when overflow occurs during monomorphization
Aaron1011 Jun 22, 2020
70cf33f
remove snapshot calls from "match" operations during select
nikomatsakis May 22, 2020
6873a76
remove leak-check from project
nikomatsakis May 22, 2020
3a68d56
remove `leak_check` from the outlives predicate evaluations
nikomatsakis May 22, 2020
be0d10f
add new tests from MCP and the tracking issue
nikomatsakis May 22, 2020
93e2982
add new coherence tests and update the documentation
nikomatsakis Jun 5, 2020
c88a76e
WIP bless test and compare-mode=nll
nikomatsakis Jun 6, 2020
6929013
fix subtle bug in NLL type checker
nikomatsakis Jun 8, 2020
d57689f
cite issue 73154
nikomatsakis Jun 8, 2020
cbf356a
Auto merge of #73594 - Aaron1011:revert/move-fn-self-msg, r=Manishearth
bors Jun 22, 2020
f4a7938
implemented query for coverage data
richkadel Jun 22, 2020
f84b7e1
Provide context on E0308 involving fn items
estebank Jun 22, 2020
994d9d0
Address remaining feedback items
richkadel Jun 22, 2020
3eb8eb9
review comments
estebank Jun 22, 2020
dcd470f
Auto merge of #73007 - yoshuawuyts:socketaddr-from-string-u16, r=sfac…
bors Jun 23, 2020
6276c13
Rollup merge of #71756 - carstenandrich:master, r=dtolnay
Dylan-DPC Jun 23, 2020
5426586
Rollup merge of #73495 - Lucretiel:wasi-io-impls, r=sfackler
Dylan-DPC Jun 23, 2020
4dfae77
Rollup merge of #73575 - dario23:typo-errorcodes-doc, r=matthewjasper
Dylan-DPC Jun 23, 2020
963a480
Rollup merge of #73578 - RalfJung:ty-ctxt-at, r=jonas-schievink
Dylan-DPC Jun 23, 2020
490d820
Rollup merge of #73586 - RalfJung:switch-ty, r=oli-obk
Dylan-DPC Jun 23, 2020
b3d99cb
Rollup merge of #73600 - Aaron1011:fix/move-in-macro, r=ecstatic-morse
Dylan-DPC Jun 23, 2020
e979392
Rollup merge of #73610 - GuillaumeGomez:cleanup-e0699, r=Dylan-DPC
Dylan-DPC Jun 23, 2020
08ec4cb
moves coverage data computation from pass to query
richkadel Jun 23, 2020
3d0192e
PR no longer requires u32 impl TypeFoldable
richkadel Jun 23, 2020
a045140
using "mir_body" (vs "body") in InstrumentCoverage
richkadel Jun 23, 2020
3b1c08c
Auto merge of #73635 - Dylan-DPC:rollup-b4wbp42, r=Dylan-DPC
bors Jun 23, 2020
977ce57
Updated query for num_counters to compute from max index
richkadel Jun 23, 2020
59e87c0
Rollup merge of #72271 - rakshith-ravi:master, r=varkor
Manishearth Jun 23, 2020
903823c
Rollup merge of #72493 - nikomatsakis:move-leak-check, r=matthewjasper
Manishearth Jun 23, 2020
ae38698
Rollup merge of #73398 - oli-obk:const_raw_ptr_cmp, r=varkor,RalfJung…
Manishearth Jun 23, 2020
98aa34c
Rollup merge of #73472 - GuillaumeGomez:cleanup-e0689, r=Dylan-DPC
Manishearth Jun 23, 2020
cd18ac1
Rollup merge of #73496 - estebank:opaque-missing-lts-in-fn-3, r=nikom…
Manishearth Jun 23, 2020
0f9a6ed
Rollup merge of #73515 - christianpoveda:livedrop-diagnostics, r=oli-obk
Manishearth Jun 23, 2020
0560151
Rollup merge of #73567 - adetaylor:extern-doc-fix, r=dtolnay
Manishearth Jun 23, 2020
84bd1e7
Rollup merge of #73572 - JOE1994:patch-4, r=jonas-schievink
Manishearth Jun 23, 2020
44900f8
Rollup merge of #73590 - davidtwco:bootstrap-fix-config-env-var, r=Ma…
Manishearth Jun 23, 2020
1557fb0
Auto merge of #73643 - Manishearth:rollup-68dr8fz, r=Manishearth
bors Jun 23, 2020
5fa8b08
The const propagator cannot trace references.
oli-obk Jun 22, 2020
478750c
rustdoc: Fix doc aliases with crate filtering
ollie27 Jun 23, 2020
0c2b025
rustc: Modernize wasm checks for atomics
alexcrichton Jun 23, 2020
ff5b446
Auto merge of #73644 - ollie27:rustdoc_alias_filter, r=GuillaumeGomez
bors Jun 23, 2020
6e8aa1f
review comments: wording and style
estebank Jun 23, 2020
7d2fba1
Rollup merge of #72780 - GuillaumeGomez:enforce-doc-alias-check, r=ol…
Manishearth Jun 23, 2020
317a151
Rollup merge of #72876 - TrolledWoods:patch-2, r=Dylan-DPC
Manishearth Jun 23, 2020
781b589
Rollup merge of #73244 - ecstatic-morse:validate-generator-mir, r=tma…
Manishearth Jun 23, 2020
f5e46fe
Rollup merge of #73488 - richkadel:llvm-coverage-map-gen, r=tmandry
Manishearth Jun 23, 2020
505cf52
Rollup merge of #73523 - jyn514:everybody_loops, r=ecstatic-morse
Manishearth Jun 23, 2020
045761c
Rollup merge of #73587 - marmeladema:hir-id-ification-final, r=petroc…
Manishearth Jun 23, 2020
30fba22
Rollup merge of #73601 - Aaron1011:fix/better-mono-overflow-err, r=ec…
Manishearth Jun 23, 2020
d8b4604
Rollup merge of #73613 - oli-obk:const_prop_miscompile, r=wesleywiser
Manishearth Jun 23, 2020
f7d5687
Rollup merge of #73614 - lcnr:patch-4, r=Dylan-DPC
Manishearth Jun 23, 2020
4f2e540
Rollup merge of #73630 - estebank:fn-item-e0308, r=davidtwco
Manishearth Jun 23, 2020
6ed6a84
Rollup merge of #73665 - alexcrichton:update-wasm-atomics-feature, r=…
Manishearth Jun 23, 2020
0c04344
Auto merge of #73669 - Manishearth:rollup-0n4u7vq, r=Manishearth
bors Jun 23, 2020
3c90ae8
Auto merge of #73293 - Aaron1011:feature/macro-rules-arg-capture, r=p…
bors Jun 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/liballoc/raw_vec.rs
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ impl<T> RawVec<T, Global> {
/// `#[rustc_force_min_const_fn]` attribute which requires conformance
/// with `min_const_fn` but does not necessarily allow calling it in
/// `stable(...) const fn` / user code not enabling `foo` when
/// `#[rustc_const_unstable(feature = "foo", ..)]` is present.
/// `#[rustc_const_unstable(feature = "foo", issue = "01234")]` is present.
pub const NEW: Self = Self::new();

/// Creates the biggest possible `RawVec` (on the system heap)
16 changes: 13 additions & 3 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
@@ -1012,7 +1012,7 @@ extern "rust-intrinsic" {
///
/// The stabilized version of this intrinsic is
/// [`std::any::type_name`](../../std/any/fn.type_name.html)
#[rustc_const_unstable(feature = "const_type_name", issue = "none")]
#[rustc_const_unstable(feature = "const_type_name", issue = "63084")]
pub fn type_name<T: ?Sized>() -> &'static str;

/// Gets an identifier which is globally unique to the specified type. This
@@ -1021,7 +1021,7 @@ extern "rust-intrinsic" {
///
/// The stabilized version of this intrinsic is
/// [`std::any::TypeId::of`](../../std/any/struct.TypeId.html#method.of)
#[rustc_const_unstable(feature = "const_type_id", issue = "none")]
#[rustc_const_unstable(feature = "const_type_id", issue = "41875")]
pub fn type_id<T: ?Sized + 'static>() -> u64;

/// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:
@@ -1931,7 +1931,7 @@ extern "rust-intrinsic" {
pub fn nontemporal_store<T>(ptr: *mut T, val: T);

/// See documentation of `<*const T>::offset_from` for details.
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "none")]
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "41079")]
pub fn ptr_offset_from<T>(ptr: *const T, base: *const T) -> isize;

/// Internal hook used by Miri to implement unwinding.
@@ -1948,6 +1948,16 @@ extern "rust-intrinsic" {
#[cfg(not(bootstrap))]
#[lang = "count_code_region"]
pub fn count_code_region(index: u32);

/// See documentation of `<*const T>::guaranteed_eq` for details.
#[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
#[cfg(not(bootstrap))]
pub fn ptr_guaranteed_eq<T>(ptr: *const T, other: *const T) -> bool;

/// See documentation of `<*const T>::guaranteed_ne` for details.
#[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
#[cfg(not(bootstrap))]
pub fn ptr_guaranteed_ne<T>(ptr: *const T, other: *const T) -> bool;
}

// Some functions are defined here because they accidentally got made
1 change: 1 addition & 0 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
@@ -87,6 +87,7 @@
#![feature(const_generics)]
#![feature(const_ptr_offset)]
#![feature(const_ptr_offset_from)]
#![cfg_attr(not(bootstrap), feature(const_raw_ptr_comparison))]
#![feature(const_result)]
#![feature(const_slice_from_raw_parts)]
#![feature(const_slice_ptr_len)]
66 changes: 66 additions & 0 deletions src/libcore/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
@@ -295,6 +295,72 @@ impl<T: ?Sized> *const T {
intrinsics::ptr_offset_from(self, origin)
}

/// Returns whether two pointers are guaranteed to be equal.
///
/// At runtime this function behaves like `self == other`.
/// However, in some contexts (e.g., compile-time evaluation),
/// it is not always possible to determine equality of two pointers, so this function may
/// spuriously return `false` for pointers that later actually turn out to be equal.
/// But when it returns `true`, the pointers are guaranteed to be equal.
///
/// This function is the mirror of [`guaranteed_ne`], but not its inverse. There are pointer
/// comparisons for which both functions return `false`.
///
/// [`guaranteed_ne`]: #method.guaranteed_ne
///
/// The return value may change depending on the compiler version and unsafe code may not
/// rely on the result of this function for soundness. It is suggested to only use this function
/// for performance optimizations where spurious `false` return values by this function do not
/// affect the outcome, but just the performance.
/// The consequences of using this method to make runtime and compile-time code behave
/// differently have not been explored. This method should not be used to introduce such
/// differences, and it should also not be stabilized before we have a better understanding
/// of this issue.
/// ```
#[unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
#[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
#[inline]
#[cfg(not(bootstrap))]
pub const fn guaranteed_eq(self, other: *const T) -> bool
where
T: Sized,
{
intrinsics::ptr_guaranteed_eq(self, other)
}

/// Returns whether two pointers are guaranteed to be inequal.
///
/// At runtime this function behaves like `self != other`.
/// However, in some contexts (e.g., compile-time evaluation),
/// it is not always possible to determine the inequality of two pointers, so this function may
/// spuriously return `false` for pointers that later actually turn out to be inequal.
/// But when it returns `true`, the pointers are guaranteed to be inequal.
///
/// This function is the mirror of [`guaranteed_eq`], but not its inverse. There are pointer
/// comparisons for which both functions return `false`.
///
/// [`guaranteed_eq`]: #method.guaranteed_eq
///
/// The return value may change depending on the compiler version and unsafe code may not
/// rely on the result of this function for soundness. It is suggested to only use this function
/// for performance optimizations where spurious `false` return values by this function do not
/// affect the outcome, but just the performance.
/// The consequences of using this method to make runtime and compile-time code behave
/// differently have not been explored. This method should not be used to introduce such
/// differences, and it should also not be stabilized before we have a better understanding
/// of this issue.
/// ```
#[unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
#[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
#[inline]
#[cfg(not(bootstrap))]
pub const fn guaranteed_ne(self, other: *const T) -> bool
where
T: Sized,
{
intrinsics::ptr_guaranteed_ne(self, other)
}

/// Calculates the distance between two pointers. The returned value is in
/// units of T: the distance in bytes is divided by `mem::size_of::<T>()`.
///
66 changes: 66 additions & 0 deletions src/libcore/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
@@ -273,6 +273,72 @@ impl<T: ?Sized> *mut T {
if self.is_null() { None } else { Some(&mut *self) }
}

/// Returns whether two pointers are guaranteed to be equal.
///
/// At runtime this function behaves like `self == other`.
/// However, in some contexts (e.g., compile-time evaluation),
/// it is not always possible to determine equality of two pointers, so this function may
/// spuriously return `false` for pointers that later actually turn out to be equal.
/// But when it returns `true`, the pointers are guaranteed to be equal.
///
/// This function is the mirror of [`guaranteed_ne`], but not its inverse. There are pointer
/// comparisons for which both functions return `false`.
///
/// [`guaranteed_ne`]: #method.guaranteed_ne
///
/// The return value may change depending on the compiler version and unsafe code may not
/// rely on the result of this function for soundness. It is suggested to only use this function
/// for performance optimizations where spurious `false` return values by this function do not
/// affect the outcome, but just the performance.
/// The consequences of using this method to make runtime and compile-time code behave
/// differently have not been explored. This method should not be used to introduce such
/// differences, and it should also not be stabilized before we have a better understanding
/// of this issue.
/// ```
#[unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
#[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
#[inline]
#[cfg(not(bootstrap))]
pub const fn guaranteed_eq(self, other: *mut T) -> bool
where
T: Sized,
{
intrinsics::ptr_guaranteed_eq(self as *const _, other as *const _)
}

/// Returns whether two pointers are guaranteed to be inequal.
///
/// At runtime this function behaves like `self != other`.
/// However, in some contexts (e.g., compile-time evaluation),
/// it is not always possible to determine the inequality of two pointers, so this function may
/// spuriously return `false` for pointers that later actually turn out to be inequal.
/// But when it returns `true`, the pointers are guaranteed to be inequal.
///
/// This function is the mirror of [`guaranteed_eq`], but not its inverse. There are pointer
/// comparisons for which both functions return `false`.
///
/// [`guaranteed_eq`]: #method.guaranteed_eq
///
/// The return value may change depending on the compiler version and unsafe code may not
/// rely on the result of this function for soundness. It is suggested to only use this function
/// for performance optimizations where spurious `false` return values by this function do not
/// affect the outcome, but just the performance.
/// The consequences of using this method to make runtime and compile-time code behave
/// differently have not been explored. This method should not be used to introduce such
/// differences, and it should also not be stabilized before we have a better understanding
/// of this issue.
/// ```
#[unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
#[rustc_const_unstable(feature = "const_raw_ptr_comparison", issue = "53020")]
#[inline]
#[cfg(not(bootstrap))]
pub const unsafe fn guaranteed_ne(self, other: *mut T) -> bool
where
T: Sized,
{
intrinsics::ptr_guaranteed_ne(self as *const _, other as *const _)
}

/// Calculates the distance between two pointers. The returned value is in
/// units of T: the distance in bytes is divided by `mem::size_of::<T>()`.
///
17 changes: 17 additions & 0 deletions src/libcore/slice/mod.rs
Original file line number Diff line number Diff line change
@@ -5956,10 +5956,18 @@ where
return false;
}

#[cfg(bootstrap)]
if self.as_ptr() == other.as_ptr() {
return true;
}

// While performance would suffer if `guaranteed_eq` just returned `false`
// for all arguments, correctness and return value of this function are not affected.
#[cfg(not(bootstrap))]
if self.as_ptr().guaranteed_eq(other.as_ptr()) {
return true;
}

self.iter().zip(other.iter()).all(|(x, y)| x == y)
}
}
@@ -5973,9 +5981,18 @@ where
if self.len() != other.len() {
return false;
}

#[cfg(bootstrap)]
if self.as_ptr() == other.as_ptr() {
return true;
}

// While performance would suffer if `guaranteed_eq` just returned `false`
// for all arguments, correctness and return value of this function are not affected.
#[cfg(not(bootstrap))]
if self.as_ptr().guaranteed_eq(other.as_ptr()) {
return true;
}
unsafe {
let size = mem::size_of_val(self);
memcmp(self.as_ptr() as *const u8, other.as_ptr() as *const u8, size) == 0
12 changes: 11 additions & 1 deletion src/librustc_codegen_llvm/intrinsic.rs
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ use log::debug;
use rustc_ast::ast;
use rustc_codegen_ssa::base::{compare_simd_types, to_immediate, wants_msvc_seh};
use rustc_codegen_ssa::common::span_invalid_monomorphization_error;
use rustc_codegen_ssa::common::TypeKind;
use rustc_codegen_ssa::common::{IntPredicate, TypeKind};
use rustc_codegen_ssa::glue;
use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
use rustc_codegen_ssa::mir::place::PlaceRef;
@@ -731,6 +731,16 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> {
return;
}

"ptr_guaranteed_eq" | "ptr_guaranteed_ne" => {
let a = args[0].immediate();
let b = args[1].immediate();
if name == "ptr_guaranteed_eq" {
self.icmp(IntPredicate::IntEQ, a, b)
} else {
self.icmp(IntPredicate::IntNE, a, b)
}
}

"ptr_offset_from" => {
let ty = substs.type_at(0);
let pointee_size = self.size_of(ty);
3 changes: 0 additions & 3 deletions src/librustc_feature/active.rs
Original file line number Diff line number Diff line change
@@ -401,9 +401,6 @@ declare_features! (
/// Allows dereferencing raw pointers during const eval.
(active, const_raw_ptr_deref, "1.27.0", Some(51911), None),

/// Allows comparing raw pointers during const eval.
(active, const_compare_raw_pointers, "1.27.0", Some(53020), None),

/// Allows `#[doc(alias = "...")]`.
(active, doc_alias, "1.27.0", Some(50146), None),

5 changes: 5 additions & 0 deletions src/librustc_feature/removed.rs
Original file line number Diff line number Diff line change
@@ -113,6 +113,11 @@ declare_features! (
Some("removed in favor of `#![feature(marker_trait_attr)]`")),
/// Allows `#[no_debug]`.
(removed, no_debug, "1.43.0", Some(29721), None, Some("removed due to lack of demand")),

/// Allows comparing raw pointers during const eval.
(removed, const_compare_raw_pointers, "1.46.0", Some(53020), None,
Some("cannot be allowed in const eval in any meaningful way")),

// -------------------------------------------------------------------------
// feature-group-end: removed features
// -------------------------------------------------------------------------
5 changes: 5 additions & 0 deletions src/librustc_mir/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
@@ -296,6 +296,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
let offset_ptr = ptr.ptr_wrapping_signed_offset(offset_bytes, self);
self.write_scalar(offset_ptr, dest)?;
}
sym::ptr_guaranteed_eq | sym::ptr_guaranteed_ne => {
// FIXME: return `true` for at least some comparisons where we can reliably
// determine the result of runtime (in)equality tests at compile-time.
self.write_scalar(Scalar::from_bool(false), dest)?;
}
sym::ptr_offset_from => {
let a = self.read_immediate(args[0])?.to_scalar()?;
let b = self.read_immediate(args[1])?.to_scalar()?;
20 changes: 9 additions & 11 deletions src/librustc_mir/transform/check_consts/ops.rs
Original file line number Diff line number Diff line change
@@ -296,18 +296,16 @@ impl NonConstOp for Panic {
#[derive(Debug)]
pub struct RawPtrComparison;
impl NonConstOp for RawPtrComparison {
fn feature_gate() -> Option<Symbol> {
Some(sym::const_compare_raw_pointers)
}

fn emit_error(&self, ccx: &ConstCx<'_, '_>, span: Span) {
feature_err(
&ccx.tcx.sess.parse_sess,
sym::const_compare_raw_pointers,
span,
&format!("comparing raw pointers inside {}", ccx.const_kind()),
)
.emit();
let mut err = ccx
.tcx
.sess
.struct_span_err(span, "pointers cannot be reliably compared during const eval.");
err.note(
"see issue #53020 <https://github.com/rust-lang/rust/issues/53020> \
for more information",
);
err.emit();
}
}

15 changes: 0 additions & 15 deletions src/librustc_mir/transform/check_unsafety.rs
Original file line number Diff line number Diff line change
@@ -171,21 +171,6 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> {
_ => {}
}
}
// raw pointer and fn pointer operations are unsafe as it is not clear whether one
// pointer would be "less" or "equal" to another, because we cannot know where llvm
// or the linker will place various statics in memory. Without this information the
// result of a comparison of addresses would differ between runtime and compile-time.
Rvalue::BinaryOp(_, ref lhs, _)
if self.const_context && self.tcx.features().const_compare_raw_pointers =>
{
if let ty::RawPtr(_) | ty::FnPtr(..) = lhs.ty(self.body, self.tcx).kind {
self.require_unsafe(
"pointer operation",
"operations on pointers in constants",
UnsafetyViolationKind::General,
);
}
}
_ => {}
}
self.super_rvalue(rvalue, location);
2 changes: 2 additions & 0 deletions src/librustc_span/symbol.rs
Original file line number Diff line number Diff line change
@@ -588,6 +588,8 @@ symbols! {
proc_macro_non_items,
proc_macro_path_invoc,
profiler_runtime,
ptr_guaranteed_eq,
ptr_guaranteed_ne,
ptr_offset_from,
pub_restricted,
pure,
9 changes: 6 additions & 3 deletions src/librustc_typeck/check/intrinsic.rs
Original file line number Diff line number Diff line change
@@ -74,9 +74,8 @@ pub fn intrinsic_operation_unsafety(intrinsic: &str) -> hir::Unsafety {
| "wrapping_add" | "wrapping_sub" | "wrapping_mul" | "saturating_add"
| "saturating_sub" | "rotate_left" | "rotate_right" | "ctpop" | "ctlz" | "cttz"
| "bswap" | "bitreverse" | "discriminant_value" | "type_id" | "likely" | "unlikely"
| "minnumf32" | "minnumf64" | "maxnumf32" | "maxnumf64" | "type_name" => {
hir::Unsafety::Normal
}
| "ptr_guaranteed_eq" | "ptr_guaranteed_ne" | "minnumf32" | "minnumf64" | "maxnumf32"
| "maxnumf64" | "type_name" => hir::Unsafety::Normal,
_ => hir::Unsafety::Unsafe,
}
}
@@ -258,6 +257,10 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
(1, vec![param(0), param(0)], tcx.intern_tup(&[param(0), tcx.types.bool]))
}

"ptr_guaranteed_eq" | "ptr_guaranteed_ne" => {
(1, vec![tcx.mk_imm_ptr(param(0)), tcx.mk_imm_ptr(param(0))], tcx.types.bool)
}

"ptr_offset_from" => {
(1, vec![tcx.mk_imm_ptr(param(0)), tcx.mk_imm_ptr(param(0))], tcx.types.isize)
}
Loading