about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-10-14Auto merge of #65240 - michaelwoerister:sp-review-3, r=Mark-Simulacrumbors-1/+1
self-profiling: Add events for metadata loading (plus a small dep-tracking optimization) This PR - adds self-profiling events related to loading things from crate metadata - makes the compiler cache the `DepNodeIndex` of upstream crates, so that they don't have to be looked up over and over. The commits are best reviewed in isolation. Self-profiling tracking issue: https://github.com/rust-lang/rust/issues/58967 r? @Mark-Simulacrum cc @wesleywiser
2019-10-13Return `false` from `needs_drop` for all zero-sized arraysDylan MacKenzie-0/+3
2019-10-13lowering: connect to parser via function pointer insteadMazdak Farrokhzad-10/+8
2019-10-13lowering: don't rely on parser directly.Mazdak Farrokhzad-6/+14
2019-10-13token: extract Nonterminal::to_tokenstream to parser.Mazdak Farrokhzad-1/+5
2019-10-13Rollup merge of #65369 - tmiasko:sanitizers-keep-names, r=varkorMazdak Farrokhzad-1/+9
Don't discard value names when using address or memory sanitizer The value names are used when reporting issues found by address sanitizer or memory sanitizer. Avoid discarding names when those sanitizers are enabled, unless explicitly requested to do otherwise.
2019-10-13Rollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichtonMazdak Farrokhzad-11/+14
Split non-CAS atomic support off into target_has_atomic_load_store This PR implements my proposed changes in https://github.com/rust-lang/rust/issues/32976#issuecomment-518542029 by removing `target_has_atomic = "cas"` and splitting `target_has_atomic` into two separate `cfg`s: * `target_has_atomic = 8/16/32/64/128`: This indicates the largest width that the target can atomically CAS (which implies support for all atomic operations). * ` target_has_atomic_load_store = 8/16/32/64/128`: This indicates the largest width that the target can support loading or storing atomically (but may not support CAS). cc #32976 r? @alexcrichton
2019-10-13refactor session::config::build_session_options_and_crate_configMazdak Farrokhzad-183/+296
2019-10-13Rollup merge of #65320 - memoryruins:const_err, r=oli-obkMazdak Farrokhzad-1/+2
Report `CONST_ERR` lint in external macros fixes #65300 fixes #61058 r? @oli-obk
2019-10-13Don't discard value names when using address or memory sanitizerTomasz Miąsko-1/+9
The value names are used when reporting issues found by address sanitizer or memory sanitizer. Avoid discarding names when those sanitizers are enabled, unless explicitly requested to do otherwise.
2019-10-13Auto merge of #65182 - anp:reify-shim, r=eddybbors-1/+43
Add `Instance::resolve_for_fn_ptr` (RFC 2091 #2/N) Supercedes: https://github.com/rust-lang/rust/pull/65082 Depends on: https://github.com/rust-lang/rust/pull/65037 Tracking issue: https://github.com/rust-lang/rust/issues/47809 [RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md) steps taken: * [x] add a `ReifyShim` that is similar to `VirtualShim` in behavior (see #54183) * [x] add `ty::Instance::resolve_for_fn_ptr` (leave `ty::Instance::resolve_vtable` alone), migrate appropriate callers * [x] `resolve_for_fn_ptr` returns the shim if calling a `#[track_caller]` function
2019-10-13ast: remove implicit pprust dependency via Display.Mazdak Farrokhzad-1/+2
Instead just use `pprust::path_to_string(..)` where needed. This has two benefits: a) The AST definition is now independent of printing it. (Therefore we get closer to extracting a data-crate.) b) Debugging should be easier as program flow is clearer.
2019-10-13Apply suggestionYuki Okushi-5/+5
2019-10-12Make trivial dropck outlives a queryMark Rousskov-6/+20
This allows caching some recursive types and getting to an error much more quickly.
2019-10-11Rollup merge of #65283 - petrochenkov:softstab2, r=estebankTyler Mandry-3/+11
stability: Do not use `buffer_lint` after lowering to HIR Fixes https://github.com/rust-lang/rust/issues/65253
2019-10-11Rollup merge of #65277 - csmoe:fix-move, r=estebankTyler Mandry-0/+4
Query generator kind for error reporting Fixes https://github.com/rust-lang/rust/pull/65166#discussion_r333114545 r? @estebank cc @cramertj
2019-10-11Rollup merge of #65263 - mbStavola:dedup-raw-item-fns, r=CentrilTyler Mandry-21/+12
Deduplicate is_{freeze,copy,sized}_raw Fixes #65259 Deduplicates `is_{freeze,copy,sized}_raw` by delegating to a new method which takes in a `LangItem`.
2019-10-11Rollup merge of #65200 - xfix:patch-20, r=GuillaumeGomezTyler Mandry-5/+9
Add ?Sized bound to a supertrait listing in E0038 error documentation This example failed to compile because of implicit `Sized` bound for `A` parameter that wasn't required by `Trait`.
2019-10-11Rollup merge of #64986 - skinny121:fn-ptr-const-generics, r=varkorTyler Mandry-140/+153
Function pointers as const generic arguments Makes function pointers as const generic arguments usable. Fixes #62395 r? @varkor
2019-10-11Report lint in external macrosmemoryruins-1/+2
2019-10-11resolve_for_fn_ptr checks that the instance is an Item before returning shim.Adam Perry-10/+12
2019-10-11Auto merge of #64716 - jonhoo:stabilize-mem-take, r=SimonSapinbors-1/+0
Stabilize mem::take (mem_take) Tracking issue: https://github.com/rust-lang/rust/issues/61129 r? @matklad
2019-10-11Change untagged_unions to not allow union fields with dropUlrik Sverdrup-1/+3
Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in ManuallyDrop. The stable rule remains, that union fields must be Copy. We use the new rule for the `untagged_union` feature. See RFC 2514. Note for ui tests: We can't test move out through Box's deref-move since we can't have a Box in a union anymore.
2019-10-11Print lifetimes with backticksYuki Okushi-3/+3
2019-10-11Add long error explanation for E0697Yuki Okushi-1/+18
2019-10-10stability: Do not use `buffer_lint` after lowering to HIRVadim Petrochenkov-3/+11
2019-10-10query generator kind for error reportingcsmoe-0/+4
2019-10-10Auto merge of #59546 - sfanxiang:interminable-ub, r=nagisabors-0/+3
Add llvm.sideeffect to potential infinite loops and recursions LLVM assumes that a thread will eventually cause side effect. This is not true in Rust if a loop or recursion does nothing in its body, causing undefined behavior even in common cases like `loop {}`. Inserting llvm.sideeffect fixes the undefined behavior. As a micro-optimization, only insert llvm.sideeffect when jumping back in blocks or calling a function. A patch for LLVM is expected to allow empty non-terminate code by default and fix this issue from LLVM side. https://github.com/rust-lang/rust/issues/28728 **UPDATE:** [Mentoring instructions here](https://github.com/rust-lang/rust/pull/59546#issuecomment-515072429) to unstall this PR
2019-10-10Instance::resolve_for_fn_ptr unconditionally resolves first.Adam Perry-9/+13
Per review feedback.
2019-10-10Improve docs for InstanceDef::ReifyShim.Adam Perry-1/+4
2019-10-10Preserve output of raw pointers in mir dump.ben-1/+8
2019-10-09Qualify LangItemMatt Stavola-1/+1
2019-10-09Delegate is_{freeze,copy,sized}_raw to is_item_rawMatt Stavola-21/+12
2019-10-10Remove `tag` from `iterate_until_fixed_point()`.Nicholas Nethercote-4/+4
The function only has one call site, so we don't need a tag argument.
2019-10-10Special-case `ReEmpty` in `expand_node()`.Nicholas Nethercote-1/+9
This wins 6% on `unicode_normalization`, by avoiding a call to `lub_concrete_regions()` and a `Region` equality test.
2019-10-10Tweak `tcx` usage in `lub_concrete_regions()`.Nicholas Nethercote-5/+3
Some places use the local `tcx` variable, some use `self.tcx()`. This commit removes the local variable so that all places use `self.tcx()`, for consistency.
2019-10-10Auto merge of #65077 - estebank:mut-trait-expected, r=nikomatsakisbors-22/+107
Note when a mutable trait object is needed Fix https://github.com/rust-lang/rust/issues/63619, fix https://github.com/rust-lang/rust/issues/37914. CC https://github.com/rust-lang/rust/issues/64068.
2019-10-09Clarify comment, dedupe match arms in shim.rs.Adam Perry-1/+3
Also add a missing terminal newline to a test.
2019-10-09Return ReifyShim from Instance::resolve_for_fn_ptr when track_caller present.Adam Perry-2/+2
This ICEs in MIR currently, which I think is to be expected since none of the MIR plumbing is set up. I added a test which confirms that the shim is being used for reifying a track_caller function.
2019-10-09Reifying callers of Instance::resolve use resolve_for_fn_ptr.Adam Perry-6/+3
2019-10-09Add Instance::resolve_for_fn_ptrAdam Perry-1/+23
2019-10-09Add InstanceDef::ReifyShim for track_caller functions.Adam Perry-1/+13
2019-10-10Auto merge of #64939 - nnethercote:snapshot-cleanups, r=nikomatsakisbors-37/+28
Snapshot clean-ups Two minor clean-ups involving snapshots.
2019-10-10Pretty print raw pointers in consts as '{pointer}'.ben-0/+1
2019-10-09Only suggest change mut if vars are resolvedEsteban Küber-0/+6
2019-10-09review commentsEsteban Küber-1/+1
2019-10-09review commentsEsteban Küber-0/+7
2019-10-09Obligation must apply modulo regionsEsteban Küber-2/+4
2019-10-09Tweak wordingEsteban Küber-1/+2
2019-10-09Note when a mutable trait object is neededEsteban Küber-21/+90