Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/rust
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 663d2f5cd3163f17eddb74ee1e028d542255f21a
Choose a base ref
...
head repository: rust-lang/rust
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5180f3da5fd72627a8d38558ad1297df38793acd
Choose a head ref

Commits on Aug 1, 2020

  1. Document that slice means pointer to a sequence

    Also document that slices are twice as large as pointers to Sized types
    LeonMatthes committed Aug 1, 2020
    Copy the full SHA
    e6c83dd View commit details
  2. Add missing period

    LeonMatthes committed Aug 1, 2020
    Copy the full SHA
    a9af93b View commit details
  3. Add missing import to Rc

    LeonMatthes committed Aug 1, 2020
    Copy the full SHA
    41d3e1c View commit details

Commits on Aug 18, 2020

  1. Copy the full SHA
    c4fb3f2 View commit details

Commits on Aug 22, 2020

  1. Copy the full SHA
    a2a387c View commit details
  2. Copy the full SHA
    1241f19 View commit details
  3. Copy the full SHA
    7ad4369 View commit details
  4. stabilize ptr_offset_from

    RalfJung committed Aug 22, 2020
    Copy the full SHA
    0e4f335 View commit details
  5. Copy the full SHA
    4f92f0d View commit details
  6. Copy the full SHA
    9a12d9a View commit details
  7. Copy the full SHA
    df57e28 View commit details
  8. Copy the full SHA
    15643d5 View commit details
  9. Copy the full SHA
    6a5e657 View commit details
  10. Copy the full SHA
    3cd450e View commit details
  11. Copy the full SHA
    23e08e2 View commit details
  12. Copy the full SHA
    c8a372e View commit details
  13. Copy the full SHA
    b65daa7 View commit details
  14. Don't make clang use gcc's include-fixed

    This was breaking `#include_next <limits.h>`, such that we weren't
    getting definitions of `PATH_MAX` and `_POSIX_ARG_MAX`.
    cuviper committed Aug 22, 2020
    Copy the full SHA
    df4bafc View commit details
  15. Upgrade to LLVM 11 (rc2)

    cuviper committed Aug 22, 2020
    Copy the full SHA
    636ca7a View commit details
  16. Copy the full SHA
    a210a29 View commit details
  17. Apply suggestions from code review

    Flatten the INC definition to one line.
    
    Co-authored-by: lzutao <taolzu@gmail.com>
    cuviper and tesuji committed Aug 22, 2020
    Copy the full SHA
    5c87749 View commit details
  18. Match scalar-pair-bool more flexibly for LLVM 11

    LLVM 11 started using `phi` and `select` for `fn pair_i32_bool`, which
    is still valid, but harder to match than the simple instructions we were
    getting before. We'll just check that the unpacked args are directly
    referenced in any way, and call it good.
    cuviper committed Aug 22, 2020
    Copy the full SHA
    fb05be0 View commit details
  19. Copy the full SHA
    b450c0c View commit details
  20. Recursively expand TokenKind::Interpolated (take 2)

    Fixes #68430
    
    This is a re-attempt of PR #72388, which was previously reverted due to
    a large number of breakages. All of the known breakages should now be
    patched upstream.
    Aaron1011 committed Aug 22, 2020
    Copy the full SHA
    cd24aee View commit details
  21. Copy the full SHA
    0fcad9c View commit details
  22. Use smaller def span for functions

    Currently, the def span of a funtion encompasses the entire function
    signature and body. However, this is usually unnecessarily verbose - when we are
    pointing at an entire function in a diagnostic, we almost always want to
    point at the signature. The actual contents of the body tends to be
    irrelevant to the diagnostic we are emitting, and just takes up
    additional screen space.
    
    This commit changes the `def_span` of all function items (freestanding
    functions, `impl`-block methods, and `trait`-block methods) to be the
    span of the signature. For example, the function
    
    ```rust
    pub fn foo<T>(val: T) -> T { val }
    ```
    
    now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T`
    (everything before the opening curly brace).
    
    Trait methods without a body have a `def_span` which includes the
    trailing semicolon. For example:
    
    ```rust
    trait Foo {
        fn bar();
    }```
    
    the function definition `Foo::bar` has a `def_span` of `fn bar();`
    
    This makes our diagnostic output much shorter, and emphasizes
    information that is relevant to whatever diagnostic we are reporting.
    
    We continue to use the full span (including the body) in a few of
    places:
    
    * MIR building uses the full span when building source scopes.
    * 'Outlives suggestions' use the full span to sort the diagnostics being
      emitted.
    * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]`
    attribute points the entire scope body.
    * The 'unconditional recursion' lint uses the full span to show
      additional context for the recursive call.
    
    All of these cases work only with local items, so we don't need to
    add anything extra to crate metadata.
    Aaron1011 committed Aug 22, 2020
    Copy the full SHA
    e3cd43e View commit details

Commits on Aug 23, 2020

  1. Auto merge of #73084 - Aaron1011:feature/new-recursive-expand, r=petr…

    …ochenkov
    
    Re-land PR #72388:  Recursively expand `TokenKind::Interpolated` in `probably_equal_for_proc_macro`
    
    PR #72388 allowed us to preserve the original `TokenStream` in more cases during proc-macro expansion, but had to be reverted due to a large number of regressions (See #72545 and #72622). These regressions fell into two categories
    
    1. Missing handling for `Group`s with `Delimiter::None`, which are inserted during `macro_rules!` expansion (but are lost during stringification and re-parsing). A large number of these regressions were due to `syn` and `proc-macro-hack`, but several crates needed changes to their own proc-macro code.
    2. Legitimate hygiene issues that were previously being masked by stringification. Some of these were relatively benign (e.g. [a compiliation error](paritytech/parity-scale-codec#210) caused by misusing `quote_spanned!`). However, two crates had intentionally written unhygenic `macro_rules!` macros, which were able to access identifiers that were not passed as arguments (see #72622 (comment)).
    
    All but one of the Crater regressions have now been fixed upstream (see https://hackmd.io/ItrXWRaSSquVwoJATPx3PQ?both). The remaining crate (which has a PR pending at sammhicks/face-generator#1) is not on `crates.io`, and is a Yew application that seems unlikely to have any reverse dependencies.
    
    As @petrochenkov mentioned in #72545 (comment), not re-landing PR #72388 allows more crates to write unhygenic `macro_rules!` macros, which will eventually stop compiling. Since there is only one Crater regression remaining, since additional crates could write unhygenic `macro_rules!` macros in the time it takes that PR to be merged.
    bors committed Aug 23, 2020
    Copy the full SHA
    e482c86 View commit details
  2. Auto merge of #73526 - cuviper:rust-llvm11, r=nikic

    Upgrade to LLVM 11 (rc2)
    
    This builds on #73525 to try actually moving rust-lang/llvm-project to LLVM 11.
    bors committed Aug 23, 2020
    Copy the full SHA
    7ce71c3 View commit details
  3. Auto merge of #75813 - petrochenkov:feature/incr-def-path-table, r=Aa…

    …ron1011
    
    Lazy decoding of DefPathTable from crate metadata (non-incremental case)
    
    The is the half of #74967 that doesn't touch incremental-related structures.
    We are still decoding def path hashes eagerly if we are in incremental mode.
    
    The incremental part of #74967 feels hacky, but I'm not qualified enough to suggest improvements. I'll reassign it so someone else once this PR lands.
    @Aaron1011, I wasn't asking you to do this split because I wasn't sure that it's feasible (or simple to do).
    
    r? @Aaron1011
    bors committed Aug 23, 2020
    Copy the full SHA
    d5abc8d View commit details
  4. Auto merge of #75465 - Aaron1011:feature/short-fn-def-span, r=estebank

    Use smaller def span for functions
    
    Currently, the def span of a function encompasses the entire function
    signature and body. However, this is usually unnecessarily verbose - when we are
    pointing at an entire function in a diagnostic, we almost always want to
    point at the signature. The actual contents of the body tends to be
    irrelevant to the diagnostic we are emitting, and just takes up
    additional screen space.
    
    This commit changes the `def_span` of all function items (freestanding
    functions, `impl`-block methods, and `trait`-block methods) to be the
    span of the signature. For example, the function
    
    ```rust
    pub fn foo<T>(val: T) -> T { val }
    ```
    
    now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T`
    (everything before the opening curly brace).
    
    Trait methods without a body have a `def_span` which includes the
    trailing semicolon. For example:
    
    ```rust
    trait Foo {
        fn bar();
    }
    ```
    
    the function definition `Foo::bar` has a `def_span` of `fn bar();`
    
    This makes our diagnostic output much shorter, and emphasizes
    information that is relevant to whatever diagnostic we are reporting.
    
    We continue to use the full span (including the body) in a few of
    places:
    
    * MIR building uses the full span when building source scopes.
    * 'Outlives suggestions' use the full span to sort the diagnostics being
      emitted.
    * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]`
    attribute points the entire scope body.
    
    All of these cases work only with local items, so we don't need to
    add anything extra to crate metadata.
    bors committed Aug 23, 2020
    Copy the full SHA
    d5ba3ef View commit details
  5. Auto merge of #75789 - matthiaskrgr:clippy_compiletest, r=Dylan-DPC

    compiletest: fix a couple clippy lint findings
    bors committed Aug 23, 2020
    Copy the full SHA
    2342cc3 View commit details
  6. Auto merge of #75816 - LeSeulArtichaut:core-intra-docs, r=jyn514

    Use intra-doc-links in `core::{raw, ffi, pin}`
    
    Helps with #75080.
    r? @jyn514
    bors committed Aug 23, 2020
    Copy the full SHA
    b88434e View commit details
  7. Revert changed paragraph about slice definition.

    This reverts part of commit e6c83dd.
    As requested by @steveklabnik .
    LeonMatthes committed Aug 23, 2020
    Copy the full SHA
    cf76256 View commit details
  8. Copy the full SHA
    eb27828 View commit details
  9. bump stable version

    Co-authored-by: Josh Stone <cuviper@gmail.com>
    RalfJung and cuviper committed Aug 23, 2020
    Copy the full SHA
    4129e07 View commit details
  10. Auto merge of #74238 - RalfJung:offset_from, r=oli-obk

    stabilize ptr_offset_from
    
    This stabilizes ptr::offset_from, and closes #41079. It also removes the deprecated `wrapping_offset_from`. This function was deprecated 19 days ago and was never stable; given an FCP of 10 days and some waiting time until FCP starts, that leaves at least a month between deprecation and removal which I think is fine for a nightly-only API.
    
    Regarding the open questions in #41079:
    * Should offset_from abort instead of panic on ZSTs? -- As far as I know, there is no precedent for such aborts. We could, however, declare this UB. Given that the size is always known statically and the check thus rather cheap, UB seems excessive.
    * Should there be more methods like this with different restrictions (to allow nuw/nsw, perhaps) or that return usize (like how isize-taking offset is more conveniently done with usize-taking add these days)? -- No reason to block stabilization on that, we can always add such methods later.
    
    Also nominating the lang team because this exposes an intrinsic.
    
    The stabilized method is best described [by its doc-comment](https://github.com/RalfJung/rust/blob/56d4b2d69abb93e4f0ca79471deca7aaaaeca214/src/libcore/ptr/const_ptr.rs#L227). The documentation forgot to mention the requirement that both pointers must "have the same provenance", aka "be derived from pointers to the same allocation", which I am adding in this PR. This is a precondition that [Miri already implements](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=a3b9d0a07a01321f5202cd99e9613480) and that, should LLVM ever obtain a `psub` operation to subtract pointers, will likely be required for that operation (following the semantics in [this paper](https://people.mpi-sws.org/~jung/twinsem/twinsem.pdf)).
    bors committed Aug 23, 2020
    Copy the full SHA
    9d606d9 View commit details
  11. Auto merge of #75028 - MrModder:master, r=steveklabnik

    Document that slice refers to any pointer type to a sequence
    
    I was recently confused about the way slices are represented in memory. The necessary information was not available in the std-docs directly, but was a mix of different material from the reference and book.
    
    This PR should clear up the definition of slices a bit more in the documentation. Especially the fact that the term slice refers to the pointer/reference type, e.g. `&[T]`, and not `[T]`.
    It also documents that slice pointers are twice the size of pointers to `Sized` types, as this concept may be unfamiliar to users coming from other languages that do not have the concept of "fat pointers" (especially C/C++).
    
    I've documented why this was important to me and my findings in [this blog post](https://codecrash.me/understanding-rust-slices).
    
    r? @lcnr
    bors committed Aug 23, 2020
    Copy the full SHA
    d02a209 View commit details
  12. Fix compile-flags directive

    Co-authored-by: Ralf Jung <post@ralfj.de>
    ecstatic-morse and RalfJung authored Aug 23, 2020
    Copy the full SHA
    130766c View commit details
  13. Auto merge of #72449 - ecstatic-morse:const-float-bitcast, r=RalfJung

    Const floating point bitcasts and classification
    
    Makes the `f32` and `f64` methods described in #72447 and #72505 unstably const.
    
    r? @RalfJung
    bors committed Aug 23, 2020
    Copy the full SHA
    0ec9459 View commit details
  14. Auto merge of #75656 - tirr-c:match-suggest-semi, r=estebank

    Provide better spans for the match arm without tail expression
    
    Resolves #75418.
    
    Applied the same logic in the `if`-`else` type mismatch case.
    
    r? @estebank
    bors committed Aug 23, 2020
    Copy the full SHA
    5180f3d View commit details
Showing with 1,299 additions and 1,099 deletions.
  1. +1 −1 .gitmodules
  2. +0 −1 library/alloc/src/lib.rs
  3. +0 −2 library/core/src/ffi.rs
  4. +2 −0 library/core/src/lib.rs
  5. +33 −17 library/core/src/num/f32.rs
  6. +33 −17 library/core/src/num/f64.rs
  7. +14 −31 library/core/src/pin.rs
  8. +23 −63 library/core/src/ptr/const_ptr.rs
  9. +23 −60 library/core/src/ptr/mut_ptr.rs
  10. +1 −1 library/core/src/raw.rs
  11. +1 −1 library/std/src/lib.rs
  12. +14 −0 library/std/src/primitive_docs.rs
  13. +1 −11 src/ci/docker/host-x86_64/dist-x86_64-linux/build-clang.sh
  14. +1 −0 src/librustc_ast/ast.rs
  15. +2 −1 src/librustc_ast/mut_visit.rs
  16. +28 −1 src/librustc_ast/token.rs
  17. +12 −3 src/librustc_ast_lowering/item.rs
  18. +1 −0 src/librustc_builtin_macros/deriving/generic/mod.rs
  19. +1 −1 src/librustc_builtin_macros/global_allocator.rs
  20. +1 −1 src/librustc_builtin_macros/test_harness.rs
  21. +13 −7 src/librustc_expand/proc_macro_server.rs
  22. +18 −12 src/librustc_hir/definitions.rs
  23. +1 −0 src/librustc_hir/hir.rs
  24. +9 −0 src/librustc_infer/infer/error_reporting/mod.rs
  25. +71 −50 src/librustc_metadata/rmeta/decoder.rs
  26. +6 −3 src/librustc_metadata/rmeta/decoder/cstore_impl.rs
  27. +9 −6 src/librustc_metadata/rmeta/encoder.rs
  28. +8 −2 src/librustc_metadata/rmeta/mod.rs
  29. +5 −0 src/librustc_metadata/rmeta/table.rs
  30. +26 −3 src/librustc_middle/hir/map/mod.rs
  31. +3 −2 src/librustc_middle/middle/cstore.rs
  32. +1 −0 src/librustc_middle/traits/mod.rs
  33. +6 −13 src/librustc_middle/ty/context.rs
  34. +1 −1 src/librustc_mir/borrow_check/diagnostics/outlives_suggestion.rs
  35. +20 −7 src/librustc_mir_build/build/mod.rs
  36. +1 −1 src/librustc_mir_build/lints.rs
  37. +40 −13 src/librustc_parse/lib.rs
  38. +14 −4 src/librustc_parse/parser/item.rs
  39. +1 −1 src/librustc_save_analysis/sig.rs
  40. +0 −7 src/librustc_session/session.rs
  41. +2 −0 src/librustc_span/symbol.rs
  42. +10 −9 src/librustc_trait_selection/traits/error_reporting/mod.rs
  43. +28 −22 src/librustc_typeck/check/_match.rs
  44. +1 −1 src/librustc_typeck/collect.rs
  45. +4 −4 src/librustdoc/core.rs
  46. +0 −1 src/librustdoc/lib.rs
  47. +1 −1 src/llvm-project
  48. +9 −7 src/rustllvm/CoverageMappingWrapper.cpp
  49. +16 −15 src/test/assembly/asm/riscv-types.rs
  50. +3 −2 src/test/codegen/scalar-pair-bool.rs
  51. +1 −1 src/test/run-make-fulldeps/instrument-coverage/expected_export_coverage.json
  52. +1 −1 src/test/ui/associated-types/bound-lifetime-in-binding-only.ok.stderr
  53. +1 −1 src/test/ui/associated-types/bound-lifetime-in-return-only.ok.stderr
  54. +1 −1 src/test/ui/associated-types/cache/project-fn-ret-contravariant.ok.stderr
  55. +1 −1 src/test/ui/associated-types/cache/project-fn-ret-contravariant.oneuse.stderr
  56. +1 −1 src/test/ui/associated-types/cache/project-fn-ret-invariant.ok.stderr
  57. +2 −5 src/test/ui/associated-types/higher-ranked-projection.good.stderr
  58. +4 −16 src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-no-fg.stderr
  59. +6 −9 src/test/ui/block-result/issue-20862.stderr
  60. +2 −2 src/test/ui/codemap_tests/coherence-overlapping-inherent-impl-trait.stderr
  61. +6 −6 src/test/ui/codemap_tests/overlapping_inherent_impls.stderr
  62. +2 −2 src/test/ui/coherence/coherence-inherited-subtyping.old.stderr
  63. +2 −2 src/test/ui/coherence/coherence-inherited-subtyping.re.stderr
  64. +4 −4 src/test/ui/coherence/coherence-overlap-downstream-inherent.stderr
  65. +2 −2 src/test/ui/coherence/coherence-overlap-issue-23516-inherent.stderr
  66. +2 −2 src/test/ui/coherence/coherence-overlap-upstream-inherent.stderr
  67. +93 −0 src/test/ui/consts/const-float-bits-conv.rs
  68. +77 −0 src/test/ui/consts/const-float-classify.rs
  69. +0 −1 src/test/ui/consts/offset.rs
  70. +0 −1 src/test/ui/consts/offset_from.rs
  71. +0 −1 src/test/ui/consts/offset_from_ub.rs
  72. +10 −10 src/test/ui/consts/offset_from_ub.stderr
  73. +2 −4 src/test/ui/duplicate/dupe-symbols-1.stderr
  74. +2 −4 src/test/ui/duplicate/dupe-symbols-2.stderr
  75. +2 −4 src/test/ui/duplicate/dupe-symbols-3.stderr
  76. +1 −1 src/test/ui/duplicate/dupe-symbols-4.stderr
  77. +2 −4 src/test/ui/duplicate/dupe-symbols-5.stderr
  78. +1 −1 src/test/ui/duplicate/dupe-symbols-7.stderr
  79. +2 −7 src/test/ui/duplicate/dupe-symbols-8.stderr
  80. +2 −5 src/test/ui/duplicate_entry_error.stderr
  81. +1 −1 src/test/ui/error-codes/E0445.stderr
  82. +4 −6 src/test/ui/error-codes/E0446.stderr
  83. +2 −8 src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr
  84. +2 −8 src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_a.stderr
  85. +2 −8 src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_b.stderr
  86. +2 −8 src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr
  87. +2 −8 src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr
  88. +2 −8 src/test/ui/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.stderr
  89. +2 −8 src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr
  90. +2 −8 src/test/ui/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr
  91. +2 −8 src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_x.stderr
  92. +1 −2 src/test/ui/hrtb/issue-58451.stderr
  93. +2 −7 src/test/ui/infinite/infinite-instantiation.stderr
  94. +2 −4 src/test/ui/issues/issue-16683.stderr
  95. +4 −16 src/test/ui/issues/issue-17740.stderr
  96. +2 −5 src/test/ui/issues/issue-17758.stderr
  97. +4 −12 src/test/ui/issues/issue-17905-2.stderr
  98. +8 −32 src/test/ui/issues/issue-20831-debruijn.stderr
  99. +2 −6 src/test/ui/issues/issue-22638.stderr
  100. +1 −1 src/test/ui/issues/issue-30079.stderr
  101. +4 −8 src/test/ui/issues/issue-33140.stderr
  102. +2 −4 src/test/ui/issues/issue-37311-type-length-limit/issue-37311.stderr
  103. +2 −7 src/test/ui/issues/issue-37884.stderr
  104. +1 −5 src/test/ui/issues/issue-67552.stderr
  105. +2 −4 src/test/ui/issues/issue-8727.stderr
  106. +1 −1 src/test/ui/marker_trait_attr/marker-trait-with-associated-items.stderr
  107. +42 −0 src/test/ui/match/match-incompat-type-semi.rs
  108. +74 −0 src/test/ui/match/match-incompat-type-semi.stderr
  109. +2 −5 src/test/ui/nll/issue-52742.stderr
  110. +2 −4 src/test/ui/nll/issue-55394.stderr
  111. +4 −8 src/test/ui/nll/type-alias-free-regions.stderr
  112. +0 −2 src/test/ui/offset_from.rs
  113. +2 −5 src/test/ui/panic-handler/panic-handler-bad-signature-4.stderr
  114. +4 −8 src/test/ui/panic-handler/panic-handler-duplicate.stderr
  115. +2 −4 src/test/ui/panic-handler/panic-handler-std.stderr
  116. +2 −2 src/test/ui/privacy/private-in-public-lint.stderr
  117. +1 −1 src/test/ui/privacy/private-in-public-non-principal.stderr
  118. +5 −5 src/test/ui/privacy/private-in-public-warn.stderr
  119. +21 −21 src/test/ui/privacy/private-in-public.stderr
  120. +1 −1 src/test/ui/privacy/pub-priv-dep/pub-priv1.stderr
  121. +2 −2 src/test/ui/privacy/restricted/private-in-public.stderr
  122. +13 −0 src/test/ui/proc-macro/group-compat-hack/auxiliary/group-compat-hack.rs
  123. +30 −0 src/test/ui/proc-macro/group-compat-hack/group-compat-hack.rs
  124. +3 −0 src/test/ui/proc-macro/group-compat-hack/group-compat-hack.stdout
  125. +7 −0 src/test/ui/proc-macro/group-compat-hack/js-sys/src/lib.rs
  126. +7 −0 src/test/ui/proc-macro/group-compat-hack/time-macros-impl/src/lib.rs
  127. +26 −14 src/test/ui/proc-macro/input-interpolated.stdout
  128. +2 −3 src/test/ui/proc-macro/macro-rules-derive.rs
  129. +8 −3 src/test/ui/proc-macro/macro-rules-derive.stderr
  130. +1 −1 src/test/ui/proc-macro/no-macro-use-attr.stderr
  131. +49 −38 src/test/ui/proc-macro/nodelim-groups.stdout
  132. +2 −4 src/test/ui/proc-macro/weird-hygiene.rs
  133. +25 −0 src/test/ui/proc-macro/weird-hygiene.stderr
  134. +2 −7 src/test/ui/recursion/recursion.stderr
  135. +2 −8 src/test/ui/regions/regions-infer-paramd-indirect.stderr
  136. +4 −12 src/test/ui/regions/regions-normalize-in-where-clause-list.stderr
  137. +2 −4 src/test/ui/regions/regions-trait-1.stderr
  138. +4 −6 src/test/ui/rfc-2091-track-caller/error-with-main.stderr
  139. +4 −6 src/test/ui/rfc-2091-track-caller/error-with-start.stderr
  140. +1 −1 src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.gated.stderr
  141. +1 −1 src/test/ui/rfc-2632-const-trait-impl/feature-gate.gated.stderr
  142. +2 −8 src/test/ui/rfc1445/feature-gate.with_gate.stderr
  143. +1 −1 src/test/ui/rfcs/rfc-2396-target_feature-11/feature-gate-target_feature_11.stderr
  144. +1 −1 src/test/ui/rfcs/rfc-2396-target_feature-11/trait-impl.stderr
  145. +2 −4 src/test/ui/rustc-error.stderr
  146. +2 −2 src/test/ui/specialization/specialization-overlap-hygiene.stderr
  147. +1 −1 src/test/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.stderr
  148. +5 −19 src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr
  149. +4 −15 src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
  150. +2 −2 src/test/ui/target-feature/invalid-attribute.stderr
  151. +2 −2 src/test/ui/traits/trait-object-auto-dedup-in-impl.stderr
  152. +4 −8 src/test/ui/type-alias-impl-trait/different_defining_uses.stderr
  153. +8 −16 src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.stderr
  154. +4 −8 src/test/ui/type-alias-impl-trait/generic_different_defining_uses.stderr
  155. +4 −9 src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.stderr
  156. +4 −9 src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.stderr
  157. +4 −9 src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.stderr
  158. +4 −9 src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.stderr
  159. +4 −9 src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.stderr
  160. +4 −8 src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.stderr
  161. +1 −1 src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.stderr
  162. +4 −8 src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr
  163. +4 −4 src/test/ui/ufcs/ufcs-explicit-self-bad.stderr
  164. +1 −1 src/tools/compiletest/src/errors.rs
  165. +6 −12 src/tools/compiletest/src/header.rs
  166. +1 −1 src/tools/compiletest/src/json.rs
  167. +17 −23 src/tools/compiletest/src/main.rs
  168. +25 −26 src/tools/compiletest/src/runtest.rs
  169. +9 −9 src/tools/compiletest/src/util.rs
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
[submodule "src/llvm-project"]
path = src/llvm-project
url = https://github.com/rust-lang/llvm-project.git
branch = rustc/10.0-2020-05-05
branch = rustc/11.0-2020-08-20
[submodule "src/doc/embedded-book"]
path = src/doc/embedded-book
url = https://github.com/rust-embedded/book.git
1 change: 0 additions & 1 deletion library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -113,7 +113,6 @@
#![feature(or_patterns)]
#![feature(pattern)]
#![feature(ptr_internals)]
#![feature(ptr_offset_from)]
#![feature(raw_ref_op)]
#![feature(rustc_attrs)]
#![feature(receiver_trait)]
2 changes: 0 additions & 2 deletions library/core/src/ffi.rs
Original file line number Diff line number Diff line change
@@ -281,8 +281,6 @@ impl<'a, 'f: 'a> DerefMut for VaList<'a, 'f> {
// improving this.
mod sealed_trait {
/// Trait which permits the allowed types to be used with [VaList::arg].
///
/// [VaList::arg]: ../struct.VaList.html#method.arg
#[unstable(
feature = "c_variadic",
reason = "the `c_variadic` feature has not been properly tested on \
2 changes: 2 additions & 0 deletions library/core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -73,6 +73,8 @@
#![feature(const_discriminant)]
#![feature(const_checked_int_methods)]
#![feature(const_euclidean_int_methods)]
#![feature(const_float_classify)]
#![feature(const_float_bits_conv)]
#![feature(const_overflowing_int_methods)]
#![feature(const_int_unchecked_arith)]
#![feature(const_int_pow)]
50 changes: 33 additions & 17 deletions library/core/src/num/f32.rs
Original file line number Diff line number Diff line change
@@ -381,16 +381,18 @@ impl f32 {
/// assert!(!f.is_nan());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub fn is_nan(self) -> bool {
pub const fn is_nan(self) -> bool {
self != self
}

// FIXME(#50145): `abs` is publicly unavailable in libcore due to
// concerns about portability, so this implementation is for
// private use internally.
#[inline]
fn abs_private(self) -> f32 {
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
const fn abs_private(self) -> f32 {
f32::from_bits(self.to_bits() & 0x7fff_ffff)
}

@@ -410,8 +412,9 @@ impl f32 {
/// assert!(neg_inf.is_infinite());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub fn is_infinite(self) -> bool {
pub const fn is_infinite(self) -> bool {
self.abs_private() == Self::INFINITY
}

@@ -430,8 +433,9 @@ impl f32 {
/// assert!(!neg_inf.is_finite());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub fn is_finite(self) -> bool {
pub const fn is_finite(self) -> bool {
// There's no need to handle NaN separately: if self is NaN,
// the comparison is not true, exactly as desired.
self.abs_private() < Self::INFINITY
@@ -457,9 +461,10 @@ impl f32 {
/// ```
/// [subnormal]: https://en.wikipedia.org/wiki/Denormal_number
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub fn is_normal(self) -> bool {
self.classify() == FpCategory::Normal
pub const fn is_normal(self) -> bool {
matches!(self.classify(), FpCategory::Normal)
}

/// Returns the floating point category of the number. If only one property
@@ -476,7 +481,8 @@ impl f32 {
/// assert_eq!(inf.classify(), FpCategory::Infinite);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn classify(self) -> FpCategory {
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
pub const fn classify(self) -> FpCategory {
const EXP_MASK: u32 = 0x7f800000;
const MAN_MASK: u32 = 0x007fffff;

@@ -501,8 +507,9 @@ impl f32 {
/// assert!(!g.is_sign_positive());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub fn is_sign_positive(self) -> bool {
pub const fn is_sign_positive(self) -> bool {
!self.is_sign_negative()
}

@@ -517,8 +524,9 @@ impl f32 {
/// assert!(g.is_sign_negative());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub fn is_sign_negative(self) -> bool {
pub const fn is_sign_negative(self) -> bool {
// IEEE754 says: isSignMinus(x) is true if and only if x has negative sign. isSignMinus
// applies to zeros and NaNs as well.
self.to_bits() & 0x8000_0000 != 0
@@ -652,8 +660,9 @@ impl f32 {
///
/// ```
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn to_bits(self) -> u32 {
pub const fn to_bits(self) -> u32 {
// SAFETY: `u32` is a plain old datatype so we can always transmute to it
unsafe { mem::transmute(self) }
}
@@ -695,8 +704,9 @@ impl f32 {
/// assert_eq!(v, 12.5);
/// ```
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn from_bits(v: u32) -> Self {
pub const fn from_bits(v: u32) -> Self {
// SAFETY: `u32` is a plain old datatype so we can always transmute from it
// It turns out the safety issues with sNaN were overblown! Hooray!
unsafe { mem::transmute(v) }
@@ -712,8 +722,9 @@ impl f32 {
/// assert_eq!(bytes, [0x41, 0x48, 0x00, 0x00]);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn to_be_bytes(self) -> [u8; 4] {
pub const fn to_be_bytes(self) -> [u8; 4] {
self.to_bits().to_be_bytes()
}

@@ -727,8 +738,9 @@ impl f32 {
/// assert_eq!(bytes, [0x00, 0x00, 0x48, 0x41]);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn to_le_bytes(self) -> [u8; 4] {
pub const fn to_le_bytes(self) -> [u8; 4] {
self.to_bits().to_le_bytes()
}

@@ -755,8 +767,9 @@ impl f32 {
/// );
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn to_ne_bytes(self) -> [u8; 4] {
pub const fn to_ne_bytes(self) -> [u8; 4] {
self.to_bits().to_ne_bytes()
}

@@ -769,8 +782,9 @@ impl f32 {
/// assert_eq!(value, 12.5);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn from_be_bytes(bytes: [u8; 4]) -> Self {
pub const fn from_be_bytes(bytes: [u8; 4]) -> Self {
Self::from_bits(u32::from_be_bytes(bytes))
}

@@ -783,8 +797,9 @@ impl f32 {
/// assert_eq!(value, 12.5);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn from_le_bytes(bytes: [u8; 4]) -> Self {
pub const fn from_le_bytes(bytes: [u8; 4]) -> Self {
Self::from_bits(u32::from_le_bytes(bytes))
}

@@ -808,8 +823,9 @@ impl f32 {
/// assert_eq!(value, 12.5);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn from_ne_bytes(bytes: [u8; 4]) -> Self {
pub const fn from_ne_bytes(bytes: [u8; 4]) -> Self {
Self::from_bits(u32::from_ne_bytes(bytes))
}

50 changes: 33 additions & 17 deletions library/core/src/num/f64.rs
Original file line number Diff line number Diff line change
@@ -380,16 +380,18 @@ impl f64 {
/// assert!(!f.is_nan());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub fn is_nan(self) -> bool {
pub const fn is_nan(self) -> bool {
self != self
}

// FIXME(#50145): `abs` is publicly unavailable in libcore due to
// concerns about portability, so this implementation is for
// private use internally.
#[inline]
fn abs_private(self) -> f64 {
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
const fn abs_private(self) -> f64 {
f64::from_bits(self.to_bits() & 0x7fff_ffff_ffff_ffff)
}

@@ -409,8 +411,9 @@ impl f64 {
/// assert!(neg_inf.is_infinite());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub fn is_infinite(self) -> bool {
pub const fn is_infinite(self) -> bool {
self.abs_private() == Self::INFINITY
}

@@ -429,8 +432,9 @@ impl f64 {
/// assert!(!neg_inf.is_finite());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub fn is_finite(self) -> bool {
pub const fn is_finite(self) -> bool {
// There's no need to handle NaN separately: if self is NaN,
// the comparison is not true, exactly as desired.
self.abs_private() < Self::INFINITY
@@ -456,9 +460,10 @@ impl f64 {
/// ```
/// [subnormal]: https://en.wikipedia.org/wiki/Denormal_number
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub fn is_normal(self) -> bool {
self.classify() == FpCategory::Normal
pub const fn is_normal(self) -> bool {
matches!(self.classify(), FpCategory::Normal)
}

/// Returns the floating point category of the number. If only one property
@@ -475,7 +480,8 @@ impl f64 {
/// assert_eq!(inf.classify(), FpCategory::Infinite);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn classify(self) -> FpCategory {
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
pub const fn classify(self) -> FpCategory {
const EXP_MASK: u64 = 0x7ff0000000000000;
const MAN_MASK: u64 = 0x000fffffffffffff;

@@ -500,8 +506,9 @@ impl f64 {
/// assert!(!g.is_sign_positive());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub fn is_sign_positive(self) -> bool {
pub const fn is_sign_positive(self) -> bool {
!self.is_sign_negative()
}

@@ -524,8 +531,9 @@ impl f64 {
/// assert!(g.is_sign_negative());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub fn is_sign_negative(self) -> bool {
pub const fn is_sign_negative(self) -> bool {
self.to_bits() & 0x8000_0000_0000_0000 != 0
}

@@ -666,8 +674,9 @@ impl f64 {
///
/// ```
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn to_bits(self) -> u64 {
pub const fn to_bits(self) -> u64 {
// SAFETY: `u64` is a plain old datatype so we can always transmute to it
unsafe { mem::transmute(self) }
}
@@ -709,8 +718,9 @@ impl f64 {
/// assert_eq!(v, 12.5);
/// ```
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn from_bits(v: u64) -> Self {
pub const fn from_bits(v: u64) -> Self {
// SAFETY: `u64` is a plain old datatype so we can always transmute from it
// It turns out the safety issues with sNaN were overblown! Hooray!
unsafe { mem::transmute(v) }
@@ -726,8 +736,9 @@ impl f64 {
/// assert_eq!(bytes, [0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn to_be_bytes(self) -> [u8; 8] {
pub const fn to_be_bytes(self) -> [u8; 8] {
self.to_bits().to_be_bytes()
}

@@ -741,8 +752,9 @@ impl f64 {
/// assert_eq!(bytes, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40]);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn to_le_bytes(self) -> [u8; 8] {
pub const fn to_le_bytes(self) -> [u8; 8] {
self.to_bits().to_le_bytes()
}

@@ -769,8 +781,9 @@ impl f64 {
/// );
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn to_ne_bytes(self) -> [u8; 8] {
pub const fn to_ne_bytes(self) -> [u8; 8] {
self.to_bits().to_ne_bytes()
}

@@ -783,8 +796,9 @@ impl f64 {
/// assert_eq!(value, 12.5);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn from_be_bytes(bytes: [u8; 8]) -> Self {
pub const fn from_be_bytes(bytes: [u8; 8]) -> Self {
Self::from_bits(u64::from_be_bytes(bytes))
}

@@ -797,8 +811,9 @@ impl f64 {
/// assert_eq!(value, 12.5);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn from_le_bytes(bytes: [u8; 8]) -> Self {
pub const fn from_le_bytes(bytes: [u8; 8]) -> Self {
Self::from_bits(u64::from_le_bytes(bytes))
}

@@ -822,8 +837,9 @@ impl f64 {
/// assert_eq!(value, 12.5);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")]
#[inline]
pub fn from_ne_bytes(bytes: [u8; 8]) -> Self {
pub const fn from_ne_bytes(bytes: [u8; 8]) -> Self {
Self::from_bits(u64::from_ne_bytes(bytes))
}

Loading