Skip to content

cannot find value NoneError in module std::option  #85614

Closed
@DzenanJupic

Description

@DzenanJupic

related issues: #42327 #84277

Code

I tried this code:

docker run --rm -it debian:buster-slim /bin/bash
# in container
apt install -y ca-certificates curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly --profile [minimal|default] # could not test complete since it doesn't install for me
source "$HOME"/.cargo/env
cargo new temp
// temp/src/main.rs

#![feature(try_trait)] // #42327 | neither works try_trait_v2 from #84277 
use std::option::NoneError;
fn main() {}

I expected to see this happen: It compiles

Instead, this happened:

error[E0432]: unresolved import `std::option::NoneError`
 --> src/main.rs:2:5
  |
2 | use std::option::NoneError;
  |     ^^^^^^^^^^^^^^^^^^^^^^ no `NoneError` in `option`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `temp`
verbose output
     Running `rustc --crate-name temp --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=d892e47b8f4f249b -C extra-filename=-d892e47b8f4f249b --out-dir /temp/target/debug/deps -C incremental=/temp/target/debug/incremental -L dependency=/temp/target/debug/deps`
error[E0432]: unresolved import `std::option::NoneError`
 --> src/main.rs:2:5
  |
2 | use std::option::NoneError;
  |     ^^^^^^^^^^^^^^^^^^^^^^ no `NoneError` in `option`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: could not compile `temp`

Caused by:
  process didn't exit successfully: `rustc --crate-name temp --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=d892e47b8f4f249b -C extra-filename=-d892e47b8f4f249b --out-dir /temp/target/debug/deps -C incremental=/temp/target/debug/incremental -L dependency=/temp/target/debug/deps` (exit status: 1)

Version it worked on

It works on: nightly-2021-05-10

Version with regression

rustc --version --verbose:

rustc 1.54.0-nightly (e4ca1662f 2021-05-22)
binary: rustc
commit-hash: e4ca1662f255db774dcd16ed9c3776bf25ac8361
commit-date: 2021-05-22
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

rustup --version

rustup 1.24.2 (755e2b07e 2021-05-12)

cargo --version --verbose

cargo 1.54.0-nightly (070e459c2 2021-05-11)
release: 1.54.0
commit-hash: 070e459c2d8b79c5b2ac5218064e7603329c92ae
commit-date: 2021-05-11

Metadata

Metadata

Assignees

No one assigned

    Labels

    regression-untriagedUntriaged performance or correctness regression.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions