minor: use minicore

This commit is contained in:
Aleksey Kladov 2021-06-18 22:14:39 +03:00
parent c2f15270ee
commit 2e4df27132
3 changed files with 3 additions and 17 deletions

View file

@ -831,7 +831,6 @@ fn path_element_of_reference(
})?; })?;
stdx::always!( stdx::always!(
matches!(path, ast::Expr::PathExpr(_) | ast::Expr::MacroCall(_)), matches!(path, ast::Expr::PathExpr(_) | ast::Expr::MacroCall(_)),
"unexpected expression type for variable usage: {:?}", "unexpected expression type for variable usage: {:?}",
path path
); );
@ -2991,11 +2990,7 @@ mod bar {
check_assist( check_assist(
extract_function, extract_function,
r#" r#"
enum Option<T> { //- minicore: option
#[lang = "None"] None,
#[lang = "Some"] Some(T),
}
use Option::*;
fn foo() { fn foo() {
loop { loop {
let n = 1; let n = 1;
@ -3007,11 +3002,6 @@ fn foo() {
} }
"#, "#,
r#" r#"
enum Option<T> {
#[lang = "None"] None,
#[lang = "Some"] Some(T),
}
use Option::*;
fn foo() { fn foo() {
loop { loop {
let n = 1; let n = 1;

View file

@ -498,10 +498,7 @@ mod foo {
fn issue_8931() { fn issue_8931() {
check( check(
r#" r#"
#[lang = "fn_once"] //- minicore: fn
trait FnOnce<Args> {
type Output;
}
struct S; struct S;
struct Foo; struct Foo;

View file

@ -942,13 +942,12 @@ fn foo() -> u32 {
// FIXME: make this work with `|| $0` // FIXME: make this work with `|| $0`
check_expected_type_and_name( check_expected_type_and_name(
r#" r#"
//- minicore: fn
fn foo() { fn foo() {
bar(|| a$0); bar(|| a$0);
} }
fn bar(f: impl FnOnce() -> u32) {} fn bar(f: impl FnOnce() -> u32) {}
#[lang = "fn_once"]
trait FnOnce { type Output; }
"#, "#,
expect![[r#"ty: u32, name: ?"#]], expect![[r#"ty: u32, name: ?"#]],
); );