Both sentences are correct. Whoever told you that you can't use 'fast' in this way is over-applying a rule.
The rule is this: we use adverbs ( like 'quickly') to modify verbs and we use adjectives (like 'quick') to modify nouns. For example:
He is speaking quickly.
We had a quick conversation.
or
He drives carefully.
He is a careful driver.
Because of this, many people wrongly assume that all adverbs end in 'ly'. In fact, there are many exceptions. For example, 'well' and 'hard' are very common adverbs which don't end in 'ly' - 'He sings well' and 'He works hard'.
'Fast' is also an exception because it is both an adjective and an adverb: you can say both 'This is a fast car' and 'This car goes fast'.