rust-lang / rust-lang/rust-playground

Playgrounds rejects valid Rust (due to input processing?)

Open
#485 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug question
Dominant language
Rust
Stars
1.4k
Forks
267
Avg merge
3h 2m
Merged PRs (30d)
6

Description

This code is expected to work but generates a compiler error due to a comment:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=45b03c2e33ff3b6c20af40794c505c92

   Compiling playground v0.0.1 (/playground)
error: this file contains an un-closed delimiter
 --> src/main.rs:1:1854
  |
1 | pub fn main() {
    let reserved_names: [&str; 103] = [
        "as",
        "break",
        "const",
(snip)

If rust-playground tries to put all the code on a single line, that's likely the problem. Thanks for building and maintaining such a useful tool; much appreciated!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Rust Playground gist and compare the source sent to the compiler with the original formatting, especially around the comment that triggers the un-closed-delimiter error. Trace the playground's input-processing path to identify where valid Rust is altered; done means the linked example compiles successfully without the delimiter error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.