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 5 pull requests #100628

Closed
wants to merge 74 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
61d1c3e
add debug impl for AnyDiagnostic
HKalbasi Jul 28, 2022
c1a175f
Generate rust type from json
HKalbasi Jul 28, 2022
5cb3e7a
Added fixup for match statements w/ missing parts
fprasx Aug 3, 2022
d513b4c
Added fixup for for loops w/ missing parts
fprasx Aug 3, 2022
ef2eabb
Tidy formatted
fprasx Aug 3, 2022
d6d8a1c
Shortened fixup for match, added cases for for
fprasx Aug 4, 2022
ab44a81
Fixed up for loops, added fixme with problem
fprasx Aug 4, 2022
859d467
fix: make `concat!` work with char
lowr Aug 4, 2022
4d5873e
minor: align with rustc on escaping characters in macro expansion
lowr Aug 5, 2022
fd00bd4
Document CLI flag stability
Aug 5, 2022
851f6db
Import serde derives on converting json to struct
HKalbasi Aug 6, 2022
a81c7a2
Parse range patterns in struct and slice without trailing comma
lowr Aug 5, 2022
4b648d8
[code] make toggleInlayHints understand {off,on}UntilPressed
jhgg Aug 8, 2022
b569bbb
Auto merge of #12942 - lowr:fix/concat-with-char, r=Veykril
bors Aug 8, 2022
b481b59
Auto merge of #12937 - fprasx:master, r=Veykril
bors Aug 8, 2022
3805067
Auto merge of #12905 - HKalbasi:master, r=Veykril
bors Aug 8, 2022
20d6441
Auto merge of #12951 - jonas-schievink:doc-cli-stability, r=Veykril
bors Aug 8, 2022
49700e4
Auto merge of #12967 - jhgg:code/fix-toggle-hints, r=Veykril
bors Aug 8, 2022
b14062a
Parse range patterns in let statement with type annotation
lowr Aug 8, 2022
79c22d5
Auto merge of #12962 - lowr:patch/parse-last-range-pattern, r=Veykril
bors Aug 8, 2022
e39918f
Corrected order of printing op and `=`
fprasx Aug 8, 2022
554f7f8
Auto merge of #12974 - fprasx:master, r=lnicola
bors Aug 8, 2022
232176b
remove imports that are also in edition 2021's prelude
kadiwa4 Aug 8, 2022
e1e93c4
Auto merge of #12981 - kadiwa4:remove_some_imports, r=Veykril
bors Aug 9, 2022
950de7c
Use `--keep-going` cargo flag when building build scripts
Veykril Aug 9, 2022
8c9359b
Fix pattern field completions not working for unions
Veykril Aug 9, 2022
b3ac58d
Add some more `cov_mark`s
Veykril Aug 9, 2022
49d24f6
Recover from missing ellipsis in record literals for path expressions
Veykril Aug 9, 2022
d186986
Auto merge of #12986 - Veykril:completions, r=Veykril
bors Aug 9, 2022
5366009
Auto merge of #12987 - Veykril:ellipsis-recov, r=Veykril
bors Aug 9, 2022
f4f70c0
Remove incomplete 1.64 ABI
lnicola Aug 10, 2022
25d4fbe
Re-try build script building with --keep-going
Veykril Aug 10, 2022
23e17cd
Improve insert whitespace in mbe
edwin0cheng Aug 10, 2022
c47914c
Fixes tests
edwin0cheng Aug 10, 2022
d79d9e1
Auto merge of #12990 - edwin0cheng:improve-ws, r=Veykril
bors Aug 10, 2022
ffc6b42
fix: infer byte string pattern as `&[u8]` when matched against slices
lowr Aug 10, 2022
e70681f
Auto merge of #12992 - lowr:fix/type-inference-for-byte-string-pat, r…
bors Aug 10, 2022
b1e9bcd
Auto merge of #12984 - Veykril:keep-going, r=Veykril
bors Aug 10, 2022
3eb340f
Auto merge of #12989 - lnicola:rm-1-64-abi, r=Veykril
bors Aug 10, 2022
53ec791
Add `UnescapedName` and make `Name` hold escaped name
lowr Aug 1, 2022
4322cf7
Remove `EscapedName`
lowr Aug 1, 2022
8fe73a2
Make tests pass
lowr Aug 1, 2022
018266a
Make `ModPath` display escaped path
lowr Aug 10, 2022
ba6db3e
Add test for runnables with raw identifiers
lowr Jul 30, 2022
1bb5820
Fix panic in no_such_field when using tuple fields on record structs
Veykril Aug 11, 2022
696bee3
Auto merge of #12997 - Veykril:no-such-field, r=Veykril
bors Aug 11, 2022
cee1e15
Auto merge of #12993 - lowr:patch/swap-name-and-escaped-name, r=Veykril
bors Aug 12, 2022
1ce9783
Use Node 16 in CI workflows
lnicola Aug 12, 2022
19da032
Upgrade npm lockfile
lnicola Aug 12, 2022
f982c76
Auto merge of #13007 - lnicola:node-16, r=lnicola
bors Aug 12, 2022
fd58459
Take into account renamed extension id when launching
shoffmeister Aug 11, 2022
72ae308
Do not unconditionally succeed RUSTC_WRAPPER checks when run by build…
Veykril Aug 13, 2022
5941dec
Auto merge of #13010 - Veykril:build-script-probes, r=Veykril
bors Aug 13, 2022
038c36a
Simplify `GlobalState::handle_event`
Veykril Aug 13, 2022
306687b
Auto merge of #13014 - Veykril:simplify, r=Veykril
bors Aug 13, 2022
ec8256d
Move VSCode diagnostics workaroudn into client code
Veykril Aug 13, 2022
bbe5637
Auto merge of #13016 - Veykril:vscode-diag-workaround, r=Veykril
bors Aug 13, 2022
614969b
Pad empty diagnostic messages in relatedInformation as well
Veykril Aug 13, 2022
010f68c
Auto merge of #13017 - Veykril:vscode-diag-workaround, r=Veykril
bors Aug 13, 2022
ebc140e
Auto merge of #13000 - shoffmeister:patch-1, r=lnicola
bors Aug 14, 2022
c61237b
Remove redundant --pre-release flag from publish
lnicola Aug 14, 2022
b6d59f2
Auto merge of #13020 - lnicola:no-pre-release-flag, r=lnicola
bors Aug 14, 2022
63113c8
unwind: don't build dependency when building for Miri
RalfJung Aug 14, 2022
3e04fed
Remove `{ast,hir}::WhereEqPredicate::id`.
nnethercote Jul 29, 2022
9619a2e
Avoid unnecessary cloning in `Parser::get_ident_from_generic_arg`.
nnethercote Aug 16, 2022
3308627
Add some more AST node size assertions.
nnethercote Aug 16, 2022
96c91af
compiletest: fix typo in runtest.rs
eltociear Aug 16, 2022
a06da98
:arrow_up: rust-analyzer
lnicola Aug 16, 2022
5bb04f3
Support 128-bit atomics on all aarch64 targets
taiki-e Aug 16, 2022
65b7bd3
Rollup merge of #100532 - RalfJung:unwind-miri, r=Mark-Simulacrum
TaKO8Ki Aug 16, 2022
8fa0faf
Rollup merge of #100610 - nnethercote:ast-and-parser-tweaks, r=spasto…
TaKO8Ki Aug 16, 2022
65d55d2
Rollup merge of #100613 - eltociear:patch-15, r=Mark-Simulacrum
TaKO8Ki Aug 16, 2022
64fc068
Rollup merge of #100616 - lnicola:rust-analyzer-2022-08-16, r=lnicola
TaKO8Ki Aug 16, 2022
7e100c1
Rollup merge of #100622 - taiki-e:aarch64-atomic-128, r=Amanieu
TaKO8Ki Aug 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ pub struct WhereRegionPredicate {
/// E.g., `T = int`.
#[derive(Clone, Encodable, Decodable, Debug)]
pub struct WhereEqPredicate {
pub id: NodeId,
pub span: Span,
pub lhs_ty: P<Ty>,
pub rhs_ty: P<Ty>,
Expand Down Expand Up @@ -3042,6 +3041,7 @@ mod size_asserts {
static_assert_size!(Attribute, 32);
static_assert_size!(Block, 48);
static_assert_size!(Expr, 104);
static_assert_size!(ExprKind, 72);
static_assert_size!(Fn, 192);
static_assert_size!(ForeignItem, 160);
static_assert_size!(ForeignItemKind, 72);
Expand All @@ -3051,9 +3051,13 @@ mod size_asserts {
static_assert_size!(Item, 200);
static_assert_size!(ItemKind, 112);
static_assert_size!(Lit, 48);
static_assert_size!(LitKind, 24);
static_assert_size!(Pat, 120);
static_assert_size!(PatKind, 96);
static_assert_size!(Path, 40);
static_assert_size!(PathSegment, 24);
static_assert_size!(Stmt, 32);
static_assert_size!(StmtKind, 16);
static_assert_size!(Ty, 96);
static_assert_size!(TyKind, 72);
}
3 changes: 1 addition & 2 deletions compiler/rustc_ast/src/mut_visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,8 +935,7 @@ pub fn noop_visit_where_predicate<T: MutVisitor>(pred: &mut WherePredicate, vis:
visit_vec(bounds, |bound| noop_visit_param_bound(bound, vis));
}
WherePredicate::EqPredicate(ep) => {
let WhereEqPredicate { id, span, lhs_ty, rhs_ty } = ep;
vis.visit_id(id);
let WhereEqPredicate { span, lhs_ty, rhs_ty } = ep;
vis.visit_span(span);
vis.visit_ty(lhs_ty);
vis.visit_ty(rhs_ty);
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1498,9 +1498,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
),
in_where_clause: true,
}),
WherePredicate::EqPredicate(WhereEqPredicate { id, ref lhs_ty, ref rhs_ty, span }) => {
WherePredicate::EqPredicate(WhereEqPredicate { ref lhs_ty, ref rhs_ty, span }) => {
hir::WherePredicate::EqPredicate(hir::WhereEqPredicate {
hir_id: self.lower_node_id(id),
lhs_ty: self
.lower_ty(lhs_ty, ImplTraitContext::Disallowed(ImplTraitPosition::Type)),
rhs_ty: self
Expand Down
6 changes: 1 addition & 5 deletions compiler/rustc_builtin_macros/src/deriving/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,11 +640,7 @@ impl<'a> TraitDef<'a> {
}
ast::WherePredicate::EqPredicate(we) => {
let span = we.span.with_ctxt(ctxt);
ast::WherePredicate::EqPredicate(ast::WhereEqPredicate {
id: ast::DUMMY_NODE_ID,
span,
..we.clone()
})
ast::WherePredicate::EqPredicate(ast::WhereEqPredicate { span, ..we.clone() })
}
}
}));
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,6 @@ impl<'hir> WhereRegionPredicate<'hir> {
/// An equality predicate (e.g., `T = int`); currently unsupported.
#[derive(Debug, HashStable_Generic)]
pub struct WhereEqPredicate<'hir> {
pub hir_id: HirId,
pub span: Span,
pub lhs_ty: &'hir Ty<'hir>,
pub rhs_ty: &'hir Ty<'hir>,
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_hir/src/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,10 +876,7 @@ pub fn walk_where_predicate<'v, V: Visitor<'v>>(
visitor.visit_lifetime(lifetime);
walk_list!(visitor, visit_param_bound, bounds);
}
WherePredicate::EqPredicate(WhereEqPredicate {
hir_id, ref lhs_ty, ref rhs_ty, ..
}) => {
visitor.visit_id(hir_id);
WherePredicate::EqPredicate(WhereEqPredicate { ref lhs_ty, ref rhs_ty, .. }) => {
visitor.visit_ty(lhs_ty);
visitor.visit_ty(rhs_ty);
}
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_parse/src/parser/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ impl<'a> Parser<'a> {
span: lo.to(self.prev_token.span),
lhs_ty: ty,
rhs_ty,
id: ast::DUMMY_NODE_ID,
}))
} else {
self.maybe_recover_bounds_doubled_colon(&ty)?;
Expand Down
14 changes: 5 additions & 9 deletions compiler/rustc_parse/src/parser/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ impl<'a> Parser<'a> {
Ok(ident_gen_args) => ident_gen_args,
Err(()) => return Ok(Some(AngleBracketedArg::Arg(arg))),
};
if binder.is_some() {
if binder {
// FIXME(compiler-errors): this could be improved by suggesting lifting
// this up to the trait, at least before this becomes real syntax.
// e.g. `Trait<for<'a> Assoc = Ty>` -> `for<'a> Trait<Assoc = Ty>`
Expand Down Expand Up @@ -720,28 +720,24 @@ impl<'a> Parser<'a> {

/// Given a arg inside of generics, we try to destructure it as if it were the LHS in
/// `LHS = ...`, i.e. an associated type binding.
/// This returns (optionally, if they are present) any `for<'a, 'b>` binder args, the
/// This returns a bool indicating if there are any `for<'a, 'b>` binder args, the
/// identifier, and any GAT arguments.
fn get_ident_from_generic_arg(
&self,
gen_arg: &GenericArg,
) -> Result<(Option<Vec<ast::GenericParam>>, Ident, Option<GenericArgs>), ()> {
) -> Result<(bool, Ident, Option<GenericArgs>), ()> {
if let GenericArg::Type(ty) = gen_arg {
if let ast::TyKind::Path(qself, path) = &ty.kind
&& qself.is_none()
&& let [seg] = path.segments.as_slice()
{
return Ok((None, seg.ident, seg.args.as_deref().cloned()));
return Ok((false, seg.ident, seg.args.as_deref().cloned()));
} else if let ast::TyKind::TraitObject(bounds, ast::TraitObjectSyntax::None) = &ty.kind
&& let [ast::GenericBound::Trait(trait_ref, ast::TraitBoundModifier::None)] =
bounds.as_slice()
&& let [seg] = trait_ref.trait_ref.path.segments.as_slice()
{
return Ok((
Some(trait_ref.bound_generic_params.clone()),
seg.ident,
seg.args.as_deref().cloned(),
));
return Ok((true, seg.ident, seg.args.as_deref().cloned()));
}
}
Err(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::spec::Target;

pub fn target() -> Target {
let mut base = super::windows_gnullvm_base::opts();
base.max_atomic_width = Some(64);
base.max_atomic_width = Some(128);
base.features = "+neon,+fp-armv8".into();
base.linker = Some("aarch64-w64-mingw32-clang".into());

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/aarch64_pc_windows_msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::spec::Target;

pub fn target() -> Target {
let mut base = super::windows_msvc_base::opts();
base.max_atomic_width = Some(64);
base.max_atomic_width = Some(128);
base.features = "+neon,+fp-armv8".into();

Target {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/aarch64_unknown_uefi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::spec::{LinkerFlavor, Target};
pub fn target() -> Target {
let mut base = uefi_msvc_base::opts();

base.max_atomic_width = Some(64);
base.max_atomic_width = Some(128);
base.add_pre_link_args(LinkerFlavor::Msvc, &["/machine:arm64"]);

Target {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/aarch64_uwp_windows_msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::spec::Target;

pub fn target() -> Target {
let mut base = super::windows_uwp_msvc_base::opts();
base.max_atomic_width = Some(64);
base.max_atomic_width = Some(128);

Target {
llvm_target: "aarch64-pc-windows-msvc".into(),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/arm64_32_apple_watchos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub fn target() -> Target {
arch: "aarch64".into(),
options: TargetOptions {
features: "+neon,+fp-armv8,+apple-a7".into(),
max_atomic_width: Some(64),
max_atomic_width: Some(128),
forces_embed_bitcode: true,
// These arguments are not actually invoked - they just have
// to look right to pass App Store validation.
Expand Down
8 changes: 7 additions & 1 deletion library/unwind/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ use std::env;

fn main() {
println!("cargo:rerun-if-changed=build.rs");
let target = env::var("TARGET").expect("TARGET was not set");
println!("cargo:rerun-if-env-changed=CARGO_CFG_MIRI");

if env::var_os("CARGO_CFG_MIRI").is_some() {
// Miri doesn't need the linker flags or a libunwind build.
return;
}

let target = env::var("TARGET").expect("TARGET was not set");
if target.contains("android") {
let build = cc::Build::new();

Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3761,7 +3761,7 @@ impl<'test> TestCx<'test> {

fn delete_file(&self, file: &PathBuf) {
if !file.exists() {
// Deleting a nonexistant file would error.
// Deleting a nonexistent file would error.
return;
}
if let Err(e) = fs::remove_file(file) {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Install Nodejs
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 16.x

- name: Install xvfb
if: matrix.os == 'ubuntu-latest'
Expand Down
10 changes: 5 additions & 5 deletions src/tools/rust-analyzer/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 16.x

- name: Update apt repositories
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf'
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
container:
image: rust:alpine
volumes:
- /usr/local/cargo/registry
- /usr/local/cargo/registry:/usr/local/cargo/registry

steps:
- name: Install dependencies
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
- name: Install Nodejs
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 16.x

- run: echo "TAG=$(date --iso -u)" >> $GITHUB_ENV
if: github.ref == 'refs/heads/release'
Expand Down Expand Up @@ -253,9 +253,9 @@ jobs:
- name: Publish Extension (Code Marketplace, nightly)
if: github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
working-directory: ./editors/code
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix

- name: Publish Extension (OpenVSX, nightly)
if: github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
working-directory: ./editors/code
run: npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release
run: npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--disable-extension", "matklad.rust-analyzer",
"--disable-extension", "rust-lang.rust-analyzer",
"--extensionDevelopmentPath=${workspaceFolder}/editors/code"
],
"outFiles": [
Expand Down
1 change: 1 addition & 0 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ dependencies = [
"ide-db",
"itertools",
"profile",
"serde_json",
"sourcegen",
"stdx",
"syntax",
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/base-db/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! actual IO. See `vfs` and `project_model` in the `rust-analyzer` crate for how
//! actual IO is done and lowered to input.

use std::{fmt, iter::FromIterator, ops, panic::RefUnwindSafe, str::FromStr, sync::Arc};
use std::{fmt, ops, panic::RefUnwindSafe, str::FromStr, sync::Arc};

use cfg::CfgOptions;
use rustc_hash::{FxHashMap, FxHashSet};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,13 @@ fn test_concat_expand() {
#[rustc_builtin_macro]
macro_rules! concat {}

fn main() { concat!("foo", "r", 0, r#"bar"#, "\n", false); }
fn main() { concat!("foo", "r", 0, r#"bar"#, "\n", false, '"', '\0'); }
"##,
expect![[r##"
#[rustc_builtin_macro]
macro_rules! concat {}

fn main() { "foor0bar\nfalse"; }
fn main() { "foor0bar\nfalse\"\u{0}"; }
"##]],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ macro_rules! m {
($t:ty) => ( fn bar() -> $ t {} )
}

fn bar() -> & 'a Baz<u8> {}
fn bar() -> &'a Baz<u8> {}

fn bar() -> extern "Rust"fn() -> Ret {}
"#]],
Expand Down Expand Up @@ -1578,7 +1578,7 @@ macro_rules !register_methods {
($$($val: expr), *) = > {
struct Foo;
impl Foo {
$(fn $method()-> & 'static[u32] {
$(fn $method()-> &'static[u32] {
&[$$($$val), *]
}
)*
Expand All @@ -1591,21 +1591,21 @@ macro_rules !implement_methods {
($($val: expr), *) = > {
struct Foo;
impl Foo {
fn alpha()-> & 'static[u32] {
fn alpha()-> &'static[u32] {
&[$($val), *]
}
fn beta()-> & 'static[u32] {
fn beta()-> &'static[u32] {
&[$($val), *]
}
}
}
}
struct Foo;
impl Foo {
fn alpha() -> & 'static[u32] {
fn alpha() -> &'static[u32] {
&[1, 2, 3]
}
fn beta() -> & 'static[u32] {
fn beta() -> &'static[u32] {
&[1, 2, 3]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ macro_rules! int_base {
}
}
#[stable(feature = "rust1", since = "1.0.0")] impl fmt::Binary for isize {
fn fmt(&self , f: &mut fmt::Formatter< '_>) -> fmt::Result {
fn fmt(&self , f: &mut fmt::Formatter<'_>) -> fmt::Result {
Binary.fmt_int(*self as usize, f)
}
}
Expand Down Expand Up @@ -724,7 +724,7 @@ macro_rules! delegate_impl {
}
}
}
impl <> Data for & 'amut G where G: Data {}
impl <> Data for &'amut G where G: Data {}
"##]],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ m!(static bar: &'static str = "hello";);
macro_rules! m {
($($t:tt)*) => { $($t)*}
}
static bar: & 'static str = "hello";
static bar: &'static str = "hello";
"#]],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fn foo() { bar.; blub }
fn foo() { bar.; blub }

fn foo() {
bar. ;
bar.;
blub
}"##]],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ impl ModDir {
candidate_files.push(self.dir_path.join_attr(attr_path, self.root_non_dir_owner))
}
None if file_id.is_include_macro(db.upcast()) => {
let name = name.unescaped();
candidate_files.push(format!("{}.rs", name));
candidate_files.push(format!("{}/mod.rs", name));
}
None => {
let name = name.unescaped();
candidate_files.push(format!("{}{}.rs", self.dir_path.0, name));
candidate_files.push(format!("{}{}/mod.rs", self.dir_path.0, name));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ pub struct Bar;
expect![[r#"
crate
Bar: t v
async: t
r#async: t

crate::async
crate::r#async
Bar: t v
"#]],
);
Expand Down
Loading