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

Backport PRs to beta #36433

Merged
merged 5 commits into from
Sep 16, 2016
Merged

Backport PRs to beta #36433

merged 5 commits into from
Sep 16, 2016

Commits on Sep 12, 2016

  1. typeck: use NoExpectation to check return type of diverging fn

    This fixes rust-lang#35849, a regression introduced by the typeck refactoring
    around TyNever/!.
    Alex Burka authored and alexcrichton committed Sep 12, 2016
    Configuration menu
    Copy the full SHA
    93a2fac View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2e1b8d3 View commit details
    Browse the repository at this point in the history
  3. memrchr: Correct aligned offset computation

    The memrchr fallback did not compute the offset correctly. It was
    intentioned to land on usize-aligned addresses but did not.
    This was suspected to resulted in a crash on ARMv7 platform!
    
    This bug affected non-linux platforms.
    
    I think like this, if we have a slice with pointer `ptr` and length
    `len`, we want to find the last usize-aligned offset in the slice.
    The correct computation should be:
    
    For example if ptr = 1 and len = 6, and size_of::<usize>() is 4:
    
    [ x x x x x x ]
      1 2 3 4 5 6
            ^-- last aligned address at offset 3 from the start.
    
    The last aligned address is ptr + len - (ptr + len) % usize_size.
    
    Compute offset from the start as:
    
    offset = len - (ptr + len) % usize_size = 6 - (1 + 6) % 4 = 6 - 3 = 3.
    
    I believe the function's return value was always correct previously, if
    the platform supported unaligned addresses.
    bluss authored and alexcrichton committed Sep 12, 2016
    Configuration menu
    Copy the full SHA
    3ca48fe View commit details
    Browse the repository at this point in the history
  4. memrchr: Use a conditional instead of subtracting a complicated min

    This makes the critical calculation easier to understand.
    bluss authored and alexcrichton committed Sep 12, 2016
    Configuration menu
    Copy the full SHA
    f79ab4f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    74cf38c View commit details
    Browse the repository at this point in the history