Skip to content

Syntax Error: unknown literal prefix in macros #18378

Closed
@if0ne

Description

@if0ne

rust-analyzer version: 0.3.2154-standalone

rustc version: 1.82.0 (f6e511eec 2024-10-15)

editor or extension: VSCode

In the new version of RA, bugs appear when using the slog crate for logging. In slog there are tags that can be added to log messages and they are prefixed with #.

The previous version of RA (0.3.2146-standalone) does not have this problem.

Image

Error output
[{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: unknown literal prefix",
	"source": "rust-analyzer",
	"startLineNumber": 180,
	"startColumn": 45,
	"endLineNumber": 180,
	"endColumn": 48
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: unknown literal prefix",
	"source": "rust-analyzer",
	"startLineNumber": 291,
	"startColumn": 35,
	"endLineNumber": 291,
	"endColumn": 38
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: unknown literal prefix",
	"source": "rust-analyzer",
	"startLineNumber": 291,
	"startColumn": 49,
	"endLineNumber": 291,
	"endColumn": 52
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: unknown literal prefix",
	"source": "rust-analyzer",
	"startLineNumber": 303,
	"startColumn": 66,
	"endLineNumber": 303,
	"endColumn": 70
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: unknown literal prefix",
	"source": "rust-analyzer",
	"startLineNumber": 305,
	"startColumn": 48,
	"endLineNumber": 305,
	"endColumn": 56
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: unknown literal prefix",
	"source": "rust-analyzer",
	"startLineNumber": 312,
	"startColumn": 54,
	"endLineNumber": 312,
	"endColumn": 60
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: unknown literal prefix",
	"source": "rust-analyzer",
	"startLineNumber": 315,
	"startColumn": 24,
	"endLineNumber": 315,
	"endColumn": 27
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: Missing trailing `\"` symbol to terminate the string literal",
	"source": "rust-analyzer",
	"startLineNumber": 320,
	"startColumn": 43,
	"endLineNumber": 325,
	"endColumn": 1
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: expected R_PAREN",
	"source": "rust-analyzer",
	"startLineNumber": 325,
	"startColumn": 1,
	"endLineNumber": 325,
	"endColumn": 1
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: expected SEMICOLON",
	"source": "rust-analyzer",
	"startLineNumber": 325,
	"startColumn": 1,
	"endLineNumber": 325,
	"endColumn": 1
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: expected R_CURLY",
	"source": "rust-analyzer",
	"startLineNumber": 325,
	"startColumn": 1,
	"endLineNumber": 325,
	"endColumn": 1
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: expected R_CURLY",
	"source": "rust-analyzer",
	"startLineNumber": 325,
	"startColumn": 1,
	"endLineNumber": 325,
	"endColumn": 1
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: expected R_CURLY",
	"source": "rust-analyzer",
	"startLineNumber": 325,
	"startColumn": 1,
	"endLineNumber": 325,
	"endColumn": 1
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: expected R_CURLY",
	"source": "rust-analyzer",
	"startLineNumber": 325,
	"startColumn": 1,
	"endLineNumber": 325,
	"endColumn": 1
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: expected R_CURLY",
	"source": "rust-analyzer",
	"startLineNumber": 325,
	"startColumn": 1,
	"endLineNumber": 325,
	"endColumn": 1
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: expected R_PAREN",
	"source": "rust-analyzer",
	"startLineNumber": 325,
	"startColumn": 1,
	"endLineNumber": 325,
	"endColumn": 1
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: expected SEMICOLON",
	"source": "rust-analyzer",
	"startLineNumber": 325,
	"startColumn": 1,
	"endLineNumber": 325,
	"endColumn": 1
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: expected R_CURLY",
	"source": "rust-analyzer",
	"startLineNumber": 325,
	"startColumn": 1,
	"endLineNumber": 325,
	"endColumn": 1
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: expected SEMICOLON",
	"source": "rust-analyzer",
	"startLineNumber": 325,
	"startColumn": 1,
	"endLineNumber": 325,
	"endColumn": 1
},{
	"resource": "*/src/main.rs",
	"owner": "rustc",
	"code": {
		"value": "syntax-error",
		"target": {
			"$mid": 1,
			"path": "/stable/reference/",
			"scheme": "https",
			"authority": "doc.rust-lang.org"
		}
	},
	"severity": 8,
	"message": "Syntax Error: expected R_CURLY",
	"source": "rust-analyzer",
	"startLineNumber": 325,
	"startColumn": 1,
	"endLineNumber": 325,
	"endColumn": 1
}]

Metadata

Metadata

Labels

A-diagnosticsdiagnostics / error reportingA-macromacro expansionA-parserparser issuesC-bugCategory: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions