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

Rollup of 8 pull requests #99451

Merged
merged 17 commits into from
Jul 19, 2022
Merged

Rollup of 8 pull requests #99451

merged 17 commits into from
Jul 19, 2022

Commits on Jul 18, 2022

  1. Fix debuginfo tests.

    This is needed for my Ubuntu 22.04 box due to a slight change in gdb
    output. The fix is similar to the fix in rust-lang#95063.
    nnethercote committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    13bf958 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c1c1abc View commit details
    Browse the repository at this point in the history
  3. Use span_bug for unexpected field projection type

    Improves the compiler error backtrace information, as shown in rust-lang#99363,
    by using `span_bug` instead of `bug`.
    
    New output:
    
    ```
    build/aarch64-apple-darwin/stage1/bin/rustc /tmp/test.rs --edition=2021
    error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ test[db0f]::main::T::{opaque#0}), []) for `Field` projection
      --> /tmp/test.rs:11:27
       |
    11 |         let Foo((a, b)) = foo;
       |                           ^^^
    
    thread 'rustc' panicked at 'Box<dyn Any>', /Users/jmq/src/forked/rust/compiler/rustc_errors/src/lib.rs:1331:9
    stack backtrace:
    ```
    
    (Remainder of output truncated.)
    Jordan McQueen authored and Jordan McQueen committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    38f090b View commit details
    Browse the repository at this point in the history
  4. Update invalid atomic ordering lint

    The restriction that success ordering must be at least as strong as its
    failure ordering in compare-exchange operations was lifted in rust-lang#98383.
    tmiasko committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    45afc21 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f403260 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    50c612f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e52837c View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2022

  1. Configuration menu
    Copy the full SHA
    136f017 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    01b2379 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#97183 - oli-obk:tait_ice_async, r=jackh726

    wf-check generators
    
    fixes rust-lang#90409
    
    We should not rely on generators being well formed by construction now that they can get used via type alias impl trait (and thus users can choose generic arguments that are invalid). This can cause surprising behaviour if (definitely unsound) transmutes are used, and it's generally saner to just check for well formedness.
    Dylan-DPC authored Jul 19, 2022
    Configuration menu
    Copy the full SHA
    881e1c1 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#98320 - compiler-errors:macro-backtrace, r=…

    …estebank
    
    Mention first and last macro in backtrace
    
    Slight improvement to diagnostic mentioning what macro an error originates from. Not sure if it's worthwhile.
    Dylan-DPC authored Jul 19, 2022
    Configuration menu
    Copy the full SHA
    af13e55 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#99335 - Dav1dde:fromstr-docs, r=JohnTitor

    Use split_once in FromStr docs
    
    Current implementation:
    
    ```rust
        fn from_str(s: &str) -> Result<Self, Self::Err> {
            let coords: Vec<&str> = s.trim_matches(|p| p == '(' || p == ')' )
                                     .split(',')
                                     .collect();
    
            let x_fromstr = coords[0].parse::<i32>()?;
            let y_fromstr = coords[1].parse::<i32>()?;
    
            Ok(Point { x: x_fromstr, y: y_fromstr })
        }
    ```
    
    Creating the vector is not necessary, `split_once` does the job better.
    
    Alternatively we could also remove `trim_matches` with `strip_prefix` and `strip_suffix`:
    
    ```rust
            let (x, y) = s
                .strip_prefix('(')
                .and_then(|s| s.strip_suffix(')'))
                .and_then(|s| s.split_once(','))
                .unwrap();
    ```
    
    The question is how much 'correctness' is too much and distracts from the example. In a real implementation you would also not unwrap (or originally access the vector without bounds checks), but implementing a custom Error and adding a `From<ParseIntError>` and implementing the `Error` trait adds a lot of code to the example which is not relevant to the `FromStr` trait.
    Dylan-DPC authored Jul 19, 2022
    Configuration menu
    Copy the full SHA
    9f6a2fd View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#99347 - compiler-errors:opaque-type-key-loc…

    …al-def-id, r=oli-obk
    
    Use `LocalDefId` in `OpaqueTypeKey`
    
    Addresses a `// FIXME(oli-obk): make this a LocalDefId`
    
    r? ``@oli-obk``
    Dylan-DPC authored Jul 19, 2022
    Configuration menu
    Copy the full SHA
    d00646b View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#99392 - nnethercote:fix-debuginfo-tests, r=…

    …pnkfelix
    
    Fix debuginfo tests.
    
    This is needed for my Ubuntu 22.04 box due to a slight change in gdb
    output. The fix is similar to the fix in rust-lang#95063.
    Dylan-DPC authored Jul 19, 2022
    Configuration menu
    Copy the full SHA
    bf1366b View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#99404 - jmqd:master, r=compiler-errors

    Use span_bug for unexpected field projection type
    
    Improves the compiler error backtrace information, as shown in rust-lang#99363,
    by using `span_bug` instead of `bug`.
    
    New output:
    
    ```
    build/aarch64-apple-darwin/stage1/bin/rustc /tmp/test.rs --edition=2021
    error: internal compiler error: compiler/rustc_middle/src/ty/closure.rs:185:25: Unexpected type Opaque(DefId(0:5 ~ test[db0f]::main::T::{opaque#0}), []) for `Field` projection
      --> /tmp/test.rs:11:27
       |
    11 |         let Foo((a, b)) = foo;
       |                           ^^^
    
    thread 'rustc' panicked at 'Box<dyn Any>', /Users/jmq/src/forked/rust/compiler/rustc_errors/src/lib.rs:1331:9
    stack backtrace:
    ```
    
    (Remainder of output truncated.)
    Dylan-DPC authored Jul 19, 2022
    Configuration menu
    Copy the full SHA
    43dbf05 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#99410 - tmiasko:atomic-lint, r=fee1-dead

    Update invalid atomic ordering lint
    
    The restriction that success ordering must be at least as strong as its
    failure ordering in compare-exchange operations was lifted in rust-lang#98383.
    Dylan-DPC authored Jul 19, 2022
    Configuration menu
    Copy the full SHA
    415f7e1 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#99434 - timvermeulen:skip_next_non_fused, r…

    …=scottmcm
    
    Fix `Skip::next` for non-fused inner iterators
    
    `iter.skip(n).next()` will currently call `nth` and `next` in succession on `iter`, without checking whether `nth` exhausts the iterator. Using `?` to propagate a `None` value returned by `nth` avoids this.
    Dylan-DPC authored Jul 19, 2022
    Configuration menu
    Copy the full SHA
    e301cd3 View commit details
    Browse the repository at this point in the history