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

vec! - could not resolve macro $crate::__export::force_expr #7349

Closed
GrygrFlzr opened this issue Jan 19, 2021 · 10 comments
Closed

vec! - could not resolve macro $crate::__export::force_expr #7349

GrygrFlzr opened this issue Jan 19, 2021 · 10 comments
Labels
A-macro macro expansion S-actionable Someone could pick this issue up and work on it right now

Comments

@GrygrFlzr
Copy link

Extension: 0.3.458-nightly
Server: rust-analyzer 5231f4b
VS Code:

Version: 1.52.1 (user setup)
Commit: ea3859d4ba2f3e577a159bc91e3074c5d85c0523
Date: 2020-12-16T16:34:46.910Z
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19042

Minimal case - main.rs

fn main() {
    let data = vec![1, 2, 3];
    println!("{:?}", data);
}

Underlines vec![1, 2, 3] with

could not resolve macro `$crate::__export::force_expr`

Tested with procedural macro and build script support both enabled/disabled.
Disabled all other extensions and commented out entire VS Code settings, still no dice.
Used to work but started breaking within the last couple days, I think.

@edwin0cheng edwin0cheng added the A-macro macro expansion label Jan 19, 2021
@edwin0cheng
Copy link
Member

Cannot reproduce in linux, have you tried to create a new project and try again ?

Any output in the Output Panel ?

@lnicola
Copy link
Member

lnicola commented Jan 19, 2021

Me neither, and there's no force_expr in the standard library (nor in my cargo cache).

@edwin0cheng
Copy link
Member

@lnicola rustc nightly is change the implementation of vec! macro which is $crate::__export::force_expr instead.

@GrygrFlzr
Copy link
Author

That was with cargo new, but I tried it again just in case and ended with the same results.

I should have mentioned I was using nightly rustc, yeah:

$ rustup show
Default host: x86_64-pc-windows-msvc
rustup home:  C:\Users\GrygrFlzr\.rustup

...

active toolchain
----------------

nightly-x86_64-pc-windows-msvc (default)
rustc 1.51.0-nightly (d98d2f57d 2021-01-18)

Using the following vscode settings:

{
    "rust-analyzer.trace.server": "verbose",
    "rust-analyzer.trace.extension": true,
    "rust-analyzer.updates.channel": "nightly",
}
Language Server Trace
[Trace - 11:26:10 PM] Sending request 'initialize - (0)'.
Params: {
    "processId": 27820,
    "clientInfo": {
        "name": "Visual Studio Code",
        "version": "1.52.1"
    },
    "locale": "en-us",
    "rootPath": "c:\\Users\\GrygrFlzr\\Documents\\projects\\issue-7349",
    "rootUri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "textOnlyTransactional",
                "normalizesLineEndings": true,
                "changeAnnotationSupport": {
                    "groupsOnLabel": true
                }
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "didChangeWatchedFiles": {
                "dynamicRegistration": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                }
            },
            "codeLens": {
                "refreshSupport": true
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true,
            "workspaceFolders": true,
            "semanticTokens": {
                "refreshSupport": true
            },
            "fileOperations": {
                "dynamicRegistration": true,
                "didCreate": true,
                "didRename": true,
                "didDelete": true,
                "willCreate": true,
                "willRename": true,
                "willDelete": true
            }
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true,
                "versionSupport": false,
                "tagSupport": {
                    "valueSet": [
                        1,
                        2
                    ]
                },
                "codeDescriptionSupport": true,
                "dataSupport": true
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true,
                    "tagSupport": {
                        "valueSet": [
                            1
                        ]
                    },
                    "insertReplaceSupport": true,
                    "resolveSupport": {
                        "properties": [
                            "documentation",
                            "detail",
                            "additionalTextEdits"
                        ]
                    },
                    "insertTextModeSupport": {
                        "valueSet": [
                            1,
                            2
                        ]
                    }
                },
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    },
                    "activeParameterSupport": true
                },
                "contextSupport": true
            },
            "definition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "references": {
                "dynamicRegistration": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                },
                "hierarchicalDocumentSymbolSupport": true,
                "tagSupport": {
                    "valueSet": [
                        1
                    ]
                },
                "labelSupport": true
            },
            "codeAction": {
                "dynamicRegistration": true,
                "isPreferredSupport": true,
                "disabledSupport": true,
                "dataSupport": true,
                "resolveSupport": {
                    "properties": [
                        "edit"
                    ]
                },
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                },
                "honorsChangeAnnotations": false
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true,
                "prepareSupportDefaultBehavior": 1,
                "honorsChangeAnnotations": true
            },
            "documentLink": {
                "dynamicRegistration": true,
                "tooltipSupport": true
            },
            "typeDefinition": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "implementation": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            },
            "declaration": {
                "dynamicRegistration": true,
                "linkSupport": true
            },
            "selectionRange": {
                "dynamicRegistration": true
            },
            "callHierarchy": {
                "dynamicRegistration": true
            },
            "semanticTokens": {
                "dynamicRegistration": true,
                "tokenTypes": [
                    "namespace",
                    "type",
                    "class",
                    "enum",
                    "interface",
                    "struct",
                    "typeParameter",
                    "parameter",
                    "variable",
                    "property",
                    "enumMember",
                    "event",
                    "function",
                    "method",
                    "macro",
                    "keyword",
                    "modifier",
                    "comment",
                    "string",
                    "number",
                    "regexp",
                    "operator"
                ],
                "tokenModifiers": [
                    "declaration",
                    "definition",
                    "readonly",
                    "static",
                    "deprecated",
                    "abstract",
                    "async",
                    "modification",
                    "documentation",
                    "defaultLibrary"
                ],
                "formats": [
                    "relative"
                ],
                "requests": {
                    "range": true,
                    "full": {
                        "delta": true
                    }
                },
                "multilineTokenSupport": false,
                "overlappingTokenSupport": false
            },
            "linkedEditingRange": {
                "dynamicRegistration": true
            }
        },
        "window": {
            "showMessage": {
                "messageActionItem": {
                    "additionalPropertiesSupport": true
                }
            },
            "showDocument": {
                "support": true
            },
            "workDoneProgress": true
        },
        "general": {
            "regularExpressions": {
                "engine": "ECMAScript",
                "version": "ES2020"
            },
            "markdown": {
                "parser": "marked",
                "version": "1.1.0"
            }
        },
        "experimental": {
            "snippetTextEdit": true,
            "codeActionGroup": true,
            "hoverActions": true,
            "statusNotification": true
        }
    },
    "initializationOptions": {
        "cargoRunner": null,
        "runnableEnv": null,
        "inlayHints": {
            "enable": true,
            "chainingHints": true,
            "maxLength": null,
            "parameterHints": true,
            "typeHints": true
        },
        "updates": {
            "channel": "nightly",
            "askBeforeDownload": false
        },
        "server": {
            "path": null,
            "extraEnv": null
        },
        "trace": {
            "server": "verbose",
            "extension": true
        },
        "debug": {
            "engine": "auto",
            "sourceFileMap": {
                "/rustc/<id>": "${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust"
            },
            "openDebugPane": false,
            "engineSettings": {}
        },
        "assist": {
            "importMergeBehavior": "full",
            "importPrefix": "plain"
        },
        "callInfo": {
            "full": true
        },
        "cargo": {
            "autoreload": true,
            "allFeatures": false,
            "features": [],
            "loadOutDirsFromCheck": false,
            "noDefaultFeatures": false,
            "target": null,
            "noSysroot": false
        },
        "checkOnSave": {
            "enable": true,
            "allFeatures": null,
            "allTargets": true,
            "command": "check",
            "noDefaultFeatures": null,
            "target": null,
            "extraArgs": [],
            "features": null,
            "overrideCommand": null
        },
        "completion": {
            "addCallArgumentSnippets": true,
            "addCallParenthesis": true,
            "postfix": {
                "enable": true
            },
            "autoimport": {
                "enable": true
            }
        },
        "diagnostics": {
            "enable": true,
            "enableExperimental": true,
            "disabled": [],
            "warningsAsHint": [],
            "warningsAsInfo": []
        },
        "files": {
            "watcher": "client"
        },
        "hoverActions": {
            "debug": true,
            "enable": true,
            "gotoTypeDef": true,
            "implementations": true,
            "run": true,
            "linksInHover": true
        },
        "lens": {
            "debug": true,
            "enable": true,
            "implementations": true,
            "run": true,
            "methodReferences": false
        },
        "linkedProjects": [],
        "lruCapacity": null,
        "notifications": {
            "cargoTomlNotFound": true
        },
        "procMacro": {
            "enable": false,
            "server": null
        },
        "runnables": {
            "overrideCargo": null,
            "cargoExtraArgs": []
        },
        "rustcSource": null,
        "rustfmt": {
            "extraArgs": [],
            "overrideCommand": null
        }
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349",
            "name": "issue-7349"
        }
    ]
}


[Trace - 11:26:10 PM] Received response 'initialize - (0)' in 17ms.
Result: {
    "capabilities": {
        "textDocumentSync": {
            "openClose": true,
            "change": 2,
            "save": {}
        },
        "selectionRangeProvider": true,
        "hoverProvider": true,
        "completionProvider": {
            "resolveProvider": true,
            "triggerCharacters": [
                ":",
                "."
            ]
        },
        "signatureHelpProvider": {
            "triggerCharacters": [
                "(",
                ","
            ]
        },
        "definitionProvider": true,
        "typeDefinitionProvider": true,
        "implementationProvider": true,
        "referencesProvider": true,
        "documentHighlightProvider": true,
        "documentSymbolProvider": true,
        "workspaceSymbolProvider": true,
        "codeActionProvider": {
            "codeActionKinds": [
                "",
                "quickfix",
                "refactor",
                "refactor.extract",
                "refactor.inline",
                "refactor.rewrite"
            ],
            "resolveProvider": true
        },
        "codeLensProvider": {
            "resolveProvider": true
        },
        "documentFormattingProvider": true,
        "documentOnTypeFormattingProvider": {
            "firstTriggerCharacter": "=",
            "moreTriggerCharacter": [
                ".",
                ">"
            ]
        },
        "renameProvider": {
            "prepareProvider": true
        },
        "foldingRangeProvider": true,
        "workspace": {
            "fileOperations": {
                "willRename": {
                    "filters": [
                        {
                            "scheme": "file",
                            "pattern": {
                                "glob": "**/*.rs",
                                "matches": "file"
                            }
                        },
                        {
                            "scheme": "file",
                            "pattern": {
                                "glob": "**",
                                "matches": "folder"
                            }
                        }
                    ]
                }
            }
        },
        "callHierarchyProvider": true,
        "semanticTokensProvider": {
            "legend": {
                "tokenTypes": [
                    "comment",
                    "keyword",
                    "string",
                    "number",
                    "regexp",
                    "operator",
                    "namespace",
                    "type",
                    "struct",
                    "class",
                    "interface",
                    "enum",
                    "enumMember",
                    "typeParameter",
                    "function",
                    "method",
                    "property",
                    "macro",
                    "variable",
                    "parameter",
                    "angle",
                    "attribute",
                    "boolean",
                    "brace",
                    "bracket",
                    "builtinType",
                    "comma",
                    "colon",
                    "dot",
                    "escapeSequence",
                    "formatSpecifier",
                    "generic",
                    "constParameter",
                    "lifetime",
                    "label",
                    "parenthesis",
                    "punctuation",
                    "selfKeyword",
                    "semicolon",
                    "typeAlias",
                    "union",
                    "unresolvedReference"
                ],
                "tokenModifiers": [
                    "documentation",
                    "declaration",
                    "definition",
                    "static",
                    "abstract",
                    "deprecated",
                    "readonly",
                    "constant",
                    "controlFlow",
                    "injected",
                    "mutable",
                    "consuming",
                    "unsafe",
                    "attribute",
                    "callable"
                ]
            },
            "range": true,
            "full": {
                "delta": true
            }
        },
        "experimental": {
            "joinLines": true,
            "ssr": true,
            "onEnter": true,
            "parentModule": true,
            "runnables": {
                "kinds": [
                    "cargo"
                ]
            }
        }
    },
    "serverInfo": {
        "name": "rust-analyzer",
        "version": "5231f4b"
    }
}


[Trace - 11:26:10 PM] Sending notification 'initialized'.
Params: {}


[Trace - 11:26:10 PM] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs",
        "languageId": "rust",
        "version": 1,
        "text": "fn main() {\n    let data = vec![1, 2, 3];\n    println!(\"{:?}\", data);\n}\n"
    }
}


[Trace - 11:26:10 PM] Received request 'client/registerCapability - (0)'.
Params: {
    "registrations": [
        {
            "id": "textDocument/didSave",
            "method": "textDocument/didSave",
            "registerOptions": {
                "includeText": false,
                "documentSelector": [
                    {
                        "pattern": "**/*.rs"
                    },
                    {
                        "pattern": "**/Cargo.toml"
                    },
                    {
                        "pattern": "**/Cargo.lock"
                    }
                ]
            }
        }
    ]
}


[Trace - 11:26:10 PM] Sending response 'client/registerCapability - (0)'. Processing request took 0ms
No result returned.


[Trace - 11:26:10 PM] Received request 'window/workDoneProgress/create - (1)'.
Params: {
    "token": "rustAnalyzer/fetching"
}


[Trace - 11:26:10 PM] Sending response 'window/workDoneProgress/create - (1)'. Processing request took 0ms
No result returned.


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/fetching",
    "value": {
        "kind": "begin",
        "title": "fetching"
    }
}


[Trace - 11:26:10 PM] Sending request 'textDocument/documentSymbol - (1)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    }
}


[Trace - 11:26:10 PM] Received response 'textDocument/documentSymbol - (1)' in 1ms. Request failed: Rust Analyzer is still loading... (-32801).
[Trace - 11:26:10 PM] Sending request 'rust-analyzer/inlayHints - (2)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    }
}


[Trace - 11:26:10 PM] Sending request 'textDocument/semanticTokens/range - (3)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    },
    "range": {
        "start": {
            "line": 0,
            "character": 0
        },
        "end": {
            "line": 4,
            "character": 0
        }
    }
}


[Trace - 11:26:10 PM] Received response 'rust-analyzer/inlayHints - (2)' in 0ms. Request failed: Rust Analyzer is still loading... (-32801).
[Trace - 11:26:10 PM] Received response 'textDocument/semanticTokens/range - (3)' in 0ms. Request failed: Rust Analyzer is still loading... (-32801).
[Trace - 11:26:10 PM] Sending request 'rust-analyzer/inlayHints - (4)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    }
}


[Trace - 11:26:10 PM] Received response 'rust-analyzer/inlayHints - (4)' in 0ms. Request failed: Rust Analyzer is still loading... (-32801).
[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/fetching",
    "value": {
        "kind": "report",
        "message": "metadata"
    }
}


[Trace - 11:26:10 PM] Sending request 'textDocument/foldingRange - (5)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    }
}


[Trace - 11:26:10 PM] Received response 'textDocument/foldingRange - (5)' in 1ms. Request failed: Rust Analyzer is still loading... (-32801).
[Trace - 11:26:10 PM] Sending request 'textDocument/codeLens - (6)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    }
}


[Trace - 11:26:10 PM] Received response 'textDocument/codeLens - (6)' in 0ms. Request failed: Rust Analyzer is still loading... (-32801).
[Trace - 11:26:10 PM] Sending request 'textDocument/semanticTokens/full - (7)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    }
}


[Trace - 11:26:10 PM] Received response 'textDocument/semanticTokens/full - (7)' in 1ms. Request failed: Rust Analyzer is still loading... (-32801).
[Trace - 11:26:10 PM] Sending request 'rust-analyzer/inlayHints - (8)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    }
}


[Trace - 11:26:10 PM] Received response 'rust-analyzer/inlayHints - (8)' in 0ms. Request failed: Rust Analyzer is still loading... (-32801).
[Trace - 11:26:10 PM] Received request 'client/registerCapability - (2)'.
Params: {
    "registrations": [
        {
            "id": "workspace/didChangeWatchedFiles",
            "method": "workspace/didChangeWatchedFiles",
            "registerOptions": {
                "watchers": [
                    {
                        "globPattern": "c:\\Users\\GrygrFlzr\\Documents\\projects\\issue-7349/**/*.rs"
                    }
                ]
            }
        }
    ]
}


[Trace - 11:26:10 PM] Sending response 'client/registerCapability - (2)'. Processing request took 1ms
No result returned.


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/fetching",
    "value": {
        "kind": "end"
    }
}


[Trace - 11:26:10 PM] Received notification 'rust-analyzer/status'.
Params: {
    "status": "loading"
}


[Trace - 11:26:10 PM] Received request 'window/workDoneProgress/create - (3)'.
Params: {
    "token": "rustAnalyzer/roots scanned"
}


[Trace - 11:26:10 PM] Sending response 'window/workDoneProgress/create - (3)'. Processing request took 0ms
No result returned.


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/roots scanned",
    "value": {
        "kind": "begin",
        "title": "roots scanned",
        "message": "0/11",
        "percentage": 0
    }
}


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/roots scanned",
    "value": {
        "kind": "report",
        "message": "1/11",
        "percentage": 9
    }
}


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/roots scanned",
    "value": {
        "kind": "report",
        "message": "2/11",
        "percentage": 18
    }
}


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/roots scanned",
    "value": {
        "kind": "report",
        "message": "3/11",
        "percentage": 27
    }
}


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/roots scanned",
    "value": {
        "kind": "report",
        "message": "4/11",
        "percentage": 36
    }
}


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/roots scanned",
    "value": {
        "kind": "report",
        "message": "5/11",
        "percentage": 45
    }
}


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/roots scanned",
    "value": {
        "kind": "report",
        "message": "6/11",
        "percentage": 54
    }
}


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/roots scanned",
    "value": {
        "kind": "report",
        "message": "7/11",
        "percentage": 63
    }
}


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/roots scanned",
    "value": {
        "kind": "report",
        "message": "8/11",
        "percentage": 72
    }
}


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/roots scanned",
    "value": {
        "kind": "report",
        "message": "9/11",
        "percentage": 81
    }
}


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/roots scanned",
    "value": {
        "kind": "report",
        "message": "10/11",
        "percentage": 90
    }
}


[Trace - 11:26:10 PM] Received notification 'rust-analyzer/status'.
Params: {
    "status": "ready"
}


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/roots scanned",
    "value": {
        "kind": "end",
        "message": "11/11"
    }
}


[Trace - 11:26:10 PM] Received request 'workspace/semanticTokens/refresh - (4)'.
[Trace - 11:26:10 PM] Sending response 'workspace/semanticTokens/refresh - (4)'. Processing request took 0ms
No result returned.


[Trace - 11:26:10 PM] Received request 'workspace/codeLens/refresh - (5)'.
[Trace - 11:26:10 PM] Sending response 'workspace/codeLens/refresh - (5)'. Processing request took 0ms
No result returned.


[Trace - 11:26:10 PM] Received request 'window/workDoneProgress/create - (6)'.
Params: {
    "token": "rustAnalyzer/indexing"
}


[Trace - 11:26:10 PM] Sending response 'window/workDoneProgress/create - (6)'. Processing request took 0ms
No result returned.


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "begin",
        "title": "indexing",
        "percentage": 0
    }
}


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "report",
        "message": "0/11 (core)",
        "percentage": 0
    }
}


[Trace - 11:26:10 PM] Sending request 'textDocument/semanticTokens/full - (9)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    }
}


[Trace - 11:26:10 PM] Received request 'window/workDoneProgress/create - (7)'.
Params: {
    "token": "rustAnalyzer/cargo check"
}


[Trace - 11:26:10 PM] Sending response 'window/workDoneProgress/create - (7)'. Processing request took 0ms
No result returned.


[Trace - 11:26:10 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/cargo check",
    "value": {
        "kind": "begin",
        "title": "cargo check"
    }
}


[Trace - 11:26:11 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/cargo check",
    "value": {
        "kind": "end"
    }
}


[Trace - 11:26:11 PM] Sending request 'textDocument/codeLens - (10)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    }
}


[Trace - 11:26:11 PM] Sending request 'rust-analyzer/inlayHints - (11)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    }
}


[Trace - 11:26:12 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "report",
        "message": "1/11 (alloc)",
        "percentage": 9
    }
}


[Trace - 11:26:12 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "report",
        "message": "2/11 (panic_abort)",
        "percentage": 18
    }
}


[Trace - 11:26:12 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "report",
        "message": "3/11 (panic_unwind)",
        "percentage": 27
    }
}


[Trace - 11:26:12 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "report",
        "message": "4/11 (profiler_builtins)",
        "percentage": 36
    }
}


[Trace - 11:26:12 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "report",
        "message": "5/11 (proc_macro)",
        "percentage": 45
    }
}


[Trace - 11:26:12 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "report",
        "message": "6/11 (term)",
        "percentage": 54
    }
}


[Trace - 11:26:12 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "report",
        "message": "7/11 (test)",
        "percentage": 63
    }
}


[Trace - 11:26:12 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "report",
        "message": "8/11 (unwind)",
        "percentage": 72
    }
}


[Trace - 11:26:12 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "report",
        "message": "9/11 (std)",
        "percentage": 81
    }
}


[Trace - 11:26:12 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "report",
        "message": "10/11 (issue_7349)",
        "percentage": 90
    }
}


[Trace - 11:26:12 PM] Received notification '$/progress'.
Params: {
    "token": "rustAnalyzer/indexing",
    "value": {
        "kind": "end"
    }
}


[Trace - 11:26:12 PM] Received response 'textDocument/codeLens - (10)' in 1667ms.
Result: [
    {
        "range": {
            "start": {
                "line": 0,
                "character": 0
            },
            "end": {
                "line": 3,
                "character": 1
            }
        },
        "command": {
            "title": "▶︎ Run",
            "command": "rust-analyzer.runSingle",
            "arguments": [
                {
                    "label": "run issue-7349",
                    "location": {
                        "targetUri": "file:///c:/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs",
                        "targetRange": {
                            "start": {
                                "line": 0,
                                "character": 0
                            },
                            "end": {
                                "line": 3,
                                "character": 1
                            }
                        },
                        "targetSelectionRange": {
                            "start": {
                                "line": 0,
                                "character": 3
                            },
                            "end": {
                                "line": 0,
                                "character": 7
                            }
                        }
                    },
                    "kind": "cargo",
                    "args": {
                        "overrideCargo": null,
                        "workspaceRoot": "c:\\Users\\GrygrFlzr\\Documents\\projects\\issue-7349",
                        "cargoArgs": [
                            "run",
                            "--package",
                            "issue-7349",
                            "--bin",
                            "issue-7349"
                        ],
                        "cargoExtraArgs": [],
                        "executableArgs": []
                    }
                }
            ]
        }
    },
    {
        "range": {
            "start": {
                "line": 0,
                "character": 0
            },
            "end": {
                "line": 3,
                "character": 1
            }
        },
        "command": {
            "title": "Debug",
            "command": "rust-analyzer.debugSingle",
            "arguments": [
                {
                    "label": "run issue-7349",
                    "location": {
                        "targetUri": "file:///c:/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs",
                        "targetRange": {
                            "start": {
                                "line": 0,
                                "character": 0
                            },
                            "end": {
                                "line": 3,
                                "character": 1
                            }
                        },
                        "targetSelectionRange": {
                            "start": {
                                "line": 0,
                                "character": 3
                            },
                            "end": {
                                "line": 0,
                                "character": 7
                            }
                        }
                    },
                    "kind": "cargo",
                    "args": {
                        "overrideCargo": null,
                        "workspaceRoot": "c:\\Users\\GrygrFlzr\\Documents\\projects\\issue-7349",
                        "cargoArgs": [
                            "run",
                            "--package",
                            "issue-7349",
                            "--bin",
                            "issue-7349"
                        ],
                        "cargoExtraArgs": [],
                        "executableArgs": []
                    }
                }
            ]
        }
    }
]


[Trace - 11:26:12 PM] Sending request 'textDocument/semanticTokens/range - (12)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    },
    "range": {
        "start": {
            "line": 0,
            "character": 0
        },
        "end": {
            "line": 4,
            "character": 0
        }
    }
}


[Trace - 11:26:13 PM] Sending notification '$/cancelRequest'.
Params: {
    "id": 11
}


[Trace - 11:26:13 PM] Sending request 'rust-analyzer/inlayHints - (13)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    }
}


[Trace - 11:26:13 PM] Received response 'rust-analyzer/inlayHints - (11)' in 1753ms. Request failed: canceled by client (-32800).
[Trace - 11:26:13 PM] Sending notification '$/cancelRequest'.
Params: {
    "id": 13
}


[Trace - 11:26:13 PM] Sending request 'rust-analyzer/inlayHints - (14)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs"
    }
}


[Trace - 11:26:13 PM] Received response 'rust-analyzer/inlayHints - (13)' in 37ms. Request failed: canceled by client (-32800).
[Trace - 11:26:14 PM] Received response 'rust-analyzer/inlayHints - (14)' in 1103ms.
Result: []


[Trace - 11:26:14 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "uri": "file:///c:/Users/GrygrFlzr/Documents/projects/issue-7349/src/main.rs",
    "diagnostics": [
        {
            "range": {
                "start": {
                    "line": 1,
                    "character": 15
                },
                "end": {
                    "line": 1,
                    "character": 28
                }
            },
            "severity": 1,
            "code": "macro-error",
            "codeDescription": {
                "href": "https://rust-analyzer.github.io/manual.html#macro-error"
            },
            "source": "rust-analyzer",
            "message": "could not resolve macro `$crate::__export::force_expr`"
        }
    ],
    "version": 1
}


[Trace - 11:26:14 PM] Received response 'textDocument/semanticTokens/range - (12)' in 1268ms.
Result: {
    "resultId": "1",
    "data": [
        0,
        0,
        2,
        1,
        0,
        0,
        3,
        4,
        14,
        2,
        0,
        4,
        1,
        35,
        0,
        0,
        1,
        1,
        35,
        0,
        0,
        2,
        1,
        23,
        0,
        1,
        4,
        3,
        1,
        0,
        0,
        4,
        4,
        18,
        2,
        0,
        5,
        1,
        5,
        0,
        0,
        2,
        4,
        17,
        0,
        0,
        4,
        1,
        26,
        0,
        0,
        1,
        1,
        3,
        0,
        0,
        1,
        1,
        26,
        0,
        0,
        2,
        1,
        3,
        0,
        0,
        1,
        1,
        26,
        0,
        0,
        2,
        1,
        3,
        0,
        0,
        1,
        1,
        26,
        0,
        0,
        1,
        1,
        38,
        0,
        1,
        4,
        8,
        17,
        0,
        0,
        8,
        1,
        35,
        0,
        0,
        1,
        1,
        2,
        0,
        0,
        1,
        1,
        30,
        0,
        0,
        1,
        1,
        30,
        0,
        0,
        1,
        1,
        30,
        0,
        0,
        1,
        1,
        30,
        0,
        0,
        1,
        1,
        2,
        0,
        0,
        1,
        1,
        26,
        0,
        0,
        2,
        4,
        18,
        0,
        0,
        4,
        1,
        35,
        0,
        0,
        1,
        1,
        38,
        0,
        1,
        0,
        1,
        23,
        0
    ]
}


[Trace - 11:26:14 PM] Received response 'textDocument/semanticTokens/full - (9)' in 3294ms.
Result: {
    "resultId": "2",
    "data": [
        0,
        0,
        2,
        1,
        0,
        0,
        3,
        4,
        14,
        2,
        0,
        4,
        1,
        35,
        0,
        0,
        1,
        1,
        35,
        0,
        0,
        2,
        1,
        23,
        0,
        1,
        4,
        3,
        1,
        0,
        0,
        4,
        4,
        18,
        2,
        0,
        5,
        1,
        5,
        0,
        0,
        2,
        4,
        17,
        0,
        0,
        4,
        1,
        26,
        0,
        0,
        1,
        1,
        3,
        0,
        0,
        1,
        1,
        26,
        0,
        0,
        2,
        1,
        3,
        0,
        0,
        1,
        1,
        26,
        0,
        0,
        2,
        1,
        3,
        0,
        0,
        1,
        1,
        26,
        0,
        0,
        1,
        1,
        38,
        0,
        1,
        4,
        8,
        17,
        0,
        0,
        8,
        1,
        35,
        0,
        0,
        1,
        1,
        2,
        0,
        0,
        1,
        1,
        30,
        0,
        0,
        1,
        1,
        30,
        0,
        0,
        1,
        1,
        30,
        0,
        0,
        1,
        1,
        30,
        0,
        0,
        1,
        1,
        2,
        0,
        0,
        1,
        1,
        26,
        0,
        0,
        2,
        4,
        18,
        0,
        0,
        4,
        1,
        35,
        0,
        0,
        1,
        1,
        38,
        0,
        1,
        0,
        1,
        23,
        0
    ]
}
Client Output
INFO [1/19/2021, 11:26:09 PM]: Extension version: 0.3.458-nightly
INFO [1/19/2021, 11:26:09 PM]: Using configuration {
  cargoRunner: null,
  runnableEnv: null,
  inlayHints: {
    enable: true,
    chainingHints: true,
    maxLength: null,
    parameterHints: true,
    typeHints: true
  },
  updates: { channel: 'nightly', askBeforeDownload: false },
  server: { path: null, extraEnv: null },
  trace: { server: 'verbose', extension: true },
  debug: {
    engine: 'auto',
    sourceFileMap: {
      '/rustc/<id>': '${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust'
    },
    openDebugPane: false,
    engineSettings: {}
  },
  assist: { importMergeBehavior: 'full', importPrefix: 'plain' },
  callInfo: { full: true },
  cargo: {
    autoreload: true,
    allFeatures: false,
    features: [],
    loadOutDirsFromCheck: false,
    noDefaultFeatures: false,
    target: null,
    noSysroot: false
  },
  checkOnSave: {
    enable: true,
    allFeatures: null,
    allTargets: true,
    command: 'check',
    noDefaultFeatures: null,
    target: null,
    extraArgs: [],
    features: null,
    overrideCommand: null
  },
  completion: {
    addCallArgumentSnippets: true,
    addCallParenthesis: true,
    postfix: { enable: true },
    autoimport: { enable: true }
  },
  diagnostics: {
    enable: true,
    enableExperimental: true,
    disabled: [],
    warningsAsHint: [],
    warningsAsInfo: []
  },
  files: { watcher: 'client' },
  hoverActions: {
    debug: true,
    enable: true,
    gotoTypeDef: true,
    implementations: true,
    run: true,
    linksInHover: true
  },
  lens: {
    debug: true,
    enable: true,
    implementations: true,
    run: true,
    methodReferences: false
  },
  linkedProjects: [],
  lruCapacity: null,
  notifications: { cargoTomlNotFound: true },
  procMacro: { enable: false, server: null },
  runnables: { overrideCargo: null, cargoExtraArgs: [] },
  rustcSource: null,
  rustfmt: { extraArgs: [], overrideCommand: null }
}
INFO [1/19/2021, 11:26:09 PM]: PersistentState: {
  lastCheck: 1611055735662,
  releaseId: 36575843,
  serverVersion: '0.3.458-nightly'
}
DEBUG [1/19/2021, 11:26:09 PM]: Issuing request for released artifacts metadata to https://api.github.com/repos/rust-analyzer/rust-analyzer/releases/tags/nightly
INFO [1/19/2021, 11:26:10 PM]: Using server binary at c:\Users\GrygrFlzr\AppData\Roaming\Code\User\globalStorage\matklad.rust-analyzer\rust-analyzer-x86_64-pc-windows-msvc.exe
DEBUG [1/19/2021, 11:26:10 PM]: Checking availability of a binary at c:\Users\GrygrFlzr\AppData\Roaming\Code\User\globalStorage\matklad.rust-analyzer\rust-analyzer-x86_64-pc-windows-msvc.exe
DEBUG [1/19/2021, 11:26:10 PM]: c:\Users\GrygrFlzr\AppData\Roaming\Code\User\globalStorage\matklad.rust-analyzer\rust-analyzer-x86_64-pc-windows-msvc.exe --version: {
  status: 0,
  signal: null,
  output: [ null, 'rust-analyzer 5231f4b\n', '' ],
  pid: 28532,
  stdout: 'rust-analyzer 5231f4b\n',
  stderr: ''
}

@edwin0cheng
Copy link
Member

edwin0cheng commented Jan 19, 2021

Yes, I can reproduce it now in rustc nightly toolchain, I will take a look for that.

@edwin0cheng
Copy link
Member

edwin0cheng commented Jan 19, 2021

Oh ..

https://github.com/rust-lang/rust/blob/f09fb488f70c5965ec4f64453a6e681fbfcff56c/library/alloc/src/lib.rs#L196

Seem like they start to use macro 2.0 for the vec macro :(

@edwin0cheng
Copy link
Member

cc #2248

@jonas-schievink
Copy link
Contributor

cc rust-lang/rust#81080

@lnicola lnicola added the S-actionable Someone could pick this issue up and work on it right now label Jan 20, 2021
@brightly-salty
Copy link

I also have this bug on rust nightly with rust-analyzer nightly on macOS.

m-ou-se added a commit to m-ou-se/rust that referenced this issue Jan 22, 2021
…li-obk

Turn alloc's force_expr macro into a regular macro_rules.

This turns `alloc`'s `force_expr` macro into a regular `macro_rules`.

Otherwise rust-analyzer doesn't understand `vec![]`. See rust-lang/rust-analyzer#7349 and rust-lang#81080 (comment)

Edit: See rust-lang#81241 (comment) for a discussion of alternatives.
@jonas-schievink
Copy link
Contributor

Fixed by rust-lang/rust#81241

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macro macro expansion S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

5 participants